From 7fbe1c94c6f4bd20f44e3c09db1416995c1dc2c5 Mon Sep 17 00:00:00 2001 From: Fabio Varesano Date: Sun, 16 Jul 2006 09:26:00 +0000 Subject: Patch #70668 comment #4 by bot (http://drupal.org/user/56659): Support for Ogg Theora Files: Added support for Ogg Theora video files. Users can now use the cortado java applet video player to play ogg theora videos. --- FILE_TYPES.txt | 10 +++++++++ video.module | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/FILE_TYPES.txt b/FILE_TYPES.txt index 07d5513..e928e01 100644 --- a/FILE_TYPES.txt +++ b/FILE_TYPES.txt @@ -41,3 +41,13 @@ Google Video support called "FlowPlayer.swf" or "Player.swf" into your Drupal folder. Then set the Flash player file name to use on the Flash settings in video module configuration page. +.ogg + Ogg Theora videos, video.module uses the java applet cortado to display Ogg Theora files, + you can find the latest version of cortado at http://www.flumotion.net//jar/cortado/ + get http://www.flumotion.net//jar/cortado/cortado-ovt-stripped-0.2.0.jar + and put it into your Drupal folder as cortado.jar + [ + NOTE, at the time of writing, cortado.jar had a bug that caused it to fail with drupal. + you can get a patched version of cortado.jar that works from http://v2v.cc/~j/cortado.jar + and the bug related to this issue: https://core.fluendo.com/flumotion/trac/ticket/387 + ] \ No newline at end of file diff --git a/video.module b/video.module index c92af7b..ff65486 100644 --- a/video.module +++ b/video.module @@ -238,6 +238,8 @@ function video_perm() { * string of form content or error message */ function video_settings() { + global $base_url; + //Must have "administer site configuration" and "administer video" privilages. if (!user_access('administer video')) { drupal_access_denied(); @@ -265,7 +267,12 @@ function video_settings() { '#title' => t('Filename of Flash loader'), '#default_value' => variable_get('video_flvplayerloader', 'Player.swf'), '#description' => t('The name of the Shockwave file that manages loading the FLV movie.')); - + $form['ogg'] = array('#type' => 'fieldset', '#title' => t('Ogg Theora settings')); + $form['ogg']['video_cortado'] = array( + '#type' => 'textfield', + '#title' => t('Filename of Cortado Java Applet'), + '#default_value' => variable_get('video_cortado', $base_url . '/cortado.jar'), + '#description' => t('The path to the Cortado Applet to play Ogg Theora Files.')); $form['menu'] = array('#type' => 'fieldset', '#title' => t('Items to display in the node menu'), '#weight' => -5, '#collapsible' => TRUE, '#collapsed' => TRUE); $form['menu']['video_displayplaylink'] = array( '#type' => 'radios', @@ -784,6 +791,8 @@ function video_play() { return theme('video_play_dcr', $node); case 'wmv': return theme('video_play_windowsmedia', $node); + case 'ogg': + return theme('video_play_ogg_theora', $node); case 'youtube': return theme('video_play_youtube', $node); case 'googlevideo': @@ -1159,6 +1168,61 @@ codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve return $output; } +/** + * Play Ogg Theora videos with Cortado Applet + * + * @param $node + * object with node information + * + * @return + * string of content to display + */ +function theme_video_play_ogg_theora($node) { + global $base_url; + $cortado_location = variable_get('video_cortado', $base_url . '/cortado.jar'); + $url = _video_get_fileurl($node->vidfile); + + $width = ($node->videox ? $node->videox : '425'); + $height = ($node->videoy ? $node->videoy : '350'); + + $output = ' + + + + + + + + + + + + + + + + + + + + This browser does not have a Java Plug-in.
+ + Get the latest Java Plug-in here. + +
+
+ '; + + $output = _theme_video_format_play($output, + t('http://java.com/download/'), t('Link to java.com'), t('Download Java')); + return $output; +} + /** * Cut down on redundant link text * @@ -1384,6 +1448,8 @@ function _video_get_mime_type($node) { case 'youtube': case 'googlevideo': return false; + case 'ogg': + return 'application/ogg'; default: // We couldn't detect the mime-type, so return false. return false; -- cgit v1.2.3