Automatically scaling video window size
| Project: | jQuery Media |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Hi Aaron,
Can you help us set a course for scaling/cropping of video windows during playback? Some folks had seen the screencast and asked these questions, too.
I think I can only set one video size within jQuery Media's config settings, so when I upload two differently sized MP4 video files (a 640w and a 320w, for example) only one of them will be played properly. Am I right?
I haven't used any of the swf players, my only experience is with MOV and MP4 files, so I might also be missing a whole element of the module.
So what do you think? Is there a way to dynamically read the video dimensions and play them back in the right size? Or scale any video file to play back in the dimensions I config in jQuery Media? Or require the video files dimensions fit into specific parameters at the time of upload?
Thanks for the insight.

#1
this IS possible and easy for example with the parameters you can send to the JW FLV Player, but yeah, i'd like to see a general solution to this as well, especially one that works with QuickTime.
#2
> So what do you think? Is there a way to dynamically read the video dimensions and play them back in the right size?
I think that's the problem - unlike images without given height and width (which are then just displayed at their original size after the image has downloaded to the cache), browsers can't tell what the original size of the video is. I think the Jquerymedia module defaults to 400x400 if no size is specified anywhere.
The way to deal with that is to give a global value in the admin section such as 600x400 to cover most of your videos.
And to specify the size of 'non-standard' videos in the link in the content:
<a class="media {width:400, height:300}" href='/path/to/video.swf'>This is a video</a>If you're using a wysiwyg editor, there should be a tab in the 'insert link' section for css class. I'm *hoping* if you type 'media {width:400, height:300}' into that field, that the bracketed stuff makes it into the source ok without being corrupted or stripped out. I still need to test this. Otherwise, there would be no way to specify size in a wysiwyg editor without switching to source mode.
By the way, there is some good documentation here that you might have missed:
http://www.malsup.com/jquery/media/
#3
This may be useful to people reading this thread..
I modified the jquery.media.js file. Setting the scale parameters for quicktime object make sure, that the quicktime embed/object always scales the video..
After line 140 and 143 I added this :
,scale: 'aspect'
the whole segment looks like this :
quicktime: {name: 'quicktime',
types: 'aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3gp',
oAttrs: {
classid: 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
codebase: 'http://www.apple.com/qtactivex/qtplugin.cab',
scale: 'aspect'
},
eAttrs: {
pluginspage: 'http://www.apple.com/quicktime/download/',
scale: 'aspect'
}
Maybe this should be configurable from the jquery media module?