I experienced this problem on my old website under Drupal 5 over a year ago and after bringing it up, a patch was created, solving the problem. Now on a new website under Drupal 6, I'm using the new Video module and for some reason it seems that this fix was never incorporated into the actual release. So, I can't have different sized videos on my site. Either I set the default width and have every video on my site the same size or I leave it blank and try to use one of the preset resolutions (why are they even there if this doesn't work?) and my video doesn't show up at all. This is the original issue: http://drupal.org/node/231790

Could this be fixed on the Drupal 6 Video module as well?

Comments

glen201’s picture

There was a HUGE list of patches that never made it into D6 and I thought I had tackled them all when I started co-maintaining this module a few weeks ago.

So, this is an issue for what? Uploading a video and converting to Flash with ffmpeg or simply playing back an uploaded file and managing the physical display size of the plugin? Or both?

-- glen

roryt2000’s picture

Playing back a file (I'm using flash video, in particular) and changing the size of the player for specific videos. In settings, there are two size presets for 16:9 and 4:3 and a default width for all videos. Normally I'd be able to leave the default size blank and pick one of the other video sizes, however if I leave the default blank, the video doesn't show up on the page at all. The only way to have a video show up is to have a default size set, which ignores the other size presets and makes every video on my site the same size.

All I want to be able to do is leave the default width blank and use one of my own custom preset sizes or a manual size for each different video.

roryt2000’s picture

So, can anyone help me out with this?

glen201’s picture

@roryt2000

If you want to hard-code a manual size, you can do a quick-and-dirty edit of includes/common.inc and mess with the embed code directly until I can get to porting this old patch to Video.

It's around line 79.

--glen

mawiebe’s picture

The issue appears to be that when the default width field is blanked (under /admin/settings/video), the perfectly valid integer 0 gets saved and used. A width of 0 results in the video not being displayed. This fix may not be in the correct location, but it worked for me in video.module:

/**
* Scale a video to match the desired width
*/
function _video_scale_video(&$node) {
$def_width = (int) variable_get("video_resolution_width", 400);

// my change, which uses the preset width value if it exists and the default is 0 (or less)
if( $def_width <= 0 && $node->videox )
$def_width = $node->videox;
// the rest of the code hasn't changed

if (!$node->videox || !$node->videoy) {
$height = $def_width * 3 / 4;
} else {
$height = $def_width * ($node->videoy / $node->videox); // do you remember proportions?? :-)
}

$height = round($height);
// add one if odd
if($height % 2) {
$height++;
}

$node->video_scaled_x = $def_width;
$node->video_scaled_y = $height;
}

iLLin’s picture

Status: Active » Closed (fixed)