Webmaster Forum > Web Programming > Website Development >

PLEASE HELP: Media player control and javascript


Reply
 
Share Thread Thread Tools
Old 07-14-2009, 06:40 PM   #1
Med

Junior Member
 
Med's Avatar
 
Join Date: Jul 2009
Location: Montreal
Age: 19
Posts: 12
Reputation: Med is on a distinguished road
iTrader: (0)
Default PLEASE HELP: Media player control and javascript

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>
This code is driving me nuts I can't seem to find what's wrong with it... Can anyone please help me?

Thanks in advance,
Med
Med is offline   Reply With Quote
Old 09-19-2009, 04:57 AM   #2
tak78

Junior Member
 
Join Date: Sep 2009
Location: Phoenix
Age: 32
Posts: 1
Reputation: tak78 is on a distinguished road
iTrader: (0)
Default Re: PLEASE HELP: Media player control and javascript

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..
tak78 is offline   Reply With Quote
Reply

Tags
control, javascript, media, media player javascript, player


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

Show/Hide Menu
Webmaster Help

You are currently viewing our webmaster forum as a guest, with limited access to our forums and webmaster resources.

As a registered member of our webmaster forums you gain useful webmaster help and the ability to participate in friendly informative webmaster discussion with webmasters across the web.

If you have any problems with registration or your account login, please contact support.
Log in

Set Cookie?


Sites We Like

Ads

Copyright © 2004 - 2010 Webmaster Help. All Rights Reserved.
Exdevio Webmaster Network