You are here

function wijering4_swftools_methods in SWF Tools 6.2

Same name and namespace in other branches
  1. 5 wijering4/wijering4.module \wijering4_swftools_methods()
  2. 6 wijering4/wijering4.module \wijering4_swftools_methods()

Implementation of swftools_methods hook Report methods back to SWF Tools

File

wijering4/wijering4.module, line 20

Code

function 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 = 'flash_media_player/player-viral.swf';

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

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

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

  // Define the media player
  $media_player = array(
    'name' => WIJERING4_MEDIAPLAYER,
    'module' => 'wijering4',
    'file' => 'file',
    // Define which flashvar to assign a 'file to play' variable.
    'version' => '7',
    'shared_file' => $player,
    'title' => t('JW Media Player 4'),
    'download' => WIJERING4_DOWNLOAD,
    'width' => '400',
    'height' => '300',
  );

  // Wijering support various actions with the same player and info.
  $methods[SWFTOOLS_FLV_DISPLAY][WIJERING4_MEDIAPLAYER] = $media_player;
  $methods[SWFTOOLS_FLV_DISPLAY_LIST][WIJERING4_MEDIAPLAYER] = $media_player;
  $methods[SWFTOOLS_MP3_DISPLAY][WIJERING4_MEDIAPLAYER] = $media_player;
  $methods[SWFTOOLS_MP3_DISPLAY_LIST][WIJERING4_MEDIAPLAYER] = $media_player;
  $methods[SWFTOOLS_MEDIA_DISPLAY][WIJERING4_MEDIAPLAYER] = $media_player;
  $methods[SWFTOOLS_MEDIA_DISPLAY_LIST][WIJERING4_MEDIAPLAYER] = $media_player;
  $methods[SWFTOOLS_IMAGE_DISPLAY_LIST][WIJERING4_MEDIAPLAYER] = $media_player;

  // Return methods
  return $methods;
}