implement streaming media resources that play RTMP, RTSP and HTTP protocols on the front-end page
implement streaming media resources that play RTMP, RTSP and HTTP protocols on the front-end page
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 < 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
Previous: After the Recat project pulls the branch, runs the prompt to report the error, ask for advice?
Next: How to use the history mode of front-end routing for single-page applications deployed on cdn