Mouse click & plugin

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
thanaos
Blank Cone
Blank Cone
Posts: 10
Joined: 10 May 2010 09:27

Mouse click & plugin

Postby thanaos » 21 May 2010 10:50

Hello,

I would to know how can I retrieve the javascript-mouse click on the vlc plugin?

Thanks

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: Mouse click & plugin

Postby Ilasir » 21 May 2010 11:57

huh?

thanaos
Blank Cone
Blank Cone
Posts: 10
Joined: 10 May 2010 09:27

Re: Mouse click & plugin

Postby thanaos » 21 May 2010 16:02

When users "click" on the part of the browser where it is displayed plugin generates an event. This event is it recoverable by a javascript function?

I hope this is understandable. :)
Thanks

thanaos
Blank Cone
Blank Cone
Posts: 10
Joined: 10 May 2010 09:27

Re: Mouse click & plugin

Postby thanaos » 06 Jun 2010 10:37

up

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: Mouse click & plugin

Postby Ilasir » 07 Jun 2010 21:14

"onclick" "prevent default"

thanaos
Blank Cone
Blank Cone
Posts: 10
Joined: 10 May 2010 09:27

Re: Mouse click & plugin

Postby thanaos » 09 Jun 2010 08:28

thank you for your response
Could you give me an example ?

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<title>Layout 1</title>
<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2" id="vlc1" width="1024" height="768" events="True" >
<param name="ShowDisplay" value="True" />
<param name="Toolbar" value="True">
<param name="MRL" value="video.ext" />
<param name="volume" value="50" />
<param name="autoplay" value="false" />
<param name="loop" value="false" />
<param name="fullscreen" value="false" />
</object>
<script src="./ihm/vsm.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
var vlc = document.getElementById("vlc1");
vlc.playlist.playItem(vlc.playlist.add("rtsp://192.168.1.12:554/vsip2"));
</script>
</body>
</html>

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: Mouse click & plugin

Postby Ilasir » 10 Jun 2010 06:45

<script typee="text/javascript" >
var vlcplugin = document.getElementById("vlc");
vlcplugin.onclick = function;
</script>


At least, that should work. I usually use the inline event registration.

thanaos
Blank Cone
Blank Cone
Posts: 10
Joined: 10 May 2010 09:27

Re: Mouse click & plugin

Postby thanaos » 10 Jun 2010 08:12

ok, i found. I'm using the focus event.
Thank you.
<object onfocus="alert('1');" type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2" id="vlc1" width="320" height="260" events="True" >
</object>

cctvcam
Blank Cone
Blank Cone
Posts: 29
Joined: 20 Jul 2010 15:29

Re: Mouse click & plugin

Postby cctvcam » 25 Aug 2010 10:49

Can someone please tell me how to do this in IE as I have tried this code and it does not work?

thanks

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: Mouse click & plugin

Postby Ilasir » 26 Aug 2010 00:18

If you copied verbatim, there are typos.

cctvcam
Blank Cone
Blank Cone
Posts: 29
Joined: 20 Jul 2010 15:29

Re: Mouse click & plugin

Postby cctvcam » 26 Aug 2010 10:57

The code I have is

var vlc = document.getElementById('vlc');
vlc.onclick = function() { alert("here"); };

The alert is displayed in firefox, using the plugin, but not in InternetExplorer using the activeX control.

Visual studio warns that the
event
attribute is not support on the object tag. Could this be the problem? I got the object tag sample from http://wiki.videolan.org/ActiveX/HTML

<object id='vlc'
events='True' classid='clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921'
codebase="http://downloads.videolan.org/pub/video ... /axvlc.cab"
width="500"
height="370" >
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="False" />
<param name="AutoPlay" value="True" />
<param name="Volume" value="100" />
</object>

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: Mouse click & plugin

Postby Ilasir » 26 Aug 2010 15:23

Try defining and naming the function first. then use "vlc.onclick=function" No parenthases.

cctvcam
Blank Cone
Blank Cone
Posts: 29
Joined: 20 Jul 2010 15:29

Re: Mouse click & plugin

Postby cctvcam » 31 Aug 2010 11:58

I did not copy exactly (with typos) I have now changed to

Code: Select all

function OnVlcClick() { alert("click event"); } var vlc = document.getElementById('vlc'); vlc.onclick = OnVlcClick;
This is run in the boby onload method, with the vlc object declared as

Code: Select all

<object id='vlc' classid='clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921' codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" width="500" height="370" > <param name="ShowDisplay" value="True" /> <param name="AutoLoop" value="False" /> <param name="AutoPlay" value="True" /> <param name="Volume" value="100" /> </object>
but still does not work in IE6 or IE8? any other ideas or code sample that works that I can examine.

cctvcam
Blank Cone
Blank Cone
Posts: 29
Joined: 20 Jul 2010 15:29

Re: Mouse click & plugin

Postby cctvcam » 01 Sep 2010 16:02

As an update although I have this working in firefox, as soon as a video stream is played the click functionality stops working.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 5 guests