JWPlayer和HLS流媒体 - “错误加载播放器:找不到可播放的来源” [英] JWPlayer and HLS streaming - "Error loading player: No playable sources found"

查看:2443
本文介绍了JWPlayer和HLS流媒体 - “错误加载播放器:找不到可播放的来源”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题

我有一个从IP摄像机流向HLS的服务器(nginx-rtmp-module)。
我想将流媒体内容嵌入流行的浏览器:Chrome,Firefox和IE。



此流在某些桌面浏览器上无法使用。





我试过了什么



经过测试的设备和浏览器: b
$ b


  • PC上的Firefox - 加载播放器时出错:找不到可播放的来源 / li>
  • IE 11 - 确定

  • Chrome上的个人电脑 - 确定


  • iPhone - 好的



问题



如何解决这些问题? Flash是在桌面浏览器上进行实时HLS流媒体播放的必要条件吗?

解决方案

联系jwpplayer支持和一些源代码挖掘后,出于某些原因。

Flash不一定是实时流式传输的必要条件,但它是Chrome和Firefox(除IE之外)的HLS播放要求。 Chrome拥有自己的Flash内置版本,因此除非故意禁用,否则应该播放HLS流,无需下载和安装Flash Player。在我的机器上IE 11正在工作,但Firefox失败,并显示消息Error loading player:No playable sources found (因为缺少Flash插件)。所以我添加了一些JavaScript来显示正确的消息。

swfobject.js库是这个工作所必需的: http://github.com/swfobject/swfobject

  jwplayer。键= << -THE-密钥 - >> 中; 
var player = jwplayer(video_container)。setup({
file:http://domain.lt/live/stream.m3u8,
androidhls:true,
width:'100%',
aspectratio:'16:9',
autostart:'true',
stretch:'fill'
});

player.onSetupError(function(error)
{
if(swfobject.getFlashPlayerVersion()。major == 0)
{
var message =下载Adobe Flash< / a>(取消选中McAfee Security扫描加号和英特尔安全真正的关键)< / p>';
$(#video_container)。hide();
$(#video_callout)。html消息);
} else
{
var message ='< p>您的设备不受支持,请访问另一台PC或手机上的此页面。< / p>';
$(#video_container)。hide();
$(#video_callout)。html(message);
}
});


The problem

I have a server (nginx-rtmp-module) that streams from IP camera to HLS. I want to embed the live stream to popular browsers: Chrome, Firefox and IE.

The stream is not working on some desktop browsers.

What I tried

Tested devices and browsers:

  • Firefox on PC - "Error loading player: No playable sources found"
  • IE 11 - OK
  • Chrome on PC - OK
  • Chrome on Android - OK
  • iPhone - OK

The questions

How to resolve these issues? Is the flash a requirement for live HLS streaming on desktop browsers?

解决方案

After contacting jwpplayer support and some source code digging, I figured out some facts.

Flash is not necessarily a requirement for live streaming but it is currently a requirement for HLS playback in Chrome and Firefox (in addition to IE). Chrome has its own built-in version of Flash, so unless it was deliberately disabled, it should play the HLS stream without needing to download and install the Flash Player. However, Firefox and IE would need the Flash Player installed.

On my machine IE 11 was working, but Firefox failed with message "Error loading player: No playable sources found" (because of missing Flash plugin). So I added some JavaScript to display correct message.

swfobject.js library is required for this to work: http://github.com/swfobject/swfobject

jwplayer.key="<<-THE-KEY->>";
var player = jwplayer("video_container").setup({
    file: "http://domain.lt/live/stream.m3u8",
    androidhls: true,
    width: '100%',
    aspectratio: '16:9',
    autostart: 'true',
    stretching: 'fill'
});

player.onSetupError(function(error)
{
    if (swfobject.getFlashPlayerVersion().major == 0)
    {
        var message = 'Flash is missing. Download it from <a target="_blank" href="http://get.adobe.com/flashplayer/" class="underline">Adobe</a>. (uncheck "McAfee Security Scan Plus" and "True Key™ by Intel Security" )</p>';
        $("#video_container").hide();
        $("#video_callout").html(message);
    } else
    {
        var message = '<p>Your device is not supported. Please visit this page on another PC or Phone.</p>';
        $("#video_container").hide();
        $("#video_callout").html(message);
    }   
});

这篇关于JWPlayer和HLS流媒体 - “错误加载播放器:找不到可播放的来源”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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