1

It has taken me several hours to play rtmp video using videojs. Can anyone give an example that can just run?

I am using chrome. Flash is enabled.

Below is my code. Video url is valid. Can anyone make it run?

<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>
BaiJiFeiLong
  • 3,716
  • 1
  • 30
  • 28

1 Answers1

-1

Presumably, you found the previous discussion thread from a year ago: Playing RTMP stream with VideoJS player which indicates that others have had difficulty and did NOT succeed.

Now that HTML5 is firmly established, Flash video is rapidly disappearing, as mentioned four years ago: https://www.theverge.com/2015/1/27/7926001/youtube-drops-flash-for-html5-video-default

It is very straightforward to convert flash-video into more modern formats...one such article for using an excellent free open-source tool for conversion is here: https://addpipe.com/blog/flv-to-mp4/

So, rather than try to solve your technical problem, I would recommend, if at all possible, to bring your videos up to present-day technology.

David
  • 2,253
  • 5
  • 23
  • 29
  • rtmp is still a very common live streaming source and you don't always have control of the source yourself. – ezwrighter Jan 23 '19 at 19:07