Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

fullscreen on startup?


I've followed the example here http://www.jeroenwijering.com/extras/javascript.html
and fullscreen works great when you click the button on the player.

What would I use to have javascript start fullscreen on page load?

I tried bc.. <body onload="sendEvent('fullscreen');">
but that doesn't seam to work. . . .

37 Community Answers

JeroenW

JW Player Support Agent  
0 rated :

Jumping to fullscreen on page load isn’t possible. The Flash Player is restricted to ony jump to fullscreen in direct response of a mouse click.

JW Player

User  
0 rated :

well, that rules this out as a solution . . . nice player though.

JW Player

User  
0 rated :

Hi,

Should this work at least?

<body class="bg1" onload="sendEvent('playitem', 8)">

It works if I add it to a javascript link on the page.

JW Player

User  
0 rated :

I've tried the following, but it says "waitong on http://mysite.com" in the browser status bar. Eventually it times out. If I click a javascript sendEvent link, it works fine.

<script type="text/javascript">
function createPlayer()
{
var so = new SWFObject('_player/mediaplayer.swf','mpl','440','140','7');
so.addParam('allowfullscreen','true');
so.addVariable('file','xml%2F_playlist.php%3Fplaylist%3Dearfull%26lite%3Dyes');
so.addVariable('id','7');
so.addVariable('height','140');
so.addVariable('width','440');
so.addVariable('displaywidth','140');
so.addVariable('callback','cccc_callback.php');
so.addVariable('enablejs','true');
so.addVariable('showdigits','false');
so.addVariable('showeq','true');
so.addVariable('shuffle','false');
so.addVariable('repeat','list');
so.addVariable('autoscroll','false');
so.addVariable('logo','http://www.avidbeauty.com/member/public/data/nopic_ico.jpg');
so.addVariable('fsbuttonlink','http://www.avidbeauty.com');
so.write('player');
}
</script>



</head>
<body class="bg1" onload="createPlayer();sendEvent('playitem', 7);">

JW Player

User  
0 rated :

What if you do this:
bc.. function startUp()
{
createPlayer();
sendEvent('playitem', 7);
}


and this:
bc.. <body class="bg1" onload="startUp()">


JW Player

User  
0 rated :

It still doesn't work. I also changed the javascript links to have javascript: in front.

Using the Mozilla Javascript console:
Error: Expected ':' but found 'undefined'. Declaration dropped.
Source File: http://mysite.com/myplaylist.php
Line: 0

Error: thisMovie("mpl").sendEvent is not a function
Source File: http://mysite.com/myplaylist.php
Line: 221


Also note, clicking an HREF link with javascript:sendEvent('playitem',1) works, but clicking a link with javascript:startUp() gives that error.

JW Player

User  
0 rated :

Note that the player loads fine, so I think createPlayer() is fine. Any ideas? :D

JW Player

User  
0 rated :

@taco
try delay the play command, to make sure the player has finished creating:
setTimeout("sendEvent('playitem',1)",100);

JW Player

User  
0 rated :

Anderson, Jeroen, Will:

Thank you very much! (b)

A short delay got it all to work. :)

function startUp()
{
createPlayer();
setTimeout("sendEvent('playitem',<?=$_GET['next'];?>)",600);
}

JW Player

User  
0 rated :

@taco,

Good to hear that it works. Other users have been looking for similar functionality so I've been referring them to this thread.

I tried to send multiple JavaScript ccommands from a link and just got a blank page with "True" on it, but using a function in the <head> solved that problem.

@andersen,

Thanks for your tip to add a small delay, that seems to be what was needed to make this method reliable.

JW Player

User  
0 rated :

hi,
can someone explain me where i have to put the funktion startUp?
is there a way to if i cant change the body tag to this <body class="bg1" onload="startUp()"> ?

thanks

JW Player

User  
0 rated :

The function startUp() must go in the head section of your HTML page code.

Like this:
bc.. <script type="text/javascript">
function startUp()
{
createPlayer();
setTimeout("sendEvent('playitem',<?=$_GET['next'];?>)",600);
}
</script>


You have to call the function from somethng...
Choices are: body onload, click on a link, ...

JW Player

User  
0 rated :

hi,
for one reason it does not work:
in the head i wrote:

<script type="text/javascript">
function startUp()
{
createPlayer();
setTimeout("sendEvent('playitem',2",600);
}
</script>

