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

autostart: true, is not working


The example given under Setup Syntax on page http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/15995/jw-embedder-reference-guide is not working.

You have to remove the line autostart: true, to get it working.
You has also to add the 'modes' line to get it working on a PC.

What should I do to get autostart working under Windows?

I tried the following code:

bc.. <script type="text/javascript" src="/jwplayer/jwplayer.js"></script>
</head>
<body>

<video id="container">Loading the player ...</video>
<script type="text/javascript">
jwplayer("container").setup({
autostart: true,
controlbar: "none",
file: "http://www.longtailvideo.com/jw/upload/bunny.mp3",
duration: 57,
flashplayer: "/jwplayer/player.swf",
volume: 80,
width: 720,
'modes': [ // not required for ipad, required for Vista
{type: 'html5'},
{type: 'flash', src: '/jwplayer/player.swf'},
{type: 'download'}
]
});
</script>

</body>


21 Community Answers

Pablo

JW Player Support Agent  
0 rated :

@acwolff -

There was indeed an issue with HTML5 mode and autostart. This has been fixed in the latest version of the player, available here:

http://developer.longtailvideo.com/trac/browser/trunk/fl5

JW Player

User  
0 rated :

UNFORTUNATELY, the 5.7 licensed player now auto plays in HTML5(PC) but WILL NOT autoplay in Flash! I have the latest js. Does the 5.7 player need to be updated????

Pablo

JW Player Support Agent  
0 rated :

@cu -

There is no issue with autostart in Flash that I’m aware of in 5.7. Do you have a page which demonstrates the issue?

JW Player

User  
0 rated :

All my pages are behind creds. I'll see if I can throw something up. But have definitely seen an issue with the 5.7 licensed viral. Will not autostart in Flash but will in HTML5. I've gotten around it with the JS API .play().

JW Player

User  
0 rated :

Just re-downloaded 5.7 licensed viral, copied over current swf and js. Both dated 7/6/2011 1:08pm. Cleared out cache on FF and Chrome. Issue still exists, will not autostart. Previous version would not autostart in HTML5 but would in Flash. Now this version is the opposite. Can't throw up a link yet, all code is behind uid/pw.

JW Player

User  
0 rated :

The 5.7 licensed viral is indeed buggy. In FF3.6, the JS API jwplayer().play() command works - SOMETIMES. In latest Chrome IT DOES NOT. Events are not being recognized in latest Chrome. I've tried .onReady() also and works sometimes in FF but never in Chrome!

Pablo

JW Player Support Agent  
0 rated :

@cu -

I believe you that you’re having trouble, but I’ve just tested it myself, and it works for me in all browsers. Here was the player embed code I used:

jwplayer("mediaplayer").setup({
	flashplayer: "player.swf",
	file: "video.mp4",
	image: "preview.jpg",
	autostart: "true"
});



I tested this using the "readme.html" file included with the download zip, running over a local http server.

Again, without a testing page to look at, there's not much I can do to help.  Could you put up a very simple test page somewhere outside of the authenticated part of your site?

JW Player

User  
0 rated :

Not sure if I mentioned but all this is happening using the JWEmbedder, not SWFObject.

Pablo

JW Player Support Agent  
0 rated :

@cu -

Yes, I was assuming you were using the JW Embedder.

JW Player

User  
0 rated :

I am seeing autostart=true regressed in 5.7 with images. When you have file pointing to image, i.e. jpg, and autostart=true, the player will show black screen with spinner. If you stop and play again, then image is shown correctly.

Pablo

JW Player Support Agent  
0 rated :

@ktp -

I’m not able to replicate this problem (it works fine for me when I test file=<image> and autostart=true. Do you have a link to a test page which demonstrates the issue?

JW Player

User  
0 rated :

Can't get autostart to work. Have tried to insert it in various places but to no avail. My coding is:

<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='470' height='24' id='single1' name='single1'>
<param name='movie' value='http://recherchemp3.com/player/player.swf'>
<param name='allowfullscreen' value='true'>
<param name='allowscriptaccess' value='always'>
<param name='wmode' value='transparent'>
<param name='flashvars' value='duration=183&file=http://recherchemp3.com/prelisten/3679328.mp3'>
<embed
type='application/x-shockwave-flash'
id='single2'
name='single2'
src='http://recherchemp3.com/player/player.swf'
width='470'
height='24'
bgcolor='undefined'
allowscriptaccess='always'
allowfullscreen='true'
wmode='transparent'
flashvars='duration=183&file=http://recherchemp3.com/prelisten/3679328.mp3'/>
</object>

Please help.

Ethan Feldman

JW Player Support Agent  
0 rated :

duration=183&file=http://recherchemp3.com/prelisten/3679328.mp3

needs to be:

duration=183&file=http://recherchemp3.com/prelisten/3679328.mp3&autostart=true

JW Player

User  
0 rated :

You're e genius.

I was one space out, so am consequently an idiot.

Many, many thanks for your help

Paul

JW Player

User  
0 rated :

Now then...

...is it possible to make it replay/loop continuously?

JW Player

User  
0 rated :

I am having the opposite problem. Since updating to v5.9, JW Player will always autostart my videos.

The default should be false anyway, but I've tried leaving out autostart and setting autostart = false, but it always starts playing automatically.

It seems to only occur when using a playlistfile. If I give it a single video then autostart works correctly. When using a playlistfile, it always autostarts regardless of the setting.

Example (this video should NOT autostart):
http://comments.gameplanet.co.nz/pc/games/184591.XCOM-Enemy-Unknown/videos/138670.20120307.XCOM-Enemy-Unknown-Deep-Dive-1-trailer/?_CC=NZ

PS: This is in Flash mode. In HTML5 mode it seems to work properly.

Pablo

JW Player Support Agent  
0 rated :

@Simon -

The issue appears to be with the Adtonomy plugin. We will investigate further.

Ethan Feldman

JW Player Support Agent  
0 rated :

@Paul – To make it loop, change:

duration=183&file=http://recherchemp3.com/prelisten/3679328.mp3&autostart=true

To:

duration=183&file=http://recherchemp3.com/prelisten/3679328.mp3&autostart=true&repeat=always

All variables are here for your reference – http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12536/configuration-options

JW Player

User  
0 rated :

Many, many thanks for all your help in this.

I now have things exactly as i want them.

A soundtrack that ebbs and flows throughout my work.

Once again, your help has been very much appreciated.

Kindest regards

Paul

http://www.justablokewithacamera.co.uk

JW Player

User  
0 rated :

@PabloS - Thanks.

This is causing some complaints for us so hopefully it won't take too long to fix!

Ethan Feldman

JW Player Support Agent  
0 rated :

Np Paul

This question has received the maximum number of answers.