You are here

function emfield_flvmediaplayer_url in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 deprecated/emfield-deprecated.inc \emfield_flvmediaplayer_url()
  2. 6.2 emfield.module \emfield_flvmediaplayer_url()

Returns the URL to the registered JW Flash Media Player, if such exists.

5 calls to emfield_flvmediaplayer_url()
emfield_settings in ./emfield.admin.inc
Callback for admin/content/emfield.
emvideo_youtube_settings in contrib/emvideo/providers/youtube.inc
hook emvideo_PROVIDER_settings this should return a subform to be added to the emvideo_settings() admin settings page. note that a form field will already be provided, at $form['PROVIDER'] (such as $form['youtube']) so if you want…
theme_emvideo_youtube_flash in contrib/emvideo/providers/youtube.inc
The embedded flash displaying the youtube video.
theme_emvideo_zzz_custom_url_embedded_video in contrib/emvideo/providers/zzz_custom_url.inc
_emvideo_youtube_check_flv_player_setup in contrib/emvideo/providers/youtube.inc
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.

File

./emfield.module, line 762
Embedded Media Field is a CCK-based framework for 3rd party media files.

Code

function emfield_flvmediaplayer_url($reset = FALSE) {
  static $path;
  if (is_null($path) || $reset) {
    if (module_exists('flvmediaplayer')) {
      $path = variable_get('flvmediaplayer_path', drupal_get_path('module', 'flvmediaplayer') . '/mediaplayer.swf');
    }
    else {
      if (is_null($path = variable_get('emfield_flvmediaplayer_url', NULL)) || !$path && $reset) {
        global $base_path;
        $path = '';
        $files = drupal_system_listing('(^player-viral\\.swf$|^player\\.swf$|^mediaplayer\\.swf$)', 'plugins', 'basename', 0);
        if (!empty($files)) {
          $file = array_pop($files);
          $path = $file->filename;
        }
        else {
          $files = drupal_system_listing('(^player-viral\\.swf$|^player\\.swf$|^mediaplayer\\.swf$)', 'modules', 'basename', 0);
          if (!empty($files)) {
            $file = array_pop($files);
            $path = $file->filename;
          }
        }
        variable_set('emfield_flvmediaplayer_url', $path);
      }
    }
  }
  return $path;
}