Use the vlc plug-in to embed the IP camera into the webpage and play the RTSP stream, vlcrtsp
1. Description
Recently, a project needs to embed the IP camera image into a web page. To reduce development costs, use the vlc plug-in to play the RTSP stream provided by the camera. On the official website of videolan wiki, We will detail how to use vlc web plugin.
Note that the methods provided on the wiki are no longer applicable to vlc2.2.0 or earlier versions. The reason is that the last version of vlc does not contain the axvlc. cab file, and the latest version is in the directory corresponding to version 0.9.2. In addition, in IE, the plug-in cannot be installed because the cab file is not signed.
2. Solution
For more information about how to install the vlc plug-in, see the instructions on vlc_help. Install the vlc client in windows and check activeX plugin and mozilla plugin.
Compile the test program on the page as follows:
If you want to determine whether the vlc plug-in is installed in the browser, you can jump to the download link of vlc without installing the plug-in. The following javascript code is available (you need to add the following javascript code in the html body Tag.onload="checkBrowser();"
Option .) :
<Script type = "text/javascript"> // true is returned only when the IE browser is installed with the vlc plug-in. function isInsalledIEVLC () {var vlcObj = null; var vlcInstalled = false; try {vlcObj = new ActiveXObject ("VideoLAN. vlcplugin.1 "); if (vlcObj! = Null) {vlcInstalled = true} catch (e) {vlcInstalled = false;} return vlcInstalled;} // applicable only to firefox and installed with the vlc plug-in, returns true; function isInsalledFFVLC () {var numPlugins = navigator. plugins. length; for (I = 0; I <numPlugins; I ++) {plugin = navigator. plugins [I]; if (plugin. name. indexOf ("VideoLAN")>-1 | plugin. name. indexOf ("VLC")>-1) {return true ;}return false ;}/ * browser detection */function checkBrowser () {var browser = navigator. appName var B _version = navigator. appVersion var version = parseFloat (B _version) if (browser = "Netscape" & version> = 4) {if (isInsalledFFVLC ()) {alert ("VLC plug-in installed");} else {alert ("VLC plug-in not installed"); location. href = "http://download.videolan.org/pub/videolan/vlc/2.2.1/" ;}} else if (browser = "Microsoft Internet Explorer" & version> = 4) {if (isInsalledIEVLC ()) {alert ("VLC plug-in installed");} else {alert ("VLC plug-in not installed, please install plug-in first"); location. href = "http://download.videolan.org/pub/videolan/vlc/2.2.1/" ;}}</script>
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.