From af271c24cd081cba84fc0804b6608c09f23c21e5 Mon Sep 17 00:00:00 2001 From: Fabio Varesano Date: Thu, 14 Dec 2006 20:31:40 +0000 Subject: Patch #91774 by Glauco (http://drupal.org/user/96649): Add support for .divx files --- video.module | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/video.module b/video.module index c3c998c..b2bbbb8 100644 --- a/video.module +++ b/video.module @@ -393,7 +393,6 @@ function video_nodeapi($node, $op, $arg) { function video_form($node) { //We must unserialize the array for display in the forms. $node->serial_data = unserialize($node->serialized_data); - $form = array(); $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#size' => 60, '#maxlength' => 128, '#required' => TRUE, @@ -790,7 +789,10 @@ function video_play() { if (variable_get('video_playcounter', 1)) { db_query("UPDATE {video} SET play_counter = play_counter + 1 where vid = %d", $node->vid); //Increment play counter. } + switch (_video_get_filetype($node->vidfile)) { + case 'divx': + return theme('video_play_divx', $node); case 'mov': case 'mp4': case '3gp': @@ -949,6 +951,39 @@ codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#vers return $output; } +/** + * Play videos from in DivX format + * + * @see http://developer.apple.com/internet/ieembedprep.html + * @param $node + * object with node information + * + * @return + * string of content to display + */ +function theme_video_play_divx($node) { + //Increase the height to accommodate the player controls on the bottom. + $height = $node->videoy + 20; + + $url = _video_get_fileurl($node->vidfile); + + $output = ' + + '. "\n"; + // this will be executed by not Internet Explorer browsers + $output = ' + + '."\n"; + + $output .= ''."\n"; + $output .= ''."\n"; + $output .= ''; + $output = _theme_video_format_play($output,t('http://www.divx.com/divx/webplayer/'), + t('Link to DivX Download Page'), + t('Download latest DivX Web Player')); + return $output; +} + /** * Play videos from in Quicktime format * @@ -1449,6 +1484,8 @@ function _video_get_mime_type($node) { switch (_video_get_filetype($node->vidfile)) { case 'mov': return 'video/quicktime'; + case 'divx': + return 'video/vnd.divx'; case 'rm': return 'application/vnd.rn-realmedia'; case 'flv': -- cgit v1.2.3