jMediaelement
jMediaelement copied to clipboard
.isPlaying() is false while video actually playing
.isPlaying() is false while the video is actually playing, if the video has previously reached the end.
A workaround is to save the value of .isPlaying() before calling .currentTime(n) and restore it afterwards using either .play() or .pause().
The following html/javascript page requires jquery and jme 1.3.4, plays the video automatically, and reports the issue in the browser console in Firefox 6.0.2 running on Ubuntu.
<script src="jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="jme/mm.full.js"></script>
<video src="http://www.protofunc.com/jme/media/bbb_trailer_400p.ogg" controls autoplay="autoplay"></video>
<script>
$(document).ready(function(){
$("video").jmeEmbed().jmeReady(function() {
$("video").
currentTime(30).
bind("timeupdate", function(){
$("span").text($("video").isPlaying());
}).
bind("ended", function(){
$("video").currentTime(10);
$("video").bind("timechange", function(event, data){
console.log("The video is playing (second "+ data.time +") but isPlaying() returns "+ $("video").isPlaying());
});
});
});
});
</script>
Hi,
I can confirm this bug. JME implements the "probably playing" algorythm defined by the HTML specification. If you also add:
console.log(this.paused)
You will see, that FF6 has an error here and reports, that the video is in paused state. This is an FF bug. Could you please fill a bug in mozilla bugtracker?
I will write a workaround to get this fixed, until then additionally use the play method to show FF, that he is not in paused state.
I only want to let you know, that I will work next week on this.