How does the front end play streaming media resources based on RTMP, RTSP and HTTP protocols?

implement streaming media resources that play RTMP, RTSP and HTTP protocols on the front-end page

The stream of

HTTP can be played with video, and RTMP and RTSP, generally require the support of plug-ins or script libraries. You can learn about some jwplayer libraries.


about playing the streaming media resources of rtmp http protocol, the last video.js is used for playback

http dependencies videojs-contrib-hls and video.js

 <link rel="stylesheet" type="text/css" href="css/video-js.min.css"/>
<script src ="http://vjs.zencdn.net/5.19/video.min.js"> </script>     
<script src = "https://unpkg.com/videojs-contrib-hls/dist/videojs-contrib-hls.js"> </script> 


<video id="example-video" width="600" height="300" class="video-js vjs-default-skin" controls>
  <source src="http://ivi.bupt.edu.cn/hls/cctv5hd.m3u8"
   type="application/x-mpegURL">
 </video>
 
 js
 var player = videojs('example-video');
    player.play();
    
video.js videojs-flash
< link href= "css/video-js.min.css" rel= "stylesheet" >
< script src= "js/video.min.js" > < / script >
< script src= "ideojs-flash@2/dist/videojs-flash.min.js"" rel= "nofollow noreferrer" > https://cdn.jsdelivr.net/npm/.;></script>

< video id= "my-video" class= "video-js" controls preload= "auto" width= "640" height= "264" poster= "data-setup=" {} ">
< source src=" rtmp://60.174.223.96/v1/ * * "type=" rtmp/flv "/ >

<p class="vjs-no-js">
    To view this video please enable JavaScript, and consider upgrading to a web browser that
    <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
 

< / video >

js file

        var myPlayer = videojs('my-video');
        videojs("my-video").ready(function(){
            var myPlayer = this;
            myPlayer.play();
        });

the above is about playing rtmp and http streaming media playback is effective, about rtsp has not found a suitable method, there is a suitable plan welcome to communicate. If you need to run on the vue project and need to configure webpack, if you have any questions, you can contact me.


you can use this control to implement portal

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e44ff8-43e54.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e44ff8-43e54.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?