我们使用JW Player 6.11进行视频播放.mp4& .flv但没有工作。
我如何为iPad修复此问题?
function playvideo() {
jwplayer("mediaplayer").setup({
playlist: [{
sources: [
{ file: "<?php echo $this->getUrl().'Content/video/'.trim($_product->getVideourl());?>",
//type: 'html5',
}
],
title: "Play"
}
],
controlbar: "none",
height:388,
width: 610,
streamer: "rtmp://s14flalja9b5hr.cloudfront.net/cfx/st",
startparam: "ec_seek",
fallback: false,
repeat: false,
autostart: true,
primary: 'flash',
bufferlength: '30',
stretching: 'fill',
onpause: 'true',
events: {
onReady: function() {
var t = setInterval(function() {
jwplayer("mediaplayer").play();
clearInterval(t);
}, 500);
},
onComplete: function() {
var t = setInterval(function() {
jwplayer("mediaplayer").remove();
clearInterval(t);
}, 500);
},
}
});
答案 0 :(得分:2)
RTMP是仅限Flash的协议。无论您使用什么播放器脚本,它都需要Flash。它无法在移动设备(iOS,Android)上使用,因为它们都不支持Flash。
任何移动设备上都没有自动启动 - 这就是设备本身的设计方式,而且您无法覆盖它。
答案 1 :(得分:0)
@RaviPatel,您应该使用以下代码在不支持的闪存设备中的PC,Laps和html5等闪存设备中播放rtmp。
jwplayer("myElement").setup({
playlist: [{
image: "/assets/myVideo.jpg",
sources: [{
file: "rtmp://example.com/application/mp4:myVideo.mp4"
},{
file: "/assets/myVideo.mp4"
}]
}],
height: 360,
primary: "flash",
width: 640
});
在这里,
file: "rtmp://example.com/application/mp4:myVideo.mp4" is used for flash mode
和
file: "/assets/myVideo.mp4"is used for mobile devices like iOs and android..
这是您的解决方案,试试这个并希望它有所帮助。