You are here

function flowplayer_help in Flowplayer API 6

Same name and namespace in other branches
  1. 5 flowplayer.module \flowplayer_help()
  2. 7.2 flowplayer.module \flowplayer_help()
  3. 7 flowplayer.module \flowplayer_help()

Implementation of hook_help().

The code provided in this function is a demonstration of how to use jcarousel_add().

File

./flowplayer.module, line 13
Provides integration with FlowPlayer.

Code

function flowplayer_help($path, $arg) {
  switch ($path) {
    case 'admin/settings/flowplayer':
      return t('The following provides the default Flowplayer settings when the player is displayed. This does not mean it is how it will be displayed everywhere, it will just be the defaults if these settings are not explicitly sent through to the player.');
    case 'admin/help#flowplayer':
      $output = '<p>' . t('The following is a demonstration of <a href="@flowplayer">Flowplayer</a>. Note that you can change the defaults of how it looks in the <a href="@settings">Flowplayer settings</a>.', array(
        '@flowplayer' => 'http://flowplayer.org',
        '@settings' => url('admin/settings/flowplayer'),
      )) . '</p>';
      $output .= '<p>' . t("To create Flowplayer elements, you can either use the theme('flowplayer') function, or the flowplayer_add() function. The theme function will add the JavaScript to the page, as well as create the markup for you, while the <code>flowplayer_add()</code> function will just add the JavaScript.") . '</p>';

      /**
       * Theme Function
       */
      $output .= '<h3>' . t('Theme Funciton') . '</h3>';
      $output .= '<p>' . t("Calling <code>theme('flowplayer')</code> will not only add the correct JavaScript to the page, but also construct the markup for you. The second argument passed through here is the video URL, but you can pass the <a href='http://flowplayer.org/documentation/configuration.html'>configuration options</a> instead as seen below.") . '</p>';

      // Construct the video and output it using theme('flowplayer').
      $output .= theme('flowplayer', 'http://e1h13.simplecdn.net/flowplayer/flowplayer.flv');

      // The second parameter can either be the video URL or configuration options from:
      //   http://flowplayer.org/documentation/configuration.html

      /**
       * Flowplayer Add
       */
      $output .= '<h3>' . t('Flowplayer Add') . '</h3>';
      $output .= '<p>' . t("The <code>flowplayer_add()</code> function will add the Flowplayer JavaScript to the page, as well as register the Drupal JavaScript behaviors to load the Flowplayer appropriately. The first argument is the jQuery selector to apply the Flowplayer element to. The second argument is the <a href='http://flowplayer.org/documentation/configuration.html'>configuration options</a>. Using <code>flowplayer_add</code> requires you to already have the markup created.") . '</p>';

      // Construct the video markup first.
      $output .= '<a href="http://e1h13.simplecdn.net/flowplayer/flowplayer.flv" id="player" class="flowplayer"></a>';

      // Now add the required JavaScript using some configuration options (http://flowplayer.org/documentation/configuration.html).
      flowplayer_add('#player', array(
        'clip' => array(
          'autoPlay' => FALSE,
          'linkUrl' => 'http://flowplayer.org',
        ),
      ));

      /**
       * Audio
       */
      $output .= '<h3>' . t('Audio Plugin') . '</h3>';
      $output .= theme('flowplayer', array(
        'playlist' => array(
          array(
            'url' => 'http://flowplayer.org/img/demos/national.jpg',
          ),
          array(
            'url' => 'http://flowplayer.org/demos/plugins/fake_empire.mp3',
            'autoPlay' => FALSE,
          ),
        ),
      ), 'audio', array(
        'style' => 'width:300px; height: 243px;',
      ));
      return $output;
      break;
  }
}