Using JWplayer in Android for streaming video playback in Phonegap

匿名 (未验证) 提交于 2019-12-03 02:03:01

问题:

I'm trying to use JWPlayer as a way around Android not supporting HLS playback in Webview in Phonegap (or ar least I can't get it to work, only with WebM streams and the video plugin on https://github.com/macdonst/VideoPlayer , HLS streams give audio only )

I know the user needs flash installed but at the moment what's most importart for me is to get either the RTMP or HLS (.m3u8) displayed on the device (2.3, 4.0 or 4.1, whichever works!)

However I keep getting the "Error loading player: no playable sources found" error when implementing the JWplayer in android. So far I have only tested in the simulator.

The code is nothing fancy, in the HTML file after including cordova JS all I do is:

     

Obviously I have the correct paths but obscured them here for client privacy reasons.

Does anyone have an idea as to why this does not work? Or how I can get the RTMP / HLS stream to work on an Android device? As mentioned the application is a PhoneGap application.

Thanks!

回答1:

JW Player does not support Flash on Android anymore, as a response to Adobe also dropping Android Flash support. Only HTML5 (and therefore only MP4/WebM) are supported, as of Android 2.3.

HTTP Live Streaming indeed has limited support for HTML5 in Android. It's only playing in 4.0+ and has a few critical bugs: display aspect ratios are not recognised and on-demand HLS streams act like live ones (no timeline; no seeking).

The best solution to streaming on Android is leveraging an SDK that supports HLS for your native app. Several companies offer such an SDK (e.g. devicedrm.com or nexstreaming.com). I don't know whether such solutions would work with Phonegap though.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!