网页显示摄像头的RTSP视频主要有两种方案:
一种是vlc,通过安装vlc3.0播放器,然后使用国产360浏览器来播放,不支持chrome等现代浏览器。
第二种是:vxg播放器
vxg是目前找到的最完美的解决方式
安装方式:
1,在谷歌商店安装vxg插件,需要翻墙,或者在某些网站直接下载插件安装:
2,访问vxg的支持页面(api):
https://www.videoexpertsgroup.com/nacl_player_api/#jsapi
3,下载压缩包
https://www.videoexpertsgroup.com/nacl_player_api/vxgplayer-1.8.54.zip
下载不了的,我已经上传csdn了,0积分下载
https://download.csdn.net/download/qq_32674347/16669886
4,网页使用:
<!DOCTYPE html>
<html>
<head>
<title>Media Player PNaCl</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<meta name="author" content="videoexpertsgroup" />
<meta name="copyright" lang="ru" content="videoexpertsgroup" />
<meta name="description" content="Demo VXG Media Player for Chrome" />
<meta name="keywords" content="" />
<!-- vxgplayer -->
<script type="text/javascript" src="vxgplayer-1.8.54.min.js"></script>
<link href="vxgplayer-1.8.54.min.css" rel="stylesheet" />
<!-- demo page -->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div class="content-absolute">
<div class="content">
<div id="vxg_media_player1" class="vxgplayer" width="300" height="240"
url="rtsp://192.168.1.11/user=admin&password=&channel=1&stream=0.sdp" aspect-ratio latency="10"
autostart controls avsync></div>
</div>
</div>
</div>
</body>
</html>
5,放在服务器环境下,比如apache
6,打开浏览器访问该页面的服务器路径
注意: chrome://flags/#enable-nacl
chrome需要 在 chrome://flags/#enable-nacl 设置Native Client 设置为true
只有这样才能播放哦