|
|
#1 |
|
Junior Member
|
Hi everyone,
I'm adding a Media Player to my website and I want to add an external button that allows user to go into fullscreen mode. I've been looking for a code for 3 days I've even tried things like Yahoo Answers, and the answer I got was "Hi, I'm a mac" When I finally found a code, it didn't work... I know this has been done on websites like: www.jt.france2.fr/20h (The button just above the player)Here's my code: HTML Code:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <script type="text/javascript"> function setFullScreen() //need to reference with exact case for names. { var mplayer = MediaPlayer; // MediaPlayer is already available in full scope. mplayer is a second name. if(mplayer.playState == 3) { mplayer.fullScreen = true; //javascript automatically converts strings to numerical equivalents. quotes are optional. }; }; </script> </head> <body> <OBJECT id='MediaPlayer' width="270" height="270" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'> <param name='fileName' value="http://www.longtailvideo.com/jw/upload/silverlight.wmv"> <param name='animationatStart' value='true'> <param name='transparentatStart' value='true'> <param name='autoStart' value="true"> <param name='showControls' value="true"> <param name='loop' value="false"> <param name='showStatusBar' value="true"> <EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='MediaPlayer' name='MediaPlayer' displaysize='4' autosize='-1' bgcolor='transparent' showcontrols="true" showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="270" height="270" src="http://www.longtailvideo.com/jw/upload/silverlight.wmv" autostart="true" designtimesp='5311' loop="false"> </EMBED> </OBJECT> <a href="setFullScreen()">FullScreen</a> </body> </html> I can't seem to find what's wrong with it... Can anyone please help me?Thanks in advance, Med |
|
|
|
|
|
#2 |
|
Junior Member
|
Try this instead:
function setFullScreen() { var obj = document.getElementById("MediaPlayer"); if (obj.fullScreen == false) { obj.fullScreen = true; } } <a href="#" onclick="setFullScreen()">FullScreen</a> Hope this helps. Last edited by tak78; 09-19-2009 at 05:02 AM.. |
|
|
|
![]() |
| Tags |
| control, javascript, media, media player javascript, player |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| High Quality Low Cost VPS, Free OS and Control Panel | cybergod | Web Hosting | 0 | 06-08-2008 06:03 PM |
| Video Player | Shone | Graphics Forum | 0 | 11-22-2007 02:34 PM |
| Hosting control panels | admin | Web Hosting Forum | 16 | 02-20-2007 04:01 PM |
| Embed Media Player Question... | biohazard2k | Website Development | 1 | 11-15-2006 10:47 PM |


When I finally found a code, it didn't work... I know this has been done on websites like:
I can't seem to find what's wrong with it... Can anyone please help me?