as body tag i used:
body class="bg1" onload="startUp()">

and in the body i used:
<script type="text/javascript" src="http://domain.com/flash_media_player/swfobject.js"></script>
<script type="text/javascript">
var s2 = new SWFObject("http://www.domain.com/flash_media_player/mediaplayer.swf","playlist","390","400","7");
s2.addParam("allowfullscreen","true");
s2.addVariable("file","http://www.domain.com/flash_media_player/playlist_sommer.xml");
s2.addVariable("displayheight","290");
s2.addVariable("backcolor","0xFEAA2C");
s2.addVariable("frontcolor","0xFFFFFF");
s2.addVariable("lightcolor","0xFFE8C4");
s2.addVariable('autostart','true');
s2.addVariable('shuffle','false');
s2.addVariable('repeat','list');
s2.addVariable("callback","http://www.domain.com/flash_media_player/stat.php");
s2.write("player2");
</script>


what did i do wrong?
how can i start the video over a link in fullscreen?

thanks

JW Player

User  
0 rated :

correction
as body tag i used:
<body class="bg1" onload="startUp()">

JW Player

User  
0 rated :

Frank,

You need to move the script to the <head> and wrap the player code in a function createPlayer().

Like this:
bc.. <script type="text/javascript" src="http://domain.com/flash_media_player/swfobject.js"></script>

<script type="text/javascript">
function createPlayer()
{
var s2 = new SWFObject("http://www.domain.com/flash_media_player/mediaplayer.swf","playlist","390","400","7");
s2.addParam("allowfullscreen","true");
s2.addVariable("file","http://www.domain.com/flash_media_player/playlist_sommer.xml");
s2.addVariable("displayheight","290");
s2.addVariable("backcolor","0xFEAA2C");
s2.addVariable("frontcolor","0xFFFFFF");
s2.addVariable("lightcolor","0xFFE8C4");
s2.addVariable('autostart','true');
s2.addVariable('shuffle','false');
s2.addVariable('repeat','list');
s2.addVariable("callback","http://www.domain.com/flash_media_player/stat.php");
s2.write("player2");
};
</script>


Then, in the <body>, where you want the player to appear, put this code:
bc.. <div id="player2">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Plugin</a>
to see this gallery.
</div>


<div> can be any HTML element, but <div> or <p> are commonly used.

To use the JavaScript API, you need to add this code to the player code:
bc.. s2.addVariable("enablejs","true");
s2.addVariable("javascriptid","mpl");


