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. . . .
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>
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.
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.
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()"> ?
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?
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.
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.
@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...
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.
@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.
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. . . .
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
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.
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)
<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!
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.
@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...
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