I would love to see this module work with the swftools module. This would give much more freedom in the choice of player, the choice of embedding method, and player configuration. As it stands now, we are basically tied to two players, and have no choice over how the players are styled, or how the videos are embedded. The embedding issue causes the code to be invalid, and I personally prefer to use swfobject for my embedding method, which isn't an option with this module.

Any chance for some integration?

Thanks.

Comments

esbon’s picture

Yes, I do agree. It would be nice if this module worked with swftools

travist’s picture

Status: Active » Postponed

This would be a great addition. However, it probably won't make it into the next release since we are not adding new features for the next revision. Maybe this can come in for the next major release, or when this module gets ported to Drupal 7 ( which I plan to do ).

If you have already implemented this feature, then I would love to see a patch that implements this behavior. Anyone up for the task?

Thanks for the suggestion.

Travis.

jaypan’s picture

I'll be up for it in a few months. It will be a fairly large undertaking, since I'm going to have to dig through both modules to figure out how they work first. I'm busy with a few projects until at least the end of February, but I can probably look into it after that.

I think it would definitely add a new dimension to the module.

jaypan’s picture

Component: Miscellaneous » Code

Ok, I've just figured out how to do this. I haven't got a patch for you, but I have a method. It's working for me on my site:

Change this function:

function template_preprocess_flashvideo_play(&$variables) {

  // Populate the $video_object variable based on the player specific theme.
  $variables['video_object'] = theme('flashvideo_'. $variables['video']['type'], $variables['video']);

  // Populate the $video_embed variable based on the theme for "flashvideo_embed"
  $variables['video_embed'] = theme('flashvideo_embed', $variables['video_object'], $variables['video']['node_type']);

}

To this:

function template_preprocess_flashvideo_play(&$variables) {
  // Populate the $video_object variable based on the player specific theme.
  if(module_exists('swftools')) {
    $flashvars = array();
    if(isset($variables['video']['height']) && $variables['video']['height']) {		
      $flashvars['height'] = $variables['video']['height'];
	}
    if(isset($variables['video']['width']) && $variables['video']['width']) {
      $flashvars['width'] = $variables['video']['width'];
    }
    $variables['video_object'] = swf (
      $variables['video']['file'],
      array (
        'params' => array(
		  'flashvars' => $flashvars,
		)
      )
	);
  }
  else {
    $variables['video_object'] = theme('flashvideo_'. $variables['video']['type'], $variables['video']);
  }
 
  // Populate the $video_embed variable based on the theme for "flashvideo_embed"
  $variables['video_embed'] = theme('flashvideo_embed', $variables['video_object'], $variables['video']['node_type']);

}

What this does is calls the swftools module if it's enabled. However, this means that any variables set in the flashvideo module are then ignored - so you will probably want to change the admin page a little to at least explain this to users, and preferably remove all options, as the swftools module now handles everything and any settings in this module are ignored.

I hope this helps! It's working beautifully on my site - I am now using swfobject 2 to embed my videos, which is my preferred way of embedding video, as I can use wmode=transparent as well as full screen. I have also skinned my player using the jw4 module bundled with swftools.