【问题标题】:Is there any videojs + rtmp example that can run?有没有可以运行的videojs + rtmp示例?
【发布时间】:2018-11-30 10:08:04
【问题描述】:

使用 videojs 播放 rtmp 视频花了我几个小时。谁能给出一个可以运行的例子吗?

我正在使用铬。 Flash 已启用。

下面是我的代码。视频网址有效。谁能让它运行?

<html>
<head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/video.js@7.3.0/dist/video-js.min.css">
    <script src="https://cdn.jsdelivr.net/npm/video.js@7.3.0/dist/video.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/videojs-flash@2.1.2/dist/videojs-flash.min.js"></script>
</head>
<body>

<video width="600"
       height="400"
       id="example"
       class="video-js vjs-default-skin vjs-big-play-centered"
       controls
       autoplay
       preload="auto"
       data-setup='{"techorder" : ["flash","html5"] }'>
    <source src="rtmp://rtmp.open.ys7.com/openlive/f01018a141094b7fa138b9d0b856507b.hd" type="rtmp/mp4">
</video>

</body>
<script>
    var player = videojs('example');
    player.play();
</script>
</html>

【问题讨论】:

    标签: javascript video streaming video.js rtmp


    【解决方案1】:

    您大概发现了一年前的上一个讨论帖: Playing RTMP stream with VideoJS player 这表明其他人遇到了困难并且没有成功。

    现在 HTML5 已经确立,Flash 视频正在迅速消失,因为 四年前提到: https://www.theverge.com/2015/1/27/7926001/youtube-drops-flash-for-html5-video-default

    将 Flash 视频转换为更现代的格式非常简单......一个 使用出色的免费开源工具进行转换的此类文章在这里: https://addpipe.com/blog/flv-to-mp4/

    所以,与其尝试解决您的技术问题,我建议(如果有的话) 可能,让您的视频达到当今的技术水平。

    【讨论】:

    • rtmp 仍然是一种非常常见的直播源,您并不总是可以自己控制源。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-18
    • 1970-01-01
    • 1970-01-01
    • 2014-12-18
    • 2015-05-30
    相关资源
    最近更新 更多