aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Varesano <fax8@13637.no-reply.drupal.org>2006-12-14 20:31:40 +0000
committerFabio Varesano <fax8@13637.no-reply.drupal.org>2006-12-14 20:31:40 +0000
commitaf271c24cd081cba84fc0804b6608c09f23c21e5 (patch)
tree7381dc13a54b1311d71832e07975f02b8024fc68
parent245c16fb76a8192987158a072d9fee88cffc1bad (diff)
downloadvideo-af271c24cd081cba84fc0804b6608c09f23c21e5.tar.gz
video-af271c24cd081cba84fc0804b6608c09f23c21e5.tar.bz2
Patch #91774 by Glauco (http://drupal.org/user/96649):
Add support for .divx files
-rw-r--r--video.module39
1 files changed, 38 insertions, 1 deletions
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':
@@ -950,6 +952,39 @@ codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#vers
}
/**
+ * 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 = '<!-- [if IE] -->
+<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="'.$node->videox.'" height="'.$height.'" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
+<!--> <![endif]-->'. "\n";
+ // this will be executed by not Internet Explorer browsers
+ $output = '<!-- [if !IE] -->
+<object type="video/divx" data="'.$url.'" width="'.$node->videox.'" height="'.$height.'" mode="zero">
+<!--> <![endif]-->'."\n";
+
+ $output .= '<param name="src" value="'.$url.'"/>'."\n";
+ $output .= '<param name="mode" value="zero"/>'."\n";
+ $output .= '</object>';
+ $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
*
* @see http://developer.apple.com/internet/ieembedprep.html
@@ -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':