diff --git a/flowplayer3/swftools_flowplayer3.admin.inc b/flowplayer3/swftools_flowplayer3.admin.inc index c4ced31..91459ce 100644 --- a/flowplayer3/swftools_flowplayer3.admin.inc +++ b/flowplayer3/swftools_flowplayer3.admin.inc @@ -89,6 +89,15 @@ function swftools_flowplayer3_admin_settings() { '#autocomplete_path' => 'admin/settings/swftools/flowplayer3/autocomplete', ); + $form['swftools_flowplayer3_files']['swftools_flowplayer3_ipad_javascript'] = array( + '#type' => 'textfield', + '#default_value' => variable_get('swftools_flowplayer3_ipad_javascript', SWFTOOLS_FLOWPLAYER3_IPAD_JAVASCRIPT), + '#title' => t('iPad script'), + '#description' => t('The path to the FlowPlayer3 iPad script which is used to enable iPad support.'), + '#size' => 50, + '#autocomplete_path' => 'admin/settings/swftools/flowplayer3/autocomplete', + ); + $form['swftools_flowplayer3_files']['swftools_flowplayer3_product_key'] = array( '#type' => 'textfield', '#default_value' => variable_get('swftools_flowplayer3_product_key', ''), @@ -140,6 +149,17 @@ function swftools_flowplayer3_admin_settings() { ); + $form['swftools_flowplayer3_embedding']['swftools_flowplayer3_ipad'] = array( + '#type' => 'radios', + '#options' => array( + 0 => t('Disabled'), + 1 => t('Enabled'), + ), + '#default_value' => variable_get('swftools_flowplayer3_ipad', 0), + '#title' => t('Enable iPad support'), + '#description' => t('When enabled Flowplayers will have iPad support.'), + ); + // Add custom form handler to flush cache upon submit $form['#submit'][] = 'swftools_admin_settings_submit'; diff --git a/flowplayer3/swftools_flowplayer3.module b/flowplayer3/swftools_flowplayer3.module index e808486..6048186 100644 --- a/flowplayer3/swftools_flowplayer3.module +++ b/flowplayer3/swftools_flowplayer3.module @@ -25,6 +25,10 @@ define('SWFTOOLS_FLOWPLAYER3_JAVASCRIPT', 'example/flowplayer-3.2.6.min.js'); */ define('SWFTOOLS_FLOWPLAYER3_SCROLLABLE_JAVASCRIPT', 'scrollable.min.js'); +/** + * The default name of the FlowPlayer3 JavaScript ipad file. + */ +define('SWFTOOLS_FLOWPLAYER3_IPAD_JAVASCRIPT', 'flowplayer.ipad-3.2.1.min.js'); /** * Implementation of hook_swftools_methods(). @@ -572,6 +576,12 @@ function theme_swftools_flowplayer3($file, $data, $script_location = SWFTOOLS_JA // Rather than add each script separately with drupal_add_js build an array and then collapse it and add once $script = array(); + // Add variable for special plugins JavaScript to be attached to the end of the FlowPlayer function call + $plugins = ''; + if (variable_get('swftools_flowplayer3_ipad', 0)) { + $plugins = '.ipad()'; + } + // Provision ready for later to add some JavaScript immediately after Flowplayer embedding $post_js = ''; @@ -582,6 +592,7 @@ function theme_swftools_flowplayer3($file, $data, $script_location = SWFTOOLS_JA '!id' => $data['othervars']['id'], '!url' => $parameters, '!config' => $config, + '!plugins' => $plugins, '!post_js' => $post_js, )); @@ -671,6 +682,11 @@ function swftools_flowplayer3_add_js() { drupal_add_js($library . '/' . variable_get('swftools_flowplayer3_scrollable_javascript', SWFTOOLS_FLOWPLAYER3_SCROLLABLE_JAVASCRIPT)); } + // Add flowplayer3 ipad script if feature is enabled + if (variable_get('swftools_flowplayer3_ipad', 0)) { + drupal_add_js($library . '/' . variable_get('swftools_flowplayer3_ipad_javascript', SWFTOOLS_FLOWPLAYER3_IPAD_JAVASCRIPT)); + } + } }