Skip to content
This repository

Fullscreen in Flash mode causes JS errors and reinstantiates the Flash object in Safari and Firefox #108

Closed
stevecochrane opened this Issue December 19, 2011 · 6 comments

3 participants

Steve Cochrane Steve Heffernan Matthias Dietrich
Steve Cochrane

My guess is that this is something related to resizing of the Flash object, because the same errors happen for fullscreen mode in both Safari and Firefox, and those have different fullscreen methods (Safari uses the JS Fullscreen API and Firefox uses the full window method).

The specific error text that comes up in my WebKit Inspector and Firebug consoles is something like this:

this.el.vjs_getProperty is not a function (tech.js, line 296)
return _V_.createTimeRange(0, this.el.vjs_getProperty("buffered"));

The reinstantiation of the Flash object is pretty major because you lose track of your progress in the video and you have to start over. Also, if you're like me and you're using a modified version of the Flash fallback to serve preroll ads, for example, then the viewer has to watch the preroll again.

Neither Chrome or IE7-9 have these same errors, but they're also not quite perfect as the initial poster image is not resized when entering fullscreen. The video is resized just fine when it starts to play, but if you hit fullscreen before playing the video, the poster is not expanded to fill the screen.

Steve Heffernan
Owner
Steve Cochrane

Haha, maybe they're just going to wait for Flash to die rather than fix the bug, at this point. Reloading and jumping back to where it was seems like the best you can do in that case.

I'll try not to bother you with preroll issues since it's a custom implementation that only affects us, but I'm thinking I could clear any preroll-related flashvars when the fullscreen button is pressed, so that it no longer contacts the ad server from that point on. Speaking of which, we'd be glad to open source the work our contractor did with integrating LiveRail support, though I won't be able to get to that until January. Thanks again Steve.

Matthias Dietrich

Hi, jumping in here, too. I'm having similar issues with Flash in the Chrome 16 and Firefox 9 (don't know how this behaves in other versions yet). I forced Flash mode via VideoJS.options.techOrder=['flash'];. When switching into full screen mode the video begins to playback from the beginning.

I'm not sure whether I can check if the current mode is the Flash mode and if so set the current playback time to the where it was before. Any hints?

Matthias Dietrich

Just saw the comment here: https://github.com/zencoder/video-js/blob/master/src/player.js#L229

I don't see where that method is called and where it would cache the current time.

Steve Cochrane

Hey Matthias, as for checking what the current mode of the player is, you can use VideoJS('vid').techName (substituting 'vid' for the id of your video element).

I've tried setting currentTime when entering fullscreen to get around this issue, but it doesn't seem to work when the player is in Flash mode as far as I can tell. For example, when I do VideoJS('vid').currentTime(2) when the player is in HTML5 mode, it immediately skips the current time to 2 seconds in, but when the player is in Flash mode it has no effect.

Steve Cochrane

I'll close this since it looks like we've done everything we can do here. The JS errors have since been fixed, the restarting can be fixed for Safari by using the iframemode option, and it seems like there's nothing we can do for the restarting in Firefox, other than store the current time before switching to fullscreen and then use JS to seek that point after the switch as Steve H. suggested.

Steve Cochrane stevecochrane closed this June 01, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.