Question

I'm trying to figure out why currentTime() function does not work properly in firefox when video is playing through the flash.

Environments to reproduce problem:

  1. Ubuntu 13.04, FF 24.0.
  2. Mac Os 10.7.5 Firefox 24.0

Let me explain more detail please.

Here is code [http://jsfiddle.net/jSmkm/11]. You can see several buttons to start playing video from different seconds. Steps to reproduce the problem:

  • press big play button to start watching video
  • after video is loaded, press "play from 5s". The result: video starts playing from the beginning(0s)
  • when you press on 10s, the result: video starts from 8s (not from 10)
  • the same for 20s. When press the video starts from 18s
  • with 30s and 40s situation is little better. When press video starts from 29s and 39s.

For example, if you open this code in chrome, where video would be playing through the html5, every button works perfect. When press "5s" button, video starts exactly from 5s. The same for other seconds. Everything works perfect with html5.

Has anybody else noticed this and do you have any info how it could be fixed?
All help would be appreciated.

Was it helpful?

Solution

This is a Flash limitation. Flash can only seek to keyframes. If you want it to be more accurate you can have your encoder create more keyframes in your video file, but you'll also sacrifice size doing that.

Also mentioned here: NetStream.seek() for mp4 to exact position not keyframe

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top