JwPlayer 不播放 rtmp 流?
JwPlayer not playing rtmp stream?
我在脚本标签下的 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>
但它给我一个像 "No playble source found" 这样的错误。但是如果在在线 jw 播放器上查看我的直播,它工作正常。如果我使用演示 url "http://content.bitsontherun.com/videos/lWMJeVvV-364767.mp4"
那么我的播放器正在工作 fine.I 不知道 this.Please 帮助中有什么问题。
您在 rtmp://localhost:1935/121/mystream.stream 的流可以从您托管网页的地方访问吗?基于域 (localhost:1935),我不希望本地网络以外的互联网上的任何人都可以访问此流。
您需要将播放器库放在头部,将播放器嵌入代码放在正文中。您可以完全删除 flashplayer: "js/jwplayer.flash.swf",
,因为 JW Player js 库将确定是否需要 .swf 文件并将其包含在后台。
有关基本视频嵌入的更多信息,包括此处的示例代码:
https://support.jwplayer.com/customer/portal/articles/1406723
我在脚本标签下的 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>
但它给我一个像 "No playble source found" 这样的错误。但是如果在在线 jw 播放器上查看我的直播,它工作正常。如果我使用演示 url "http://content.bitsontherun.com/videos/lWMJeVvV-364767.mp4"
那么我的播放器正在工作 fine.I 不知道 this.Please 帮助中有什么问题。
您在 rtmp://localhost:1935/121/mystream.stream 的流可以从您托管网页的地方访问吗?基于域 (localhost:1935),我不希望本地网络以外的互联网上的任何人都可以访问此流。
您需要将播放器库放在头部,将播放器嵌入代码放在正文中。您可以完全删除 flashplayer: "js/jwplayer.flash.swf",
,因为 JW Player js 库将确定是否需要 .swf 文件并将其包含在后台。
有关基本视频嵌入的更多信息,包括此处的示例代码: https://support.jwplayer.com/customer/portal/articles/1406723