Thread: [Mplayerplug-in-devel] Javascript support testing.
Brought to you by:
kdekorte
From: Carlos K. <ckn...@sc...> - 2004-03-04 19:51:37
|
Hi, I'm trying to do a simple test of the javascript support for mplayerplug-in (v2.45). I have attempted the following with a test mpeg file on a web server on the Lan: ------------------------------------Begin test.html---------------------------------- html> <head> </head> <body> <embed type="application/x-mplayer2" width=320 height=240 src="/test.mpg"></embed> <script language-"javascript"> var embed=document.embeds[0]; </script> <form name="formname"> <input type=button value="play" onclick='embed.Play'> <input type=button value="FF" onclick='embed.Ff'> <input type=button value="Rew" onclick='embed.Rew'> <input type=button value="pause" onclick='embed.Pause'> <input type=button value="stop" onclick='embed.Stop'> <input type=button value="quit" onclick='embed.Quit'> </form> </body> </html> ------------------------------------end test.html---------------------------------- It plays the video just fine, and the plugin's embedded controls work fine, but my javascript must be faulty, because there is no response, javascript console errors, or anything. I verified that javascript is working in the browser (mozilla Firefox 0.8 (GTK2)). Can someone tell me what I'm doing wrong?? Thanks! Carlos Knowlton BTW, I like how the mouse wheel "shuttles" the video position! (nice touch! =) |
From: Kevin D. <kde...@ya...> - 2004-03-04 20:02:33
Attachments:
testmp3.html
|
Carlos, Here is an test script I use Kevin On Thursday 04 March 2004 12:40 pm, Carlos Knowlton wrote: > Hi, I'm trying to do a simple test of the javascript support for > mplayerplug-in (v2.45). I have attempted the following with a test mpeg > file on a web server on the Lan: > > ------------------------------------Begin > test.html---------------------------------- > html> > <head> > </head> > <body> > <embed type="application/x-mplayer2" width=320 height=240 > src="/test.mpg"></embed> > <script language-"javascript"> > var embed=document.embeds[0]; > </script> > > <form name="formname"> > <input type=button value="play" onclick='embed.Play'> > <input type=button value="FF" onclick='embed.Ff'> > <input type=button value="Rew" onclick='embed.Rew'> > <input type=button value="pause" onclick='embed.Pause'> > <input type=button value="stop" onclick='embed.Stop'> > <input type=button value="quit" onclick='embed.Quit'> > </form> > </body> > </html> > ------------------------------------end > test.html---------------------------------- > > It plays the video just fine, and the plugin's embedded controls work > fine, but my javascript must be faulty, because there is no response, > javascript console errors, or anything. I verified that javascript is > working in the browser (mozilla Firefox 0.8 (GTK2)). Can someone tell > me what I'm doing wrong?? > > Thanks! > Carlos Knowlton > > BTW, I like how the mouse wheel "shuttles" the video position! (nice > touch! =) > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Mplayerplug-in-devel mailing list > Mpl...@li... > https://lists.sourceforge.net/lists/listinfo/mplayerplug-in-devel |
From: Carlos K. <ckn...@sc...> - 2004-03-05 15:59:34
|
Kevin, The case was right. Hmmm... When I installed mplayerplug-in, I used the fc1 binary rpm file from here: http://prdownloads.sourceforge.net/mplayerplug-in/mplayerplug-in-2.45-fc1.i386.rpm?download Does javascript support require anything like "--with-javascript" when mplayerplug-in is compiled? If so, is it possible that the support was accidentally left out of the rpm build? Just a thought. I may have to install the mozilla development stuff and I can compile it with debug statements enabled if necessary. what do you think? Best Regards, Carlos Kevin DeKorte wrote: >Carlos, > >Maybe your case is wrong? > >Here are the defined methods > > void play(); > void pause(); > void stop(); > void quit(); > void doPlay(); > void doPause(); > void FastForward(); > void FastReverse(); > void ff(); > void rew(); > void rewind(); > void Seek(in double value); > readonly attribute long playState; > >Kevin > >On Friday 05 March 2004 06:42 am, Carlos Knowlton wrote: > > >>Kevin, >> >>I figured that the 'AUTOSTART=0' had something to do with it, but I >>wasn't too concerned with that part. >> >>With the javascript methods, I tried them with and without parenthesis. >> Without, I get no messages at all, with them I get: >> >>Error: embed.DoPlay is not a function >> >> >> >>Thanks! >>Carlos >> >>Kevin DeKorte wrote: >> >> >>>Carlos, >>> >>>The reason my script would not start the video is due to the fact that I >>>have the flag AUTOSTART="0" in the embed tag. >>> >>>Also, your calls to embed.DoPlay need the parens >>> >>>embed.DoPlay() != embed.DoPlay >>> >>>Java script needs the ()'s for function calls. >>> >>>Kevin >>> >>>On Thursday 04 March 2004 09:11 pm, Carlos Knowlton wrote: >>> >>> >>>>Hello Kevin, >>>> >>>>for some reason, your test script behaved similar mine, except the video >>>>would download all the way, and never actually start. I modified the >>>>src= to point to my video file, and here are the messages I got from the >>>>javascript console when I clicked on the buttons: >>>>---------------------------- start javascript console output >>>>-------------------------------- >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 29 >>>>Error: embed.DoPlay is not a function >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 39 >>>>Error: embed.pause is not a function >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 34 >>>>Error: embed.DoPause is not a function >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 44 >>>>Error: embed.stop is not a function >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 49 >>>>Error: embed.quit is not a function >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 54 >>>>Error: embed.FastForward is not a function >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 59 >>>>Error: embed.FastReverse is not a function >>>> >>>>[the "state" button just gave me a javascript alert pop-up window that >>>>said "undefined"] >>>> >>>> > > > |
From: Kevin D. <kde...@ya...> - 2004-03-05 16:07:43
|
Carlos, You might try copying /usr/lib/mozilla/plugins/mplayerplug-in.so and /usr/lib/mozilla/components/mplayerplug-in.xpt to $HOME/.mozilla/plugins and see if that helps any. I guessing that maybe the xpt is not getting picked up? No there is no option to disable or enable javascript. DEBUG can be enabled without recompiling by setting debug=1 in the mplayerplug-in.conf file. You might look at the Mozilla Javascript console under the tools menu and see what errors you are getting. Kevin On Friday 05 March 2004 08:44 am, Carlos Knowlton wrote: > Kevin, > > The case was right. Hmmm... When I installed mplayerplug-in, I used > the fc1 binary rpm file from here: > http://prdownloads.sourceforge.net/mplayerplug-in/mplayerplug-in-2.45-fc1.i >386.rpm?download > > Does javascript support require anything like "--with-javascript" when > mplayerplug-in is compiled? If so, is it possible that the support was > accidentally left out of the rpm build? Just a thought. I may have to > install the mozilla development stuff and I can compile it with debug > statements enabled if necessary. what do you think? > > Best Regards, > Carlos > > Kevin DeKorte wrote: > >Carlos, > > > >Maybe your case is wrong? > > > >Here are the defined methods > > > > void play(); > > void pause(); > > void stop(); > > void quit(); > > void doPlay(); > > void doPause(); > > void FastForward(); > > void FastReverse(); > > void ff(); > > void rew(); > > void rewind(); > > void Seek(in double value); > > readonly attribute long playState; > > > >Kevin > > > >On Friday 05 March 2004 06:42 am, Carlos Knowlton wrote: > >>Kevin, > >> > >>I figured that the 'AUTOSTART=0' had something to do with it, but I > >>wasn't too concerned with that part. > >> > >>With the javascript methods, I tried them with and without parenthesis. > >> Without, I get no messages at all, with them I get: > >> > >>Error: embed.DoPlay is not a function > >> > >> > >> > >>Thanks! > >>Carlos > >> > >>Kevin DeKorte wrote: > >>>Carlos, > >>> > >>>The reason my script would not start the video is due to the fact that I > >>>have the flag AUTOSTART="0" in the embed tag. > >>> > >>>Also, your calls to embed.DoPlay need the parens > >>> > >>>embed.DoPlay() != embed.DoPlay > >>> > >>>Java script needs the ()'s for function calls. > >>> > >>>Kevin > >>> > >>>On Thursday 04 March 2004 09:11 pm, Carlos Knowlton wrote: > >>>>Hello Kevin, > >>>> > >>>>for some reason, your test script behaved similar mine, except the > >>>> video would download all the way, and never actually start. I > >>>> modified the src= to point to my video file, and here are the messages > >>>> I got from the javascript console when I clicked on the buttons: > >>>>---------------------------- start javascript console output > >>>>-------------------------------- > >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 29 > >>>>Error: embed.DoPlay is not a function > >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 39 > >>>>Error: embed.pause is not a function > >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 34 > >>>>Error: embed.DoPause is not a function > >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 44 > >>>>Error: embed.stop is not a function > >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 49 > >>>>Error: embed.quit is not a function > >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 54 > >>>>Error: embed.FastForward is not a function > >>>>Source File: http://192.168.1.12/Tests/JStest2.html Line: 59 > >>>>Error: embed.FastReverse is not a function > >>>> > >>>>[the "state" button just gave me a javascript alert pop-up window that > >>>>said "undefined"] |
From: Carlos K. <ckn...@sc...> - 2004-03-05 16:39:22
|
Kevin, Excellent! It works! I'm not sure why it required having the xpt file copied over to my home dir. Maybe both the '.so' and the '.xpt' file need to be in the /usr/lib/mozilla/plugins folder. I'll try that out. Incidentally, how hard would it be to implement getTime() (get the current play position time) and getDuration() (get the total clip duration)? These would be pretty useful for a project I'm working on. (with some pointers, I may even be able to do it, though my c++ is a little (ok, a lot! =) shaky.) What do you think? Thanks again for the help! Best Regards, Carlos Kevin DeKorte wrote: >Carlos, > >You might try copying /usr/lib/mozilla/plugins/mplayerplug-in.so >and /usr/lib/mozilla/components/mplayerplug-in.xpt to $HOME/.mozilla/plugins >and see if that helps any. > >I guessing that maybe the xpt is not getting picked up? > >No there is no option to disable or enable javascript. > >DEBUG can be enabled without recompiling by setting debug=1 in the >mplayerplug-in.conf file. > >You might look at the Mozilla Javascript console under the tools menu and see >what errors you are getting. > >Kevin > >On Friday 05 March 2004 08:44 am, Carlos Knowlton wrote: > > >>Kevin, >> >>The case was right. Hmmm... When I installed mplayerplug-in, I used >>the fc1 binary rpm file from here: >>http://prdownloads.sourceforge.net/mplayerplug-in/mplayerplug-in-2.45-fc1.i >>386.rpm?download >> >>Does javascript support require anything like "--with-javascript" when >>mplayerplug-in is compiled? If so, is it possible that the support was >>accidentally left out of the rpm build? Just a thought. I may have to >>install the mozilla development stuff and I can compile it with debug >>statements enabled if necessary. what do you think? >> >>Best Regards, >>Carlos >> >>Kevin DeKorte wrote: >> >> >>>Carlos, >>> >>>Maybe your case is wrong? >>> >>>Here are the defined methods >>> >>> void play(); >>> void pause(); >>> void stop(); >>> void quit(); >>> void doPlay(); >>> void doPause(); >>> void FastForward(); >>> void FastReverse(); >>> void ff(); >>> void rew(); >>> void rewind(); >>> void Seek(in double value); >>> readonly attribute long playState; >>> >>>Kevin >>> >>> >>> >>> |
From: Kevin D. <kde...@ya...> - 2004-03-05 16:58:36
|
Carlos, the xpt file is what mozilla uses to determine the scriptability of the plugin. That is why it is important to have. As for the additional options. Those are things that are being planned now, just have not started implementing them yet, as I want to get all the components stable at this point. It looks like we are getting close due to the patch from Alex this morning. Kevin On Friday 05 March 2004 09:24 am, Carlos Knowlton wrote: > Kevin, > > Excellent! It works! I'm not sure why it required having the xpt file > copied over to my home dir. Maybe both the '.so' and the '.xpt' file > need to be in the /usr/lib/mozilla/plugins folder. I'll try that out. > > Incidentally, how hard would it be to implement getTime() (get the > current play position time) and getDuration() (get the total clip > duration)? These would be pretty useful for a project I'm working on. > (with some pointers, I may even be able to do it, though my c++ is a > little (ok, a lot! =) shaky.) What do you think? > > Thanks again for the help! > > Best Regards, > Carlos > > Kevin DeKorte wrote: > >Carlos, > > > >You might try copying /usr/lib/mozilla/plugins/mplayerplug-in.so > >and /usr/lib/mozilla/components/mplayerplug-in.xpt to > > $HOME/.mozilla/plugins and see if that helps any. > > > >I guessing that maybe the xpt is not getting picked up? > > > >No there is no option to disable or enable javascript. > > > >DEBUG can be enabled without recompiling by setting debug=1 in the > >mplayerplug-in.conf file. > > > >You might look at the Mozilla Javascript console under the tools menu and > > see what errors you are getting. > > > >Kevin > > > >On Friday 05 March 2004 08:44 am, Carlos Knowlton wrote: > >>Kevin, > >> > >>The case was right. Hmmm... When I installed mplayerplug-in, I used > >>the fc1 binary rpm file from here: > >>http://prdownloads.sourceforge.net/mplayerplug-in/mplayerplug-in-2.45-fc1 > >>.i 386.rpm?download > >> > >>Does javascript support require anything like "--with-javascript" when > >>mplayerplug-in is compiled? If so, is it possible that the support was > >>accidentally left out of the rpm build? Just a thought. I may have to > >>install the mozilla development stuff and I can compile it with debug > >>statements enabled if necessary. what do you think? > >> > >>Best Regards, > >>Carlos > >> > >>Kevin DeKorte wrote: > >>>Carlos, > >>> > >>>Maybe your case is wrong? > >>> > >>>Here are the defined methods > >>> > >>> void play(); > >>> void pause(); > >>> void stop(); > >>> void quit(); > >>> void doPlay(); > >>> void doPause(); > >>> void FastForward(); > >>> void FastReverse(); > >>> void ff(); > >>> void rew(); > >>> void rewind(); > >>> void Seek(in double value); > >>> readonly attribute long playState; > >>> > >>>Kevin |