You are here

function swftools_wijering4_swftools_methods in SWF Tools 6.3

Implementation of hook_swftools_methods().

File

wijering4/swftools_wijering4.module, line 11
Enables SWF Tools support for LongTail Player 4. This module also works with LongTail Player 5.

Code

function swftools_wijering4_swftools_methods() {

  // Wijering4 now comes in two versions - viral and non-viral - since we now cache the results of this function we can
  // check which is present, testing for the viral one first
  // Start with the viral player
  $player = '/player-viral.swf';

  // Get the library path
  $library = swftools_get_library('mediaplayer4');

  // Discover if the viral player is present
  if (!file_exists($library . $player)) {

    // If not, try the non-viral version
    $player = '/player.swf';
    if (!file_exists($library . $player)) {

      // If non-viral isn't present either revert to viral for purposes of the download message (since viral is the default)
      $player = '/player-viral.swf';
    }
  }

  // Define the media player
  $jwplayer = array(
    'module' => 'swftools_wijering4',
    'title' => t('JW Player 4'),
    'download' => 'http://developer.longtailvideo.com/trac/browser/tags',
    'width' => 400,
    'height' => 300,
    'library' => $library . $player,
    'profile' => array(
      'path' => 'wijering4',
      'settings' => array(
        'swftools_jwplayer4',
      ),
      'file' => 'swftools_wijering4.admin.inc',
      'page argument' => 'swftools_wijering4_profile_form',
    ),
  );

  // Wijering support various actions with the same player and info.
  $methods['video']['jwplayer4'] = $jwplayer;
  $methods['video_list']['jwplayer4'] = $jwplayer;
  $methods['audio']['jwplayer4'] = $jwplayer;
  $methods['audio_list']['jwplayer4'] = $jwplayer;
  $methods['swftools_media_display']['jwplayer4'] = $jwplayer;
  $methods['media_list']['jwplayer4'] = $jwplayer;
  $methods['image_list']['jwplayer4'] = $jwplayer;

  // Return methods
  return $methods;
}