You are here

function _media_youtube_check_flv_player_setup in Media: YouTube 6

Ensure we're able to run YouTube videos from the JW FLV Media Player. This requires that we both have the player installed, and the included yt.swf file is located in the same folder.

Return value

boolean Returns TRUE if both checks are TRUE.

2 calls to _media_youtube_check_flv_player_setup()
media_youtube_admin_form in includes/media_youtube.admin.inc
This form will be displayed both at /admin/settings/media_youtube and admin/content/emfield.
template_preprocess_media_youtube_flash in themes/media_youtube.theme.inc
The embedded flash displaying the youtube video.

File

./media_youtube.module, line 355
Embedded Video Field provider file for YouTube.com.

Code

function _media_youtube_check_flv_player_setup() {
  static $check;
  if (is_null($check)) {

    // We set up a static cache.
    // First check that the JW FLV Player is installed.
    $flv_path = emfield_flvmediaplayer_url();
    if (!$flv_path || !file_exists($flv_path)) {

      // There's no player installed, so yt.swf is moot.
      $check = FALSE;
    }
    else {

      // Now check that the yt.swf file is also present in the same folder.
      $path = dirname($flv_path);
      $check = file_exists($path . '/yt.swf');
    }
  }
  return $check;
}