and you need the JavaScript code from the <head> of this page [url=http://www.jeroenwijering.com/extras/javascript.html]JAVASCRIPT CONTROL EXAMPLES[/url]. Just copy/paste from the page source.

JW Player

User  
0 rated :

hi,
i did all you said, but it does not work.
could you do a example page? i think there are a lot of people like me how love your player but also dont know how to start the player in fullscreen on startup.

JW Player

User  
0 rated :

@Frank
here is JeroenWs newest [url=http://www.jeroenwijering.com/extras/fullscreen.html?file=/upload/acera.flv]fullscreen page[/url]! its not the true flash9 fullscreenmode though, but easy to use...

JW Player

User  
0 rated :

hi,
sould it not bee able to make the fullscreenmode witch use the "full"-screen . if i open the fullscreen page the screen is as big as the browser and not like the monitor.

JW Player

User  
0 rated :

@Frank
yes, it is possible to get true fullscren, BUT *not* at startup!!
you always have to click first! its a security thing from adobe...
see JeroenWs posting at the beginning of this thread.

JW Player

User  
0 rated :

I've followed the example here http://www.jeroenwijering.com/extras/javascript.html
and fullscreen works great when you click the button on the player.

What would I use to have javascript start fullscreen by clicking on links or button?

I tried <a href="javascript:sendEvent('fullscreen');" >Full Screen</a> but that doesn't seam to work. . . .

Please help me on this issue.

JW Player

User  
0 rated :

@Irfan Chauhan
sorry that is not possible!

from the [url=http://www.jeroenwijering.com/extras/javascript.html]javascript page[/url]:
"Note that jumping to fullscreen isn't supported by javascript, because of Flash security restrictions."

maybe you can use the full browserwindow instead?
like this [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/fullscreenfire.htm]demo[/url] from the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/]demopage[/url] or this [url=http://www.jeroenwijering.com/extras/fullscreen.html?file=/upload/acera.flv&id=&stream=]demo[/url] from the [url=http://www.jeroenwijering.com/extras/]extras[/url] page

JW Player

User  
0 rated :

@andersen

Thanks for this information.

JW Player

User  
0 rated :

hello,

here has any option to change the controllbar view without effecting the playing video.
just like : http://www.livevideo.com/video/7AFD501E52CB4CFA9350F1480823C274/2007-bmw-m5-exotic-cars-info.aspx

in this player, please right click on this player and select your theme
and your player controllbar view will be changed without effecting your playing video.

if you provided this facility then know me how can i get it.

or if you don't provided any facility like this then tell me how can i implement in my player.

JW Player

User  
0 rated :

sorry, there is no such built in facility...
please see the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/customize.htm]customize[/url] demo from the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/]demopage[/url] (and some of the others maybe, like [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/filmstrip.htm]this[/url] one)

JW Player

User  
0 rated :

thanx man

JW Player

User  
0 rated :

I wanted to follow what Jeroen did on the demo page here: http://www.jeroenwijering.com/extras/fullscreen.html?file=/upload/acera.flv

with the code provided:

bc.. <html>
<head>


<script type="text/javascript" src="/embed/swfobject.js"></script>


</head>
<body style="margin:0;">


<div id="player"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript">
var so = new SWFObject('/embed/mediaplayer.swf','player','100%','100%','7','#000000');
so.addVariable("file",getQueryParamValue("file"));
so.addVariable("id",getQueryParamValue("id"));
if(getQueryParamValue("stream")!='') { so.addVariable("streamscript",getQueryParamValue("stream")); }
so.addVariable("usefullscreen","false");
so.addVariable("fsbuttonlink","streaming.html");
so.addVariable("displayheight","9999");
so.addVariable("autostart","true");
so.write('player');

</script>


</body>
</html>


What am I supposed to change? What I'm trying to accomplish is have the page load and have the viewer presented with 2 options in a clickable format. Either "Watch Full Screen" or "Watch 640x480". I'm not really sure which route to take and what the "getQueryParamValue" line does. Any help would be appreciated. Thanks for your time!

JW Player

User  
0 rated :

getQueryParamValue('file') returns what ever was in the file parameter when the HTML was called.

For this call:bc.. http://www.jeroenwijering.com/extras/fullscreen.html?file=/upload/acera.flv
getQueryParamValue('file') would return "/upload/acera.flv".

So he is calling a common HTML page with different parameters depending on what he wants displayed.

Look at the code behind the buttons and you can see how to call the player page. I don't know what page you found the buttons on, so I can't check them.

JW Player

User  
0 rated :

@autoStart

Thanks for the help! Much appreciated

JW Player

User  
0 rated :

@pete - please see this [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/onlinemediaplayer.htm]demo[/url] (on the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/]demopage[/url])
it also shows a method to change the size of the player...

JW Player

User  
0 rated :

@andersen

Thats awesome! I'm definitely going to incorporate that in my next design. Thanks!!!

JW Player

User  
0 rated :

it is as easy as:

<BODY onload="javascript:window.resizeTo(screen.width,screen.height); window.moveTo(0,0);">

Change the size to to screensize and move it to the top corner....

Grtz,
RuSH

JW Player

User  
0 rated :

@THaRuSHeR,

Your code only produces a full browser window.

The Adobe Flash Player fullscreen mode can only be activated by a user mouse-click/key-press. For the JW FLV Media Player, it's mouse-clicks only.

JW Player

User  
0 rated :

bc.. <body onload="javascript:sendEvent('fullscreen');">
doesn't work either in case someone picks up on that :)

JW Player

User  
0 rated :

mouse click on the player itself, or can u grab a click elsewhere on the page from javascript?

Ethan Feldman

JW Player Support Agent  
0 rated :

Player itself, i believe.

JW Player

User  
0 rated :

Ethan, I can't seem to reach the links described in this page... all of them are expired or something. Would it be possible to find this code from the original post: http://www.jeroenwijering.com/extras/javascript.html


Thanks!

Ethan Feldman

JW Player Support Agent  
0 rated :

Maybe these examples will help – http://developer.longtailvideo.com/contributors/nyboe/

This question has received the maximum number of answers.