Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flash fallback throws error in IE8 when Flash is not available #631

Closed
tdcook opened this issue Jul 11, 2013 · 2 comments
Closed

Flash fallback throws error in IE8 when Flash is not available #631

tdcook opened this issue Jul 11, 2013 · 2 comments

Comments

@tdcook
Copy link

tdcook commented Jul 11, 2013

While using IE8 when Flash is not available, video.js throws an uncaught JavaScript error. The error is at line 450 of player.js, on a check for this.tech.isReady_. this.tech is undefined in this situation so this fails with the error "this.tech.isReady_ is null or not an object" as given by IE8. I have not tested this in other non-HTML5 browsers.

Steps to reproduce:

  1. Open any page containing a video.js-enhanced video using IE8 with Flash uninstalled or disabled.
  2. Observe that IE8 reports the error described above.

Expected behavior: video.js should gracefully handle this without throwing an error.

To fix this we must check that this.tech is defined before checking this.tech.isReady_. Curiously there is commented-out code directly above this line that does just that.

@sp00n
Copy link

sp00n commented Jan 11, 2014

There are now new bugs regarding this issue. One I've mentioned here: #865 (comment)
Line

vjs.Player.prototype.userActive = function(bool){
[...]
        // Chrome/Safari/IE have bugs where when you change the cursor it can
        // trigger a mousemove event. This causes an issue when you're hiding
        // the cursor when the user is inactive, and a mousemove signals user
        // activity. Making it impossible to go into inactive mode. Specifically
        // this happens in fullscreen when we really need to hide the cursor.
        //
        // When this gets resolved in ALL browsers it can be removed
        // https://code.google.com/p/chromium/issues/detail?id=103041
        this.tech.one('mousemove', function(e){
          e.stopPropagation();
          e.preventDefault();
        });
[...]
}

And after adding a conditional check around this code block, another one pops up here once you hit the play button:

// Pass values to the playback tech
vjs.Player.prototype.techCall = function(method, arg){
  // If it's not ready yet, call method when it is
  if (this.tech && !this.tech.isReady_) {
    this.tech.ready(function(){
      this[method](arg);
    });

  // Otherwise call method now
  } else {
    try {
      this.tech[method](arg);
    } catch(e) {
      vjs.log(e);
      throw e;
    }
  }
};

Even though it's embedded in a try/catch statement, IE8 without Flash still throws an error that 'this.tech is null or not an object'.

I think the optimal solution would be to integrate a check for the Flash fallback into VideoJS, if the video tag isn't available.

@heff
Copy link
Member

heff commented Mar 4, 2014

Working through this in #1041

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants