Javascript 如何使用JW播放器流式播放视频?
我目前有JW播放器设置,所以它的第一个选项是HTML5,回退是FLV,然后回退到下载 只有HTML5的路线似乎流的视频,但我需要它来流在flash路线的视频太多 你知道我需要使用哪些额外的参数吗 当前设置如下所示:Javascript 如何使用JW播放器流式播放视频?,javascript,jwplayer,Javascript,Jwplayer,我目前有JW播放器设置,所以它的第一个选项是HTML5,回退是FLV,然后回退到下载 只有HTML5的路线似乎流的视频,但我需要它来流在flash路线的视频太多 你知道我需要使用哪些额外的参数吗 当前设置如下所示: jwplayer('the_video_container').setup({ 'id': 'playerID', 'width': '654', 'height': '410', 'fi
jwplayer('the_video_container').setup({
'id': 'playerID',
'width': '654',
'height': '410',
'file': '/video/keyword_vid_1.mp4',
'autostart': 'true',
'controlbar': 'none',
'screencolor': 'FFFFFF',
'repeat': 'always',
'modes': [
{type: 'html5'},
{type: 'flash', src: '/js/jwplayer/player.swf'},
{type: 'download'}
]
});
jwplayer('the_video_container').setup({
'id': 'playerID',
'flashplayer':'/js/jwplayer/player.swf',
'width': '654',
'height': '410',
'file': '/video/keyword_vid_1.mp4',
'autostart': 'true',
'controlbar': 'none',
'screencolor': 'FFFFFF',
'repeat': 'always',
'modes': [
{type: 'html5'},
{type: 'flash'},
{type: 'download'}
]
});
尝试按如下方式设置JW播放器:
jwplayer('the_video_container').setup({
'id': 'playerID',
'width': '654',
'height': '410',
'file': '/video/keyword_vid_1.mp4',
'autostart': 'true',
'controlbar': 'none',
'screencolor': 'FFFFFF',
'repeat': 'always',
'modes': [
{type: 'html5'},
{type: 'flash', src: '/js/jwplayer/player.swf'},
{type: 'download'}
]
});
jwplayer('the_video_container').setup({
'id': 'playerID',
'flashplayer':'/js/jwplayer/player.swf',
'width': '654',
'height': '410',
'file': '/video/keyword_vid_1.mp4',
'autostart': 'true',
'controlbar': 'none',
'screencolor': 'FFFFFF',
'repeat': 'always',
'modes': [
{type: 'html5'},
{type: 'flash'},
{type: 'download'}
]
});
请记住,对于那些在html5播放中不支持mp4的浏览器,您可能希望在html5的
src
块中包含额外的attributes。当您说“stream”时,您实际上是指流还是指“渐进下载”?@daniel0mullins,指“stream”我的意思是,用户不必等到整个mp4下载后才开始播放视频。渐进式下载可以为您做到这一点,或者至少如果您的视频文件提示正确的话应该做到这一点。你用什么来编码?我想你的设置变量可能有问题。我很确定src
在模式中对于flash
是文件的替代版本。我想你想要的是设置flashplayer
变量。@daniel0mullins,mp4文件是H.264,“代码”如上所述,它完成了所有其他工作,只是在非html5路由方面似乎没有“进步”。我需要更改什么才能使其工作?您应该设置flashplayer
属性。见下面的答案。