Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Stop movie from auto play and use Image - help

8 replies [Last post]

My script is being used inside a php file, everything works good. But, I don't want the movie to auto play and would like to use an image for user to click.

This is not working for me and has no effect on movie

<script type="text/javascript">
var s1 = new SWFObject("' . $fileLoc . 'player-licensed.swf","ply","'.$width.'","'.$height.'","10","#FFFFFF");
s1.addParam("start","false");
s1.addParam("image","http://www.audiotweaker.com/wp-content/themes/ondemand/images/logo.jpg");
s1.addParam("allowfullscreen","true");
s1.addParam("allownetworking","all");
s1.addParam("allowscriptaccess","always");
s1.addParam("flashvars","file=' . $url . $flashvars . '");
s1.write("videoContainer-' . $counter++ . '");
</script>

Can anyone shine some light?

Thanks a million,
Mark

 
v4 player supported flashvars: http://developer.longtailvideo.com/trac/wiki/FlashVars#Behaviour

autostart=false is the default, so your player shouldn't be starting unless you have something hidden in $flashvars.

Thanks, but I don't know anything about javascript, so I'm not sure how to use your response.

 
Can you post the contents of $flashvar?

This is the only $flashvar info I could find

function jwPlayerOracle($url)
{
return (bool) preg_match("/(\.flv|\.mp4)$/i", $url);
}

function jwPlayer($url, $width, $height) {
static $counter = 1;

$flashvars = get_option('p75_jw_flashvars');
if ( !empty($flashvars) && substr($flashvars, 0, 1)!='&' )
$flashvars = '&' . $flashvars;

$fileLoc = get_option('p75_jw_files');
if ( substr($fileLoc, -1)!='/' )
$fileLoc = $fileLoc . '/';

return '<div id="videoContainer-' . $counter . '"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript" src="' . $fileLoc . 'swfobject.js"></script>
<script type="text/javascript">
var s1 = new SWFObject("' . $fileLoc . 'player-licensed.swf","ply","'.$width.'","'.$height.'","10","#FFFFFF");
s1.addParam("image","http://www.audiotweaker.com/wp-content/themes/ondemand/images/logo.jpg");
s1.addParam("allowfullscreen","true");
s1.addParam("allownetworking","all");
s1.addParam("allowscriptaccess","always");
s1.addParam("flashvars","file=' . $url . $flashvars . '");
s1.write("videoContainer-' . $counter++ . '");
</script>';
}

Thanks for your help.

 
Just a wild guess — you need to find out what is in the PHP variable $flashvars.

function jwPlayerOracle($url)
{
  return (bool) preg_match("/(\.flv|\.mp4)$/i", $url);
}

function jwPlayer($url, $width, $height)
{
  static $counter = 1;

  $flashvars = get_option('p75_jw_flashvars');

  if(!empty($flashvars) && substr($flashvars, 0, 1) != '&')
    $flashvars = '&' . $flashvars;

  $fileLoc = get_option('p75_jw_files');

  if(substr($fileLoc, -1) != '/')
    $fileLoc = $fileLoc . '/';

  return '<div id="videoContainer-' . $counter . '"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
          <script type="text/javascript" src="' . $fileLoc . 'swfobject.js"></script>
          <script type="text/javascript">
            var s1 = new SWFObject("' . $fileLoc . 'player-licensed.swf", "ply", "'.$width.'", "'.$height.'", "10", "#FFFFFF");
                s1.addParam("allowfullscreen",     "true");
                s1.addParam("allownetworking",     "all");
                s1.addParam("allowscriptaccess",   "always");
                s1.addParam("flashvars",           "file=' . $url . $flashvars . '&autostart=false&image=http://www.audiotweaker.com/wp-content/themes/ondemand/images/logo.jpg'");
                s1.write("videoContainer-' . $counter++ . '");
          </script>';
}

I think I just found it

bufferlength=5&autostart=true

This may be my problem. Is there a way to add code for the image as well?

Mark

bufferlength=5&autostart=true<strong>&image=image.jpg</strong>

thank you!!