【问题标题】:RTMPS protocol, Videojs, HTML5, live-streamingRTMPS 协议、Videojs、HTML5、直播
【发布时间】:2017-03-06 01:22:50
【问题描述】:

我正在开发 videojsrtmps 直播。

但是我有一个问题。 T_T

rtmps 直播不播放。 (Rtmp 效果很好。)

即使您使用其他 Flash 播放器,它也不会播放。 (例如) jwplayer


<video ...
data-setup='{ "techOrder":["html5", "flash"]}'>
...
<source src = " ** RTMPS_URL ** " type ="rtmp/flv"/>
</video>
  • RTMPS_URL : rtmps://{SERVER_URL}/?{PARAMETER}
  • SERVER_URL : IP:PORT/args1/args2
  • 参数:键 = 值

videojs 错误信息。

“FLASH:rtmpconnectfailure”

疑似部分如下。

  1. rtmps服务器正在写个人证书。(证书未经公共机构认证) 于是我在电脑上安装了个人证书,报错是一样的。

  2. 据说 Videojs 博客提供 rtmps。你确定吗?

我做错了什么?

我需要你的帮助。

谢谢 :-)

【问题讨论】:

标签: javascript php video.js live-streaming rtmps


【解决方案1】:

我希望你解决了这个问题,但我仍然在这里发布解决方案,以解决和我一样的问题。

我的工作环境: 带有rtmp模块的nginx,ffmpeg从ip camera获取RTSP并以flv格式推送到nginx,在web中显示这个流。

videojs 变化很大,所以我把我的 html 放在这里:

<html>
<script src="./video.min.js"></script>  //download the videojs from npm or use the online url one
<link rel="stylesheet" type="text/css" href="./video-js.css">
<script src="https://cdn.jsdelivr.net/npm/videojs-flash@2/dist/videojs-flash.min.js></script>

<body>
<video id="liveVideo" class="video-js" controls autoplay preload="auto" width="320" height="240" data-setup="{}">
        <!-- <source src="rtmp://ns8.indexforce.com/home/mystream" type="rtmp/flv">-->
        <!-- the above rtmp link is for testing your videojs works or not -->
        <source src="rtmp://192.168.1.180/cam1/" type="rtmp/flv">
</video>
</body>
</html>

#########################

rtmp://192.168.1.180/cam1/ is my nignx server ip address (both my server and client are in the same local network)

ffmpeg -i <Your video/stream> -f flv <Your RTMP url>

#########################

我首先得到 FLASH: rtmpconnectfailure, VIDEOJS: ERROR: (CODE:0 MEDIA_ERR_CUSTOM) FLASH: rtmpconnectfailure。

I solved by just adding a '/' at the end in "<video....><source src="rtmp://.../.../ <----this one '/' "></video>" in my html file

因此,请确保在源网址的末尾添加“/”。

2020 年 12 月在 Chrome、Opera 和 Edge 中成功运行(必须在浏览器设置中启用 flash)

祝你好运:o)

【讨论】:

    猜你喜欢
    • 2015-07-28
    • 2014-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-28
    • 1970-01-01
    • 1970-01-01
    • 2014-10-16
    相关资源
    最近更新 更多