You are here

function swftools_jw5_swftools_methods in SWF Tools 6.3

Implementation of hook_swftools_methods().

File

jw5/swftools_jw5.module, line 11
Enables SWF Tools support for LongTail Player 5.

Code

function swftools_jw5_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('mediaplayer-5');

  // 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_jw5',
    'title' => t('JW Player 5'),
    'download' => 'http://www.longtailvideo.com/players',
    'width' => 400,
    'height' => 300,
    'library' => $library . $player,
    'profile' => array(
      'path' => 'jw5',
      'settings' => array(
        'swftools_jwplayer5',
      ),
      'file' => 'swftools_jw5.admin.inc',
      'page argument' => 'swftools_jw5_profile_form',
    ),
  );

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

  // Return methods
  return $methods;
}