jMediaelement icon indicating copy to clipboard operation
jMediaelement copied to clipboard

.isPlaying() is false while video actually playing

Open robertofraile opened this issue 14 years ago • 2 comments
trafficstars

.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>

robertofraile avatar Sep 13 '11 09:09 robertofraile

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.

aFarkas avatar Sep 13 '11 17:09 aFarkas

I only want to let you know, that I will work next week on this.

aFarkas avatar Sep 16 '11 17:09 aFarkas