Safari 5.1上的VideoJS进度事件始终为0 [英] VideoJS progress event always 0 on Safari 5.1
问题描述
我在使用VideoJS播放视频时在Safari 5.1上有这种奇怪的行为:
I'm having this weird behaviour on Safari 5.1, while playing a video with VideoJS:
如果我听取进度事件:
var player = videojs('player_id', {
preload: 'auto'
techOrder: [ 'html5' ]
});
player.on( 'progress', on_progress );
player.ready( function() { player.play() } );
我只会在回调中获得价值0:
I will only get value 0 in the callback:
function on_progress( event ) {
console.log( 'buffered', player.bufferedPercent() );
// it will log always 0
}
注意:
-
我只能使用html5播放器
I can use only html5 player
我正在使用mp4 / h264视频,回退到webm和ogv
I'm using mp4/h264 videos with fallback to webm and ogv
该代码适用于Chrome,Firefox和最新的Safari
The code works on Chrome, Firefox and latest Safari
任何想法?
推荐答案
其实我已尝试了几个视频玩家看起来没有人支持Safari 5.1。
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://jplayer.org/latest/demo-01-video/
甚至 http://caniuse.com/#search=video 表示Safari 5.1支持html5视频,但实际情况并非如此。
Even http://caniuse.com/#search=video says Safari 5.1 supports html5 videos but the reality is IT DOESN'T.
这篇关于Safari 5.1上的VideoJS进度事件始终为0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!