所以简单地说,我有下面的代码在网页上与VLC流rtsp。让脚本根据用户更改rtsp地址是否太复杂(比如右键单击视频并从下拉列表中选择另一个rtsp地址)?
embed type=“应用程序/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">
谢谢你的帮助。
发布于 2014-06-12 01:06:09
你正在寻找的东西可能并不容易实现。但是,您可以通过单击按钮来很好地更改嵌入内容。我在下面附上了一个有效的解决方案
嵌入的代码-
<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中
发布于 2015-09-24 16:50:33
您必须使用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
https://stackoverflow.com/questions/20855310
复制相似问题