Commit ecfea08f authored by Jean-Paul Saman's avatar Jean-Paul Saman

activex: test.html add mouse events.

parent 2ee5ceaa
...@@ -48,6 +48,42 @@ function onVLCPluginReady() ...@@ -48,6 +48,42 @@ function onVLCPluginReady()
updateVolume(0); updateVolume(0);
} }
function registerVLCEvent(event, handler)
{
var vlc = getVLC("vlc");
if (vlc) {
if (vlc.attachEvent) {
// Microsoft
vlc.attachEvent (event, handler);
} else if (vlc.addEventListener) {
// Mozilla: DOM level 2
vlc.addEventListener (event, handler, false);
} else {
// DOM level 0
eval("vlc.on" + event + " = handler");
}
}
}
function unregisterVLCEvent(event, handler)
{
var vlc = getVLC("vlc");
if (vlc) {
if (vlc.detachEvent) {
// Microsoft
vlc.detachEvent (event, handler);
} else if (vlc.removeEventListener) {
// Mozilla: DOM level 2
vlc.removeEventListener (event, handler, false);
} else {
// DOM level 0
eval("vlc.on" + event + " = null");
}
}
}
//--></SCRIPT> //--></SCRIPT>
<BODY onLoad="init();"> <BODY onLoad="init();">
...@@ -88,6 +124,9 @@ Insert VideoLAN.VLCPlugin.2 ...@@ -88,6 +124,9 @@ Insert VideoLAN.VLCPlugin.2
<TR><TD colspan="2"> <TR><TD colspan="2">
<TABLE><TR> <TABLE><TR>
<TD valign="top" width="550"> <TD valign="top" width="550">
mouse position: <SPAN id="cursorTextField" style="text-align:center"></SPAN><br/>
mouse click: <SPAN id="clickTextField" style="text-align:center"></SPAN><br />
mouse object: <SPAN id="objectTextField" style="text-align:center"></SPAN>
<!-- <!--
Insert Slider widget Insert Slider widget
--> -->
...@@ -191,7 +230,7 @@ Insert Slider widget ...@@ -191,7 +230,7 @@ Insert Slider widget
<OPTION value=9>Y</OPTION> <OPTION value=9>Y</OPTION>
</SELECT> </SELECT>
</TD> </TD>
</TR> </TR>
<TR> <TR>
<TD>Logo video filter: <TD>Logo video filter:
<INPUT type=button value="Enable" onClick='getVLC("vlc").video.logo.enable();'> <INPUT type=button value="Enable" onClick='getVLC("vlc").video.logo.enable();'>
...@@ -204,10 +243,10 @@ Insert Slider widget ...@@ -204,10 +243,10 @@ Insert Slider widget
<OPTION value=4>Repeat</OPTION> <OPTION value=4>Repeat</OPTION>
<OPTION value=5>Delay</OPTION> <OPTION value=5>Delay</OPTION>
<OPTION value=6>X</OPTION> <OPTION value=6>X</OPTION>
<OPTION value=7>Y</OPTION> <OPTION value=7>Y</OPTION>
</SELECT> </SELECT>
</TD> </TD>
</TR> </TR>
<TR> <TR>
<TD> <TD>
<INPUT type=button id="telx" value="Teletext off" onClick='doToggleTeletext();'> <INPUT type=button id="telx" value="Teletext off" onClick='doToggleTeletext();'>
...@@ -223,6 +262,41 @@ var rate = 0; ...@@ -223,6 +262,41 @@ var rate = 0;
var prevState = 0; var prevState = 0;
var telxState = false; var telxState = false;
function handleMousePos(event,X,Y)
{
document.getElementById("cursorTextField").innerHTML = "(" + X + "," + Y + ")";
}
function handleMouseClick(event,click)
{
if (click) {
document.getElementById("clickTextField").innerHTML = "yes";
} else {
document.getElementById("clickTextField").innerHTML = "no";
}
}
function handleMouseObject(event,moved)
{
var vlc = getVLC("vlc");
if (vlc && vlc.video) {
var newpos = "";
if (vlc.video.logo) {
newpos = "("+ vlc.video.logo.x + "," + vlc.video.logo.y+ ")";
}
if (moved) {
document.getElementById("objectTextField").innerHTML = "yes: " + newpos;
} else {
document.getElementById("objectTextField").innerHTML = "no: " + newpos;
}
}
}
registerVLCEvent('MouseMoved', handleMousePos);
registerVLCEvent('MouseClicked', handleMouseClick);
registerVLCEvent('MouseObject', handleMouseObject);
function doSetSlider() function doSetSlider()
{ {
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
...@@ -665,7 +739,7 @@ function doMarqueeOption(option, value) ...@@ -665,7 +739,7 @@ function doMarqueeOption(option, value)
vlc.video.marquee.y = val; vlc.video.marquee.y = val;
} }
} }
function doLogoOption(option, value) function doLogoOption(option, value)
{ {
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment