6

I'm using video JS and in firefox the event "ended" gets fired at the end and at the beginning of the video play.

Take a look to that fiddle in FF: http://jsfiddle.net/planadecu/a3Chu/

In all the other browsers work correctly.

The piece of code called at the video start is the following:

var videoPlayer = _V_("video", {}, function(){
  this.addEvent("ended", function(){ 
      this.posterImage.el.style.display = 'block';
  });
});​

I need to trigger an event just at the end of the video, not at the start. Do you know a way to workaround this issue (to me its a bug) ?

You can reproduce it on the fiddle provided.

Thanks for your help.

Jordi P.S.
  • 3,838
  • 7
  • 36
  • 59

1 Answers1

4

I think this is a problem with your video...

Check this out: http://jsfiddle.net/a3Chu/2/

All I've done is removed this source file:

<source type="video/webm" src="http://www.reservango.com/static/video/reservango_video_vfinal_CAT.webm">

I noticed that the script is firing correctly - the video starts at the end(!)

I tried with alternate .webm files and they behaved normally, so I'm stuck thinking it's something with your file in particular.

I've used FF 15.0.1 for testing

EDIT

I've also tested this on FF 16.0.2 - still seems to be that video file in particular. You can, of course, change up the source so that the other formats are attempted first. I know that my FF will run the .ogv if the .webm is the last source item within the fiddle I modified (above). This is not going to be completely reliable however. I also found this (old FF version but same issue): https://stackoverflow.com/a/10138928/427485 which suggests the same approach.

I find it very strange that some .webm files are working... Are you able to try re-encoding the video? Also I'd check all your mime type on that server, just in case they are wrong and only FF is getting confused (wouldn't be the first time...). This would also explain why the .webm's hosted elsewhere render fine.

Community
  • 1
  • 1
Stuart Burrows
  • 10,824
  • 2
  • 34
  • 33
  • The headers are fine, just checked them http://www.reservango.com/static/video/reservango_video_vfinal_CAT.webm in http://web-sniffer.net/ and the value is video/webm. – Jordi P.S. Nov 13 '12 at 19:40
  • Cool, so we can scratch that off. I'm back to "it's the video". Check this out: http://jsfiddle.net/a3Chu/3/ something is affecting FF within those first 5 seconds of the video. If you uncomment the js it will still fail for both videos, but I maintain it's the video – Stuart Burrows Nov 14 '12 at 10:31
  • Just tried encoding the `.ogv` file to `.webm` on http://firefogg.org and it works fine, no skipping to the end. Just used the basic settings, but I think this does mean it is your file. If I were you I'd try re-encoding it a couple of times with different settings using the original software – Stuart Burrows Nov 14 '12 at 10:43