You are here

function swftools_get_action in SWF Tools 6

Same name and namespace in other branches
  1. 5 swftools.module \swftools_get_action()
  2. 6.3 swftools.module \swftools_get_action()
  3. 6.2 swftools.module \swftools_get_action()

Identify the best action based on the file type that is passed

2 calls to swftools_get_action()
swf in ./swftools.module
Return output, which might be embed markup, or pre-flash markup that includes the appropriate jQuery added to the <head>
swftools_prepare_playlist_data in ./swftools.module
This function is a work in progress.

File

./swftools.module, line 536

Code

function swftools_get_action($file) {

  // Try to determine the action based on the file extension.
  $path_parts = pathinfo($file);
  switch (strtolower($path_parts['extension'])) {
    case 'flv':
      return SWFTOOLS_FLV_DISPLAY;
    case 'swf':
      return SWFTOOLS_SWF_DISPLAY_DIRECT;
    case 'mp3':
      return SWFTOOLS_MP3_DISPLAY;
    case 'jpg':
    case 'gif':
    case 'png':
    case 'jpeg':
    case 'img':
      return SWFTOOLS_IMAGE_DISPLAY_LIST;
    default:

      // Make a broad assumption that the configured mediaplayer will handle
      // this file or playlist.
      return SWFTOOLS_MEDIA_DISPLAY_LIST;
  }
}