aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Varesano <fax8@13637.no-reply.drupal.org>2006-07-16 09:26:00 +0000
committerFabio Varesano <fax8@13637.no-reply.drupal.org>2006-07-16 09:26:00 +0000
commit7fbe1c94c6f4bd20f44e3c09db1416995c1dc2c5 (patch)
tree42c63e21b400d662fb3c03063f5351ef1820be73
parent669795d5a4522c6d7826b8f91946d4e4910baf6b (diff)
downloadvideo-7fbe1c94c6f4bd20f44e3c09db1416995c1dc2c5.tar.gz
video-7fbe1c94c6f4bd20f44e3c09db1416995c1dc2c5.tar.bz2
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.
-rw-r--r--FILE_TYPES.txt10
-rw-r--r--video.module68
2 files changed, 77 insertions, 1 deletions
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':
@@ -1160,6 +1169,61 @@ codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
}
/**
+ * 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 = '
+ <!--[if !IE]>-->
+ <object classid="java:com.fluendo.player.Cortado.class"
+ type="application/x-java-applet"
+ archive="' . $cortado_location . '"
+ width="' . $width . '" height="' . $height . '" >
+ <!--<![endif]-->
+ <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
+ codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab"
+ width="' . $width . '" height="' . $height . '" >
+ <param name="code" value="com.fluendo.player.Cortado" />
+ <!--[if !IE]>-->
+ </object>
+ <!--<![endif]-->
+ <!-- IE and Konqueror browser need the archive param -->
+ <param name="archive" value="' . $cortado_location . '" />
+ <param name="url" value="' . $url . '"/>
+ <param name="local" value="false" />
+ <param name="keepaspect" value="true" />
+ <param name="video" value="true" />
+ <param name="audio" value="true" />
+ <param name="seekable" value="true" />
+ <param name="duration" value="' . $node->playtime_seconds . '" />
+ <param name="bufferSize" value="200" />
+ <strong>
+ This browser does not have a Java Plug-in.<br />
+ <a href="http://java.com/download/">
+ Get the latest Java Plug-in here.
+ </a>
+ </strong>
+ </object>
+ ';
+
+ $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
*
* @param $url
@@ -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;