我能够在zul页面中嵌入媒体播放器插件并通过指定src播放视频(来自ip camera),现在我尝试动态地提供源文件但是我无法获得它work.can任何人都可以帮助我。 提前致谢
videoPage.zul就像这样
<zscript>
String filePath = (String) Executions.getCurrent().getSession()
.getAttribute("urlReturned");
</zscript>
<p:window xmlns="http://www.w3.org/1999/xhtml">
<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190"
CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..."
TYPE="application/x-oleobject">
<param name="FileName" value='${filePath}' />
<PARAM name="autostart" VALUE="false" />
<EMBED TYPE="application/x-mplayer2"
SRC=""
NAME="MediaPlayer" WIDTH="300" HEIGHT="300" ShowControls="0"
ShowStatusBar="0" ShowDisplay="0" autostart="1">
</EMBED>
</OBJECT>
</p:window>
</p:zk>
我希望用户选择的基于运行时的摄像头路径(在我的情况下来自ip摄像头的url)并将其显示在同一页面中。
答案 0 :(得分:0)
您可以在javascript中设置src
个embed
代码,因为必须必须在javascript中编写您的embed代码,如下例所示:
function onclickofSomething()
{
$('#IDOfParentElement').html("<embed type='application/x-mplayer2' pluginspage='http:///www.microsoft.com/Windows/MediaPlayer/' src='" + "<%=YourVideoPath%>" + "YourVideoName" + ID + ".mp4/wmv" + "' autostart='1' showstatusbar='1' enabled='1' showdisplay='1' showcontrols='1' width='630' height='380'></embed>");
};
您还可以在下面看到网址: need to set video file name using javascript http://www.webdeveloper.com/forum/showthread.php?53086-how-to-change-the-src-in-lt-embed-gt-using-javascript http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/16626/how-to-change-the-the-value-of-src-in-embed-using-javascript