aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Varesano <fax8@13637.no-reply.drupal.org>2006-04-04 06:22:22 +0000
committerFabio Varesano <fax8@13637.no-reply.drupal.org>2006-04-04 06:22:22 +0000
commit758d1ccce5c6f32f81a34da4a05114938ee56609 (patch)
tree29754d8ed973e7a2cd202ba1c4d66349eabf2686
parentbcb660107dd2a1963bc65a95082ad756392cad15 (diff)
downloadvideo-758d1ccce5c6f32f81a34da4a05114938ee56609.tar.gz
video-758d1ccce5c6f32f81a34da4a05114938ee56609.tar.bz2
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
-rw-r--r--video.module12
1 files 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 = '<object width="425" height="350">
+ $width = ($node->videox ? $node->videox : '425');
+ $height = ($node->videoy ? $node->videoy : '350');
+ $output = '<object width="'.$width.'" height="'.$height.'">
<param name="movie" value="http://www.youtube.com/v/' . $node->vidfile . '"></param>
- <embed src="http://www.youtube.com/v/' . $node->vidfile . '" type="application/x-shockwave-flash" width="425" height="350"></embed>
+ <embed src="http://www.youtube.com/v/' . $node->vidfile . '" type="application/x-shockwave-flash" width="'.$width.'" height="'.$height.'"></embed>
</object>';
$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 .= "<param name=\"$param\" value=\"$value\" />\n";