[英]Hammer.js over ActiveX
我正在嘗試對提供RTSP視頻流和遠程控制協議的設備實施遠程控制。 我從如何在網頁中顯示RTSP視頻流中的示例代碼開始? :
<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
width="640" height="480" id="vlc" events="True">
<param name="Src" value="rtsp://cameraipaddress" />
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="False" />
<param name="AutoPlay" value="True" />
<embed id="vlcEmb" type="application/x-google-vlc-plugin" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="no" width="640" height="480"
target="rtsp://cameraipaddress" ></embed>
</OBJECT>
然后添加一個Hammer.js片段,以在單擊該頁面時顯示警報:
var element = document.getElementById('test_el');
var hammertime = Hammer(element).on("tap", function(event) {
alert('hello!');
});
我發現當我單擊VLC ActiveX控件的側面(而不是單擊它)時出現警報。 我猜想ActiveX控件在Hammer.js看到它之前正在消耗touch事件? 是否可以通過某種方式關閉VLC中的UI(暫停/播放按鈕,音量控制等),以使其不消耗任何觸摸,也無法讓Hammer.js看到觸摸? 還是我完全錯了,這是另一個問題?
原來VLC示例有點過時了-請參閱WebPlugin文檔。 我可以將HTML更新為:
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
windowless="True"
width="640"
height="480"
src="rtsp://192.168.0.10/screenmirror"
id="vlc">
</embed>
關鍵是“無窗口”標志,定義為:
Draw the video on a window-less (non-accelerated) surface and allow styling (CSS overlay, 3D transformations, and much more). Default: false
應用此功能后,VLC UI消失,Hammer.js似乎可以正常工作,並且當我單擊視頻時出現警報。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.