简体   繁体   English

JwPlayer无法播放rtmp流吗?

[英]JwPlayer not playing rtmp stream?

i have setup Jwplayer like this in my html under the script tag: 我在脚本标签下的html中设置了这样的Jwplayer:

<script type="text/javascript">

         jwplayer("container").setup({
            flashplayer: "js/jwplayer.flash.swf",
            file: "rtmp://localhost:1935/121/mystream.stream",
            height: 270,
            width: 506
             });

    </script>

but it is giving me a error like "No playble source found". 但这给了我一个错误,例如“找不到可播放的来源”。 But if check my live stream on online jw player,its working fine. 但是,如果在在线jw播放器上检查我的实时流,则可以正常工作。 And if i use a demo url "http://content.bitsontherun.com/videos/lWMJeVvV-364767.mp4" then my player is working fine.I dont know what wrong in this.Please help. 如果我使用演示网址"http://content.bitsontherun.com/videos/lWMJeVvV-364767.mp4"则我的播放器工作正常。我不知道这有什么问题。请帮助。

You need to put the player library in the head and the player embed code in the body. 您需要将播放器库放在头部,而播放器在主体中嵌入代码。 You can delete flashplayer: "js/jwplayer.flash.swf", altogether since the JW Player js library will determine whether the .swf file is necessary and include it under the hood. 您可以删除flashplayer: "js/jwplayer.flash.swf",因为JW Player js库将确定是否需要.swf文件并将其包含在flashplayer: "js/jwplayer.flash.swf",

More info on basic video embeds, including sample code here: https://support.jwplayer.com/customer/portal/articles/1406723 有关基本视频嵌入的更多信息,包括此处的示例代码: https : //support.jwplayer.com/customer/portal/articles/1406723

Is your stream at rtmp://localhost:1935/121/mystream.stream accessible from where you are hosting the web page? 您可以从托管网页的位置访问位于rtmp:// localhost:1935/121 / mystream.stream的流吗? Based on the domain (localhost:1935) I would not expect this stream to be accessible by anyone on the internet outside of your local network. 基于域(localhost:1935),我希望您本地网络之外的Internet上的任何人都不能访问此流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM