使用JWplayer Android中的流媒体视频播放的PhoneGap [英] Using JWplayer in Android for streaming video playback in Phonegap

查看:2709
本文介绍了使用JWplayer Android中的流媒体视频播放的PhoneGap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用JWPlayer作为针对Android不支持HLS播放在web视图中的PhoneGap的方式(或AR至少我无法得到它的工作,只与WebM的溪流和的 https://github.com/macdonst/VideoPlayer ,HLS流只给出音频)

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 )

我知道用户需要安装Flash,但目前什么是最importart对我来说是让无论是RTMP或HLS(.m3u8)显示在设备上(2.3,4.0或4.1,两者的工作原理!)

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!)

不过,我不断收到错误加载球员:没什么可玩的来源上出现的Android中实现JWplayer时错误。到目前为止,我只有在模拟器中进行测试。

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.

在code是什么花哨,在HTML文件中,包括科尔多瓦JS毕竟我做的是:

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

 <script type="text/javascript" src="jwplayer/jwplayer.js" ></script>
 <script type="text/javascript">jwplayer.key="b+mykey"</script>
 <div id="my-video"></div> 
 <script type="text/javascript">
        jwplayer('my-video').setup({
            flashplayer: "javascripts/lib/jwplayer/player.swf",      
                 streamer: "rtmp://myserveraddressgoeshere",
                 file: "corecctfile.goeshere-sdh",
                 provider:"rtmp",
                 autostart: 'true',
                 controlbar: "over",
                 width: '720',
                 height: '405'
         });</script>

很显然,我有正确的路径,但掩盖他们在这里为客户隐私的原因。

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

有没有人有一个想法,为什么这不起作用?或如何的可以的获取RTMP / HLS流在Android设备上运行? 如所提到的应用程序是一个PhoneGap的应用程序。

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.

谢谢!

推荐答案

JW播放器不支持Flash在Android上了,因为到Adobe的响应也呈减少趋势Android的Flash支持。只有HTML5(因此只MP4 / WebM的)的支持,由于Android 2.3的。

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实时流的确具有HTML5在Android的支持有限。这只是扮演4.0+,并有一些严重的安全漏洞:显示宽高比无法识别和点播HLS流像活的行为(无时间表;不求)

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).

要流在Android上最好的解决办法是利用支持HLS为您的本机应用程序的SDK。有几家公司提供这样一个SDK(如devicedrm.com或nexstreaming.com)。我不知道是不是这样的解决方案将与PhoneGap的工作,虽然。

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.

这篇关于使用JWplayer Android中的流媒体视频播放的PhoneGap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