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

Autostart not working


Hi,

I love the mediaplayer and ...Hi,

I love the mediaplayer and have been using it for quite some time.
Now, for the first time, I've run into a problem that drives me absolutely mad.

I'm trying to play a single MP3 file with autostart and repeat both set to true. also, I want to hide the player so the visitor has no control over the music (dont ask why, customers wish).

Here is the code I'm using:

bc.. <script src="./files/js/swfobject.js" type="text/javascript"></script>
<div id="musicplayer" class="flashobject">
</div>
<script type="text/javascript">
var fo = new SWFObject("./files/mediaplayer.swf", "musicplayer",'','','6');
fo.addVariable("file","./files/sound.mp3");
fo.addVariable("autostart ","true");
fo.addVariable("repeat","true");
fo.write("musicplayer");
</script>



The problem I have is that the file doesn't play automatically and it doesnt loop, eventhough it should...

The other question I have, is it possible to hide the player? Using CSS seems to stop the player from working also...

thanks for any help!
regards
y

54 Community Answers

JW Player

User  
0 rated :

@Ynamite - do you have the very newest v.3.99+ player? (click "scripts" at the top of this page)
try set the size of the player to width and height 0...
please see the [url=http://www.jeroenwijering.com/extras/wizard.html]wizard[/url] for example code for both swobject and embed (dont use both)
please also see the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/]demos[/url] for examples of other ways of embedding and hiding the players...

btw. you have a space after autostart, try remove that:
bc.. fo.addVariable("autostart ","true");

JW Player

User  
0 rated :

hey

thanks for the fast response! Yeah I downloaded the most recent version (I always do :d)

I got it working just now, but I honestly cannot say what the difference is. The only thing I can see that's different is that I now define the actual MP3 right at the end, where as before it was the first VAR I defined. And the space that is now gone... if that was the error somebody needs to come over here and kick me in the nads. *)

Here the working code (note: I added a few other things to make the player completely invisible on all browser which were relevant to my client)

bc.. <script type="text/javascript">
// <![CDATA[

var fo = new SWFObject("./files/mediaplayer.swf", "musicplayer",'0','0','6');
fo.addVariable('repeat', 'true');
fo.addVariable('autostart', 'true');
fo.addVariable('backcolor', '0xFFFFFF');
fo.addVariable('frontcolor', '0xFFFFFF');
fo.addVariable('showdigits', 'false');
fo.addVariable('showdownload ', 'false');
fo.addVariable('showeq', 'false');
fo.addVariable('showicons', 'false');
fo.addVariable('displaywidth', '0');
fo.addVariable('displayheight', '0');
fo.addVariable("file","./files/sound.mp3");
fo.write("musicplayer");

// ]]>
</script>




Thanks again, epsecially for the hint concerning 0 height and width.
regards
y

JW Player

User  
0 rated :

glad you got it working...
i actually think it was that space (i just tested),
but you seem to have managed the punching your self- so :d

JW Player

User  
0 rated :

Why not start??? :(((
help me please
<div id='swfplayer'>
<a href='http://www.adobe.com/products/flashplayer/'>Scarica Flash Player</a> per vedere il filmato.</div>
<script type='text/javascript'>
var s1 = new SWFObject('flvplayer.swf','pimov','320','260','7');
s1.addParam('allowfullscreen','true');
s1.addVariable('file','http://localhost/video/movie/users/5cb1d374bf947f7a400022b0c5fcfb35/35.flv');
s1.addParam('width','320');
s1.addParam('height','260');
s1.addParam('autostart','true');
s1.addVariable('type','flv');
s1.write('swfplayer');
</script>

great player and great job but i have this problem....
the movie not autostart ....
i use last player release and last swfobject script....

the strange thing is on your wizard configuration all is ok
i copy and paste alla variables from your script but not resolve the problem.... thanks a lot for the help....

see you soon guy

Sorry obviously if i click manual play the file start in the right mode...
thanks
italian andy :)

JW Player

User  
0 rated :

great ... sorry for the stupid question :s
but after two or three hours of works this is the result....
yes now it's ok ..... thanks a lot....

i'm looking for syntax error in the name of variable and not in the name of method.... :p

Great! :)

JW Player

User  
0 rated :

I have the following on my site:

<embed src="http://www.prnocturno.com/embed/mediaplayer.swf" width="320" height="20" allowfullscreen="true" allowscriptaccess="always" flashvars="&file=/upload/djmidas.mp3&height=20&width=320" />
<script type="text/javascript">

1) How can I put the autoplay on?
2) How can I hide it from people?

JW Player

User  
0 rated :

Any possible chance of you guys getting autostart to work?

JW Player

User  
0 rated :

The problem I have is that the file doesn't play automatically.

My URL is: http://www.vejotv.com/governo.php
and here is my script:

