From 758d1ccce5c6f32f81a34da4a05114938ee56609 Mon Sep 17 00:00:00 2001 From: Fabio Varesano Date: Tue, 4 Apr 2006 06:22:22 +0000 Subject: Patch #57210 by benthere - Allow explicit YouTube width/height Now youtube videos are rendered using video size specified on the video node creation form. Before all video nodes of type youtube were rendered as 425x350. 425x350 is the default if video size valuse are empty. Added better tests to _video_get_parameters() to chech that $serial_data['object_parameters'] is a good array to be used with foreach --- video.module | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/video.module b/video.module index 2ae0b98..ca58953 100644 --- a/video.module +++ b/video.module @@ -447,8 +447,8 @@ function video_nodeapi($node, $op, $arg) { return array(array('key' => 'enclosure', 'attributes' => $attributes), array('key' => 'media', 'value' => '', 'attributes' => $media)); } case 'revision delete': - db_query('DELETE FROM {video} WHERE vid = %d', $node->vid); - break; + db_query('DELETE FROM {video} WHERE vid = %d', $node->vid); + break; } } @@ -1270,9 +1270,11 @@ function theme_video_play_windowsmedia($node) { * string of content to display */ function theme_video_play_youtube($node) { - $output = ' + $width = ($node->videox ? $node->videox : '425'); + $height = ($node->videoy ? $node->videoy : '350'); + $output = ' - + '; $output = _theme_video_format_play($output, t('http://www.youtube.com/help.php'), t('Link to youtube.com'), t('youtube.com')); return theme('page', $output); @@ -1708,7 +1710,7 @@ function _video_get_mime_type($node) { */ function _video_get_parameters($serialized_data) { $serial_data = unserialize($serialized_data); - if(is_array($serial_data)) { + if(is_array($serial_data) && array_key_exists($serial_data['object_parameters']) && !empty($serial_data['object_parameters'])) { $output = ''; foreach ($serial_data['object_parameters'] as $param => $value) { $output .= "\n"; -- cgit v1.2.3