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

Autoplay


How do I get a video to autoplay or autostart: Here is the code I am using:

bc.. <embed type="application/x-shockwave-flash" src="http://content.bitsontherun.com/players/{$video.video_key}-57694-36297.swf" width="640" height="387" bgcolor="#000000" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" autoplay="true" />


8 Community Answers

Remco van Bree

JW Player Support Agent  
2 rated :

If you use the swf style embeds the only way to do this is by adding the following into the custom flashvar field of the player:

autostart=true



When you use the js style embed codes you can add variables in a much more flexible manner like this:
<script type="text/javascript" src="http://content.bitsontherun.com/players/nPripu9l-ALJ3XQCI.js"></script>
<script type="text/javascript">
  botr_nPripu9l_ALJ3XQCI.addVariable("autostart","true");
</script>



See the <a rel="no follow" href="http://www.bitsontherun.com/tutorials/add-custom-flashvars-within-bits-run-cms/">add custom flashvar tutorial</a> for more details.

JW Player

User  
0 rated :

Thanks for your quick reply, the demo you sent works perfect, but when I add the code to insert the VIDEOKEY and the PLAYERKEY, it does not work, the video shows up, but does not autostart. Here is the code:

bc.. <script type="text/javascript" src="http://content.bitsontherun.com/players/{$video.video_key}-57694-36297.js"></script>
<script type="text/javascript">
botr_{$video.video_key}_57694-36297.addVariable("autostart","true");
</script>



Any suggestions?

Remco van Bree

JW Player Support Agent  
0 rated :

botr_{$video.video_key}_57694-36297.addVariable("autostart","true");



should be 
botr_{$video.video_key}_57694_36297.addVariable("autostart","true");



(note the underscore). This is because JavaScript starts doing math on a string when it sees a dash.

JW Player

User  
0 rated :

Yea, I tried that, tried all variations of that, here, again, is my current code - maybe it is something wrong with the "-" in the PLAYERKEY?

<script type="text/javascript" src="http://content.bitsontherun.com/players/gdbaUJPG-57694-36297.js">
</script>
<script type="text/javascript">
botr_gdbaUJPG_57694_36297.addVariable("autostart","true");
</script>

Remco van Bree

JW Player Support Agent  
0 rated :

First of all, you are using the {video_key}-{conversion_key}-{player_key} scheme. This has been deprecated, you should use {video_key}-{player_key} instead.

Furthermore it looks like you are using a player that is not in your account. It is quite possible that this other code has a hardcoded autostart=false. That will override any autostart parameters sent in a flashvar.

If I change you embed code to:

<script type="text/javascript" src="http://content.bitsontherun.com/players/gdbaUJPG-vAKOX3V6.js"> </script>
<script type="text/javascript"> botr_gdbaUJPG_vAKOX3V6.addVariable("autostart","true"); </script>



Here vAKOX3V6 is a video player in your account. Even when I disable autostart within the player configuration, the flashvar will cause an autostart now. 

JW Player

User  
0 rated :

That worked, thanks! The client gave me the incorrect account info, all good now.

JW Player

User  
0 rated :

I am trying to get my video to autoplay as well. The code I am using is

<script type="text/javascript" src="http://content.bitsontherun.com/players/ywhbSEsY-u5qYY6D6.js"> </script>
<script type="text/javascript"> botr_ywhbSEsY-u5qYY6D6.addVariable("autostart","true"); </script>

I can watch the video, but it does not autoplaying

Remco van Bree

JW Player Support Agent  
1 rated :

Hey Chris,

At first glance this happens because you will need to replace a dash in the second line with an underscore like this:

<script type="text/javascript" src="http://content.bitsontherun.com/players/ywhbSEsY-u5qYY6D6.js"> </script> 
<script type="text/javascript"> botr_ywhbSEsY_u5qYY6D6.addVariable("autostart","true"); </script>



You need to use an underscore because a dash would trigger javascript to treat as a calculation; botr_ywhbSEsY minus u5qYY6D6 instead of a string, which doesn't make a lot of sense.

This question has received the maximum number of answers.