2014-02-25 85 views
1

可能是最喜歡的問題,但我還沒有找到任何答案在Android上播放實時流

如何在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),但沒有成功,該流是OK的PC而Android吸:(

謝謝

回答

0

我想出了一個骯髒的工作圍繞這是不是最漂亮的事情,但它最終會推出使用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在桌面上,HLS iOS上,並有Android版在默認的Android媒體播放器也玩M3U8後備。

+0

感謝Ethan我在jwPlayer網站上看過很多你的帖子。謝謝你幫助我們,謝謝JWPlayer :) – user2042985

+0

沒問題! :)如果它適合你,請提高我的解決方案,謝謝! :-) – emaxsaun

+0

當然,我會做:) – user2042985