<script type='text/javascript' src='swfobject.js'></script>
<script type='text/javascript'>
var s1 = new SWFObject('player.swf','player','470','329','9');
s1.addVariable('autostart','true');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('wmode','opaque');
s1.addParam('flashvars','file=copa3.flv&fullscreen=true');
s1.write('preview');
</script>

JW Player

User  
0 rated :

Either use the "addVariable()" method to add flashvars or use the "addParam()" method, or at least put the "addVariable()" after the "addParam()":bc.. <script type='text/javascript' src='swfobject.js'></script>
<script type='text/javascript'>
var s1 = new SWFObject('player.swf','player','470','329','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('wmode','opaque');
s1.addParam('flashvars','file=copa3.flv&fullscreen=true');
*s1.addVariable('autostart','true');*
s1.write('preview');
</script>
Otherwise, the:bc.. s1.addParam('flashvars','file=copa3.flv&fullscreen=true');
wipes out the previously added flashvars.

Or put all of the flashvars in the "addParam()":bc.. s1.addParam('flashvars','file=copa3.flv&fullscreen=true*&autostart=true*');

JW Player

User  
0 rated :

Now its ok, worked fine !
Thanks a lot, great player and great job !

JW Player

User  
0 rated :

@Marcio,

Good to hear that it works! You're welcome & enjoy your player.

JW Player

User  
0 rated :

hi kLink & Marcio

Thanks for your question and answer. Great work. This was very useful to me.

JW Player

User  
0 rated :

hello,

i have the same problem.the player doesnt autostart, her my code:

<script type='text/javascript' src='swfobject.js'></script>
<script type='text/javascript'>
var s1 = new SWFObject('player.swf','player','440','270','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('flashvars','file=test2.m4v');
s1.addParam('autostart','true');
s1.write('preview');

</script>

can you help me please?

JW Player

User  
0 rated :

s1.addParam('flashvars','file=test2.m4v&autostart=true);

JW Player

User  
0 rated :

what i did was :

s1.addParam('flashvars','file=something.flv');

make this to

s1.addVariable('file', 'something.flv');

for autostart

s1.addVariable('autostart','true');

this works! i spend so much time on this xD

JW Player

User  
0 rated :

Hello guys.

It's simple to do AUTOSTART

here is an example:

pay attention, i just say this only once ihihi

s1.addParam('flashvars','file=your file folder/file*&autostart=true*');

that's all

Best reggards

JW Player

User  
0 rated :

I have followed all the instructions suggested and am able to get the file to autoplay, but can't seem to figure out a way to get it to autoplay with no toolbar and stretching.

Ideas?

JW Player

User  
0 rated :

Hi,

I am using the below code, but in my page i am using 2 different .flv files to play. so that i called twice, the actual problem was 1 player correctly play the file in loope. But another player is played first time and paused at the end and not playing second time.

Could you please suggest me to solve this problem.


var s1 = new SWFObject('../Media/Production/mediaplayer.swf','player','300','250','9');
s1.addParam('allowfullscreen','false');
s1.addParam('allowscriptaccess','always');
s1.addParam('flashvars','file=video.flv&autostart=true&icons=false&repeat=always&start=1');
s1.write('ctl00_flvLeftBanner1');

JW Player

User  
0 rated :

I had to use flashvars. addParam nor addVariable worked for me in any sequence.

JW Player

User  
0 rated :

in my case i want autostart to be false .... but it is nt working , video starts when i hit the page :

below is my piece of code:

var fo;
fo = new FlashObject("mediaplayer.swf", "index", "408", "306", "8", "");
fo.addVariable("autostart","false");
fo.addVariable("imageURL", "");
fo.addVariable("videoURL", vdtUrl);
fo.write("disp0");

JW Player

User  
0 rated :

when you embed it????

this is all .js,

JW Player

User  
0 rated :

this is not autostarting for me:

bc.. var so = new SWFObject('player.swf','mpl','640','480','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('autostart','true');

JW Player

User  
0 rated :

Change this:
bc.. s1.addParam('width','320');
s1.addParam('height','260');
s1.addParam('autostart','true');


to this:
bc.. s1.add*Variable*('width','320');
s1.add*Variable*('height','260');
s1.add*Variable*('autostart','true');

JW Player

User  
0 rated :

@Jose

from the [url=http://www.jeroenwijering.com/extras/readme.html]readme[/url]: bc.. *autostart* (true,false,muted): Set this to "true" to make the player automatically start playing when the page loads. If set to "muted", the player will autostart with the volume set to 0 and an unmute icon in the display.

JW Player

User  
0 rated :

s1.addParam('flashvars','file=test2.m4v&autostart=true');
[s]s1.addParam('autostart','true');[/s]

or

s1.addParam('flashvars','file=test2.m4v');
s1.addVariable('autostart','true');

JW Player

User  
0 rated :

s1.addParam('flashvars','file=test2.m4v&autostart=true); - is not correct !
an* ' *is missing after true - like this is better:
*s1.addParam('flashvars','file=test2.m4v&autostart=true');*

JW Player

User  
0 rated :

s1.addParam('flashvars','file=your file folder/file&autostart=true');

This is not valid in xhtml.... I can't get it to work. Tried all the above ways. I give up. But a good thread otherwise. Thanks.

JW Player

User  
0 rated :

I was having the same problem. My code is embedded so the autostart="true" did nothing. But I added autostart to the end of the flashvar statement.

flashvars="height=145&width=400&file=playlearn/playlist.xml&displaywidth=134&autostart"

It works using IE8, Firefox, googlechrome, opera and safari.

Now if I could get it to stop shuffling the list I would be all set. Not a big deal but it would be nice.

Ethan Feldman

JW Player Support Agent  
0 rated :

Hi Buddy,

If you set the shuffle flashvar to false, the should be no shuffling. But shuffle should be false by default.

Best,
-Ethan

JW Player

User  
0 rated :

hi friends

s1.addParam('flashvars','file=http://www.youtube.com/watch?v=oelzuLcIk10');

i want play all videos by youtube and flv vidoes give me script

JW Player

User  
0 rated :

how to change script

JW Player

User  
0 rated :

s1.addParam('flashvars','file=[var.video_play]&hd=true&hdpath=[var.video_play]&preroll=true&Preview=[var.base_url]/[var.thumb_file]&postroll=true&midroll=true');

i want play both youtube and flv videos with above scripts

pls tell me any modifictions

Ethan Feldman

JW Player Support Agent  
0 rated :

@RAJU – to add autostart to this, make it:

s1.addParam(‘flashvars’,‘file=[var.video_play]&hd=true&hdpath=[var.video_play]&preroll=true&Preview=[var.base_url]/[var.thumb_file]&postroll=true&midroll=true&autostart=true’);

JW Player

User  
0 rated :

Hello, i'm trying to autostart the movie to, but i couldt find a solution.
Everything works fine (allowfullscreen etc, but autostarts not working)

Is it possible, that jwplayer-demo doesnt support this?

<object id="player" classid="clsid:12341234" name="player" width="1234" height="134">
<param name="movie" value="files/player_1.swf" />
<param name="allowfullscreen" value="true" />
<param name="autostart" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=files/player_1.swf" />
<embed
type="application/x-shockwave-flash"
id="player2"
name="player2"
src="files/player_1.swf"
width="1234"
height="1234"
allowscriptaccess="always"
allowfullscreen="true"
autostart="true"
flashvars="file=files/player_1.swf"
/>
</object>

Jingo

JW Player

User  
0 rated :


*autostart* is a JW Player flashvar *_NOT_* an Adobe Flash Player parameter.
bc.. <object classid="clsid:12341234" id="player" name="player" width="1234" height="134">
<param name="movie" value="files/player_1.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=files/video.flv&autostart=true" />
<embed type="application/x-shockwave-flash" id="player2" name="player2" src="files/player_1.swf" width="1234" height="1234" allowscriptaccess="always" allowfullscreen="true" flashvars="file=files/video.flv&autostart="true" />
</object>



*_Note that you must use a compatible video/audio file, currently "video.flv" in the code posted above._*

JW Player

User  
0 rated :



I copy pasted the script into my site and the autostart does not work. Instead, I have to click the screen which brings up the menu, which I also want to remove, and then x out of the menu screen before the video will play.

Please can you help?

Here's my code:

bc.. <script type='text/javascript' src='/jwvideo/swfobject.js'></script>
<div id='mediaspace'>
<div align="center">This text will be replaced</div>
</div>

<script type='text/javascript'>
var so = new SWFObject('/jwvideo/player.swf','mpl','448','334','9');
so.addVariable('allowfullscreen','true');
so.addVariable('allowscriptaccess','always');
so.addVariable('wmode','opaque');
so.addVariable('author','Gav');
so.addVariable('description','How To Get');
so.addVariable('duration','8 mins or so');
so.addVariable('file','/jwvideo/7steps-promo.mp4.ff.flv');
so.addVariable('frontcolor','FFFFFF');
so.addVariable('screencolor','FFFFFF');
so.addVariable('controlbar','none');
so.addVariable('menu','false');
so.addVariable('autostart','true');
so.addVariable('icons','false');
so.addVariable('stretching','none');
so.write('mediaspace');
</script>

Ethan Feldman

JW Player Support Agent  
0 rated :

@Gav – To remove the menu, you need to go back to our site and re-download the player, uncheck the “Viral” checkbox. Regarding the issue with clicking twice, can you provide a link to where you are running this?

JW Player

User  
0 rated :

Thanks for the response. Here's the test page
http://www.organizedr.com/7steps-video.php

Ethan Feldman

JW Player Support Agent  
0 rated :

This code should fix it:

<script type='text/javascript'>
  var so = new SWFObject('/jwvideo/player.swf','mpl','448','334','9');
  so.addVariable('allowfullscreen','true');
  so.addVariable('allowscriptaccess','always');
  so.addVariable('wmode','opaque');
  so.addVariable('author','Gavriel Shaw');
  so.addVariable('description','How To Get Organized Now');
  so.addVariable('file','/jwvideo/7steps-promo.mp4.ff.flv');
  so.addVariable('frontcolor','FFFFFF');
  so.addVariable('screencolor','FFFFFF');
  so.addVariable('controlbar','none');
  so.addVariable('menu','false');
  so.addVariable('autostart','true');
  so.addVariable('icons','false');
  so.addVariable('stretching','none');
  so.write('mediaspace');
</script>



You still need to download the player without viral though to remove the menu - http://www.longtailvideo.com/players/jw-flv-player/

JW Player

User  
0 rated :

Hi Ethan,

I've replaced the code and I've uploaded the other download after unchecking the viral box, but I still have the menu and still not auto-starting...?

Ethan Feldman

JW Player Support Agent  
0 rated :

Clear your cache – http://www.organizedr.com/7steps-video.php, it works for me now.

JW Player

User  
0 rated :

Ethan, I cleared the cache and the menu is now not appearing so that's great. But the auto-play is still not working, either in Safari, Firefox, or Flock...

?

Gav

Ethan Feldman

JW Player Support Agent  
0 rated :

Okay, the issue is actually with your flv file, it lacks metadata. Use this application to fix it – http://www.buraks.com/flvmdi/

JW Player

User  
0 rated :

hi,I want to play the playlist with autostart ,but it's can't work!

Please can you help?

Here's my code:

var s1 = new SWFObject('flv/cw_player.swf','ply','260','260','9','#ffffff');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('wmode','opaque');
s1.addVariable('autostart','true');//or s1.addParam('autostart','true');
s1.addParam('flashvars','file=flv/list.xml&backcolor=111111&frontcolor=DFDFDF&lightcolor=932E2E&stretching=fill&ampautostart=true');

s1.write('preview');


Best,
Boby

Ethan Feldman

JW Player Support Agent  
0 rated :

Change:

s1.addParam(‘flashvars’,‘file=flv/list.xml&backcolor=111111&frontcolor=DFDFDF&lightcolor=932E2E&stretching=fill&ampautostart=true’);

To:

s1.addParam(‘flashvars’,‘file=flv/list.xml&backcolor=111111&frontcolor=DFDFDF&lightcolor=932E2E&stretching=fill&autostart=true’);

JW Player

User  
0 rated :

Will, Thank you very much.

JW Player

User  
0 rated :

Hey - can you help please, the autostart feature doesn't seem to work.

Here is the link - http://jvaboss1.squarespace.com/video-page

Ethan Feldman

JW Player Support Agent  
0 rated :

This is because the code is incorrect.

<param value="true" name="autostart">

Is not how to do it.

You need to add &autostart=true at the end of your flashvars line.

JW Player

User  
0 rated :

Wow, thank you! It is working now!

Ethan Feldman

JW Player Support Agent  
0 rated :

Np!

JW Player

User  
0 rated :

The autostart is working for me, but it starts too quickly. How do I add a longer pause before the video starts?

Following is the code we're using...

jQuery(".Media").media({
height: 406,
width: 640,
caption: false,
src: "/media_console/Player/player-licensed.swf",
bgColor: "#2F2F2F",
params: {
allowfullscreen: "true",
allowscriptaccess: "always",
wmode: "transparent"
},
flashvars: {
file : _MediaUrl,
backcolor : "333333",
frontcolor : "CCCCCC",
lightcolor : "CCCCCC",
screencolor : "000000",
stretching : "fill",
width : "640",
height : "406",
autostart: true,
volume : 75,
shareOn : true,
embedOn : true,
plugins : "http://www.mysite.com/media_console/Player/viral.swf",
"viral.functions" : "embed,link",
"viral.oncomplete" : false
}

Ethan Feldman

JW Player Support Agent  
0 rated :

Under:

height : “406”,

Add:

bufferlength : “10”,

For example.

JW Player

User  
0 rated :

<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/kpIr-s3-xi4?fs=1&hl=en_US&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/kpIr-s3-xi4?fs=1&hl=en_US&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>

can you autostart that for me ?

Ethan Feldman

JW Player Support Agent  
0 rated :

Sorry, this is YouTube embed code, not our player.

This question has received the maximum number of answers.