VideoJS progress event always 0 on Safari 5.1

2019-07-25 21:14发布

I'm having this weird behaviour on Safari 5.1, while playing a video with VideoJS:

if I listen to the progress event:

var player = videojs('player_id', { 
    preload: 'auto'
    techOrder: [ 'html5' ]
});

player.on( 'progress', on_progress );

player.ready( function() { player.play() } );

I will only get value 0 in the callback:

function on_progress( event ) {
    console.log( 'buffered', player.bufferedPercent() );
    // it will log always 0
}

Notes:

  • I can use only html5 player

  • I'm using mp4/h264 videos with fallback to webm and ogv

  • The code works on Chrome, Firefox and latest Safari

Any ideas?

1条回答
一纸荒年 Trace。
2楼-- · 2019-07-25 21:25

Actually I've tried several video players and it looks like no one supports Safari 5.1.

These are the libraries i've tried with no luck:

http://www.videojs.com/

http://www.jwplayer.com/

http://jplayer.org/latest/demo-01-video/

http://flowplayer.org/

http://www.projekktor.com/

Even http://caniuse.com/#search=video says Safari 5.1 supports html5 videos but the reality is IT DOESN'T.

查看更多
登录 后发表回答