The viddler theme code is outputting hardcoded autoplay=t!

Odd as the theme function gets the $autoplay setitng passed in as an argument to the theme function anyway.

    $output .= '<embed src="' . $embedurl .'" width="545" height="349" data="'. $player .'" type="application/x-shockwave-flash" allowScriptAccess="always" flashvars="autoplay=' . ($autoplay ? 'true' : 'false') . '" allowFullScreen="' . ($fullscreen ? 'true' : 'false') . '" name="viddler_" wmode="transparent"></embed>';

is the working code.

Comments

budda’s picture

i also fixed the id and name fields being a bit unfinished. correct theme function is now:

<?php
function theme_emvideo_viddler_flash($item, $width, $height, $autoplay) {
  $output = '';
  if ($item['embed'])  {
    $embedurl = $item['data']['OEMBED']['HTML']['clsid:D27CDB6E-AE6D-11cf-96B8-444553540000']['PARAM'][1]['VALUE'];
    $name = $item['data']['clsid:D27CDB6E-AE6D-11cf-96B8-444553540000']['EMBED'][1]['NAME'];
    $fullscreen = variable_get('emvideo_viddler_full_screen', 1);
    $show_portrait = $on_screen_info['portrait'] ? 1 : 0;
    $output  = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" width="'. $width .'" height="'. $height .'" id="' . $name .'">';
    $output .= '<embed src="' . $embedurl .'" width="545" height="349" data="'. $player .'" type="application/x-shockwave-flash" allowScriptAccess="always" flashvars="autoplay=' . ($autoplay ? 'true' : 'false') . '" allowFullScreen="' . ($fullscreen ? 'true' : 'false') . '" name="' . $name .'" wmode="transparent"></embed>';
    $output .= '<param name="wmode" value="transparent" />';
    $output .= '<param name="allowfullscreen" value="'. ($fullscreen ? 'true' : 'false') .'" />';
    $output .= '<param name="flashvars" value="autoplay=' . ($autoplay ? 'true' : 'false') .'" />';
    $output .= '<param name="movie" value="'. $embedurl .'" /></object>';
  }
  
  return $output;
}
?>
locomo’s picture

Status: Active » Reviewed & tested by the community

this is good.. worked for me

locomo’s picture

actually i just realized that width and height are still being hardcoded in the embed tag.. here's the fixed version:

<?php
function theme_emvideo_viddler_flash($item, $width, $height, $autoplay) {
  $output = '';
  if ($item['embed'])  {
    $embedurl = $item['data']['OEMBED']['HTML']['clsid:D27CDB6E-AE6D-11cf-96B8-444553540000']['PARAM'][1]['VALUE'];
    $name = $item['data']['clsid:D27CDB6E-AE6D-11cf-96B8-444553540000']['EMBED'][1]['NAME'];
    $fullscreen = variable_get('emvideo_viddler_full_screen', 1);
    $show_portrait = $on_screen_info['portrait'] ? 1 : 0;
    $output  = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" width="'. $width .'" height="'. $height .'" id="' . $name .'">';
    $output .= '<embed src="' . $embedurl .'" width="'. $width .'" height="'. $height .'" data="'. $player .'" type="application/x-shockwave-flash" allowScriptAccess="always" flashvars="autoplay=' . ($autoplay ? 'true' : 'false') . '" allowFullScreen="' . ($fullscreen ? 'true' : 'false') . '" name="' . $name .'" wmode="transparent"></embed>';
    $output .= '<param name="wmode" value="transparent" />';
    $output .= '<param name="allowfullscreen" value="'. ($fullscreen ? 'true' : 'false') .'" />';
    $output .= '<param name="flashvars" value="autoplay=' . ($autoplay ? 'true' : 'false') .'" />';
    $output .= '<param name="movie" value="'. $embedurl .'" /></object>';
  }
 
  return $output;
}
?>
tomdisher’s picture

I know this is over a year later, but the solution in #3 worked great.

This should be in the module... can we get a commit?

BassistJimmyJam’s picture

Assigned: Unassigned » BassistJimmyJam
Status: Reviewed & tested by the community » Fixed

This has been committed. I had to make a few changes to support the new return format of Viddler's oEmbed service.

BassistJimmyJam’s picture

Title: Autoplay hardcoded to TRUE! » Hardcoded autoplay value

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.