RE: [Mplayerplug-in-devel] RE: mplayer plugin - control via JavaScript?
Brought to you by:
kdekorte
From: Dean T. <Dea...@co...> - 2005-08-26 12:07:00
|
Hello Kevin, As I have already mentioned in my previous emails I want to be able to handle mouse events in much the same way as windows media player handles them on a windows box. e.g., mouse move, mouse up/down and obtaining the x-y coords of the mouse. Whilst I don't know the exact HTML syntax here are some examples extracted from the JavaScript test page: http://mplayerplug-in.sourceforge.net/testing/testvid.html <embed id=3D"MyMediaPlayer" type=3D"application/x-mplayer2"=20 width=3D"400" height=3D"300" autostart=3D"0" filename=3D"http://www.mysite.com/mymedia.wmv" onMediaComplete=3D"ChangeToNextPage();"> <script LANGUAGE=3D"JavaScript" type=3D"text/javascript" FOR=3D" MyMediaPlayer" EVENT=3D"Click(nButton, nX, nY)"><!-- // Is it a left click? if (nButton !=3D 1) { // Not a left click // we could display a custom DHTML menu? return; } =09 // Did we click on our interesting area? if ((nX >=3D 0) && (nX <=3D 200)) { // Clicked on left hand side // display some stuff on left } else { // display stuff at bottom (or right). //TODO: Modify content of 2nd and 3rd DIV object also change content of IFRAME. } //--></script> <script LANGUAGE=3D"JavaScript" type=3D"text/javascript" FOR=3D" MyMediaPlayer" EVENT=3D"MouseMove(nButton, nX, nY)"><!- // Are moving over the bottom ? if ((nY >=3D 150) && (nY <=3D 300)) { // Mouse is over the bottom... // Is the user holding the left button down too? if (nButton & 1) { // Left button is down. // TODO: use mouse position to change content of First DIV object } } else { //TODO: Just change a graphic and so the user knows moving // the mouse down a bit will do something. } //--></script> Perhaps refer to the Windows Media Player SDK to make the API similar? Here are a few interesting links: http://www.msdn.microsoft.com/library/default.asp?url=3D/library/en-us/wm= p lay10/mmp_sdk/playerclickevent.asp http://www.msdn.microsoft.com/library/default.asp?url=3D/library/en-us/wm= p lay10/mmp_sdk/playermousemoveevent.asp My ultimate aim is to create a web page for Internet Explorer and Windows Media Player and have it work in Netscape / MPlayer on Linux... What are the possibilities? Hopefully in this way Linux / Unix users could be get some great content... What do you think??? Thanks again, Dean. -----Original Message----- From: Kevin DeKorte [mailto:kde...@ya...]=20 Sent: 25 August 2005 17:02 To: mpl...@li... Cc: Dean Taylor Subject: Re: [Mplayerplug-in-devel] RE: mplayer plugin - control via JavaScript? On Thursday 25 August 2005 09:06 am, Dean Taylor wrote: > Hi Kevin, > > Great info, thanks... > > What are you views on implementing MouseDown, MouseMove and MouseUp? > > Would this be a great deal of effort? > Is it a simple task? > > Again thanks for your fast response, > Kind Regards, > Dean. > Dean, I don't see that any of them would be that difficult to implement GTK has all=20 the events we need. Now we just need to specify how it would work. Send me some examples of how want to use it. And then I can tell you if I can=20 do it, or what changes I would recommend. If you would like to sponsor this that would be nice too.. (shameless plug),=20 but it is not mandatory.=20 Kevin |