繁体   English   中英

带VLC的RTSP流:用户可更改rtsp IP

[英]RTSP streaming with VLC: changeable rtsp IP by user

因此,我简单地拥有下面的代码,即可在网页上通过VLC流式传输rtsp。 使用脚本来更改用户的rtsp地址是否太复杂了(让我们说右键单击视频并从下拉列表中选择另一个rtsp地址)?

嵌入type =“ application / x-vlc-plugin” pluginspage =“ http://www.videolan.org” version =“ VideoLAN.VLCPlugin.2” width =“ 100%” height =“ 100%” id =“ vlc “ loop =” yes“ autoplay =” yes“ target =” rtsp://192.168.1.225“>

谢谢你的帮助...

您正在寻找的内容可能不容易实现。 但是,您可以通过单击按钮很好地更改嵌入内容。 我在下面附上一个有效的解决方案

嵌入代码

<embed id="camFeed" type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" autoplay="yes" loop="no" bgcolor="#fff" width="752" height="424" src="" />

按钮代码

 <button type="button" onclick="newFeed()">Click Me!</button>

更改内容的功能-

<script type="text/javascript">
function newFeed()
{
     document.getElementById("camFeed").src = "rtsp://xxx.xxx.xxx.xxx:554";
}
</script>

注意:如果要显示摄像机列表中的提要,则必须考虑使用json_encode()将php数组导入js。

您必须使用js进行更改,我使用以下方法:

HTML:

<embed type="application/x-vlc-plugin"
    pluginspage = "http://www.videolan.org"
    id = "vlc"
    width = "100"  
    height ="100"
    autoplay = "true"
    src = "HERE TYPE YOUR FIRST IP"
/>

JS(Jquery示例):

var vlc = $("#vlc")[0];
var newSrc = "HERE TYPE YOUR SECOND IP";
vlc.playlist.stop();
vlc.playlist.items.clear();
var item = vlc.playlist.add(newSrc);
vlc.playlist.playItem(0);

您可以在此处获取更多信息: https : //wiki.videolan.org/Documentation : WebPlugin

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM