vue播放rtsp视频

注意:
1.在static目录下创建video.html
2.必须安装2.2.1-win32版本的vlc插件

3.vlc安装文件:
链接:https://pan.baidu.com/s/1yQJ9SDh0YWw84yhXkLrMjQ
提取码:zq9k

camera.vue页面:
 <template>
 	<div>
		<a href="javascript:;" @click="yulan(record.videoUrl)">预览</a>
	</div>	
 </template>
 <script>
	yulan(url) {
	 		localStorage.setItem('url',url)
	        window.open('/static/video.html', "_blank")
	      },
   <script>
video.html页面:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <title></title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    html, body {
      width: 100%;
      height: 100%;
    }

    #containe {
      width: 100%;
      height: 100%;
    }

    #vlc {
      width: 100%;
      height: 100%;
    }
  </style>
</head>
<body>
<div id="containe">
  <object type='application/x-vlc-plugin;' pluginspage="http://www.videolan.org/" id='vlc'

                  events='false' width="100%">
    <param name="mrl" value=''/>

    <script>
      var surl = localStorage.getItem('url')//"rtsp://admin:abcd1234@11.101.45.130:554/h264/ch45/main/av_stream";
      document.getElementById("vlc").getElementsByTagName("param")[0].value = surl;
    </script>

    <param name='volume' value='50'/>

    <param name='autoplay' value='true'/>

    <param name='loop' value='false'/>

    <param name='fullscreen' value='false'/>

    <param name='controls' value='false'/>

  </object>
</div>
</body>
</html>


上一篇:rtsp转rtmp的最佳实践过程


下一篇:RTSP/RTMP拉流端录像设计要点