可能是我最喜欢的问题,但我还没有找到任何答案
如何在Android设备上播放直播?
有什么免费的解决方案吗?
我认为高级版本的JWplayer支持这一点,但不支持免费的版本。
我通过JSONP使用CDNsun,它给我返回了很多这样的协议。
MyCallBack({
“rtmp”: “rtmp://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4”,
“rtmpe”: “rtmp://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4”,
“apple”: “http://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4/playlist.m3u8”,
“adobe”: “http://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4/manifest.f4m”,
“rtsp”: “rtsp://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4”,
“silverlight”: “http://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4/Manifest”
});
我已经尝试了所有这些(从RTSP开始),但没有成功,在PC上流还可以,但Android太糟糕了:(
谢谢
发布于 2014-02-26 00:21:39
在android的jwplayer中没有流媒体视频的选项。点击此处阅读更多信息:http://www.jwplayer.com/blog/the-pain-of-live-streaming-on-android/
发布于 2014-02-26 05:10:23
我想出了一个讨厌的工作来解决这个问题。这不是最漂亮的东西,但它最终将使用原生Android媒体播放器启动流。
您可以使用以下代码来测试此工作:
<!DOCTYPE html>
<script src="http://p.jwpcdn.com/6/8/jwplayer.js"></script>
<center><div id='container'></div></center>
<script>
if (navigator.userAgent.match(/android/i) != null){
jwplayer("container").setup({
file: "http://playertest.longtailvideo.com/adaptive/bbbfull/bbbfull.m3u8",
type: "mp4",
primary: "html5"
});
} else {
jwplayer("container").setup({
playlist: [{
image: "http://content.bitsontherun.com/thumbs/gSzpo2wh-480.jpg",
sources: [{
file: "http://content.jwplatform.com/manifests/s8BPzDe0.smil"
},{
file: "http://playertest.longtailvideo.com/adaptive/bbbfull/bbbfull.m3u8"
}]
}],
primary: "flash"
});
}
</script>
它在桌面上播放RTMP,在iOS上播放HLS,并为Android提供了一个后备功能,使其也可以在默认的Android媒体播放器中播放m3u8。
https://stackoverflow.com/questions/22015426
复制相似问题