schneidafunk
July 30th, 2007, 05:08 PM
Hi All,
This is my first post and I actually joined this site just to talk about this problem. What I want is to load dynamic movies and check for the dimensions of the video. If the video is in widescreen format, I want to move the movie into the center of the flash player.
Here's a better example, let's say I create a flash video player from the flvplayback component and lock the dimensions of the player so the movie has to play inside a 400x300 window. The video player toolbar (play button, volume control, etc) is about 45 pixels high, so the actual stage is 400x345.
Now when I load a movie dynamically that has an aspect ratio of 4:3 (standard ratio for video) the video gets resized and everything looks fine. However, if I load a widescreen video, the video player toolbar automatically attaches to the bottom of the video. Instead of it being centered vertically with a black border. So let's say we have a widescreen video that is 400x200, I can't seem to figure out how to add a black bar between the video player toolbar and the video itself.
I've attached to images to show what I mean. The first shows what I want it to look like, the second image shows what's happening.
--
The solution I think is to check the height of the dynamically loaded movie and then compare it to the stage height.
What I thought would work would be something like this (forgive syntax errors, just presenting the logic):
if (myflvvideo.height < (Stage.height - 45)) // 45 represents the toolbar
{
myflvvideo._y = ((Stage.height - 45) - myflvvideo.height) / 2;
}
However, the above doesn't work right... I can't seem to get the dimensions of a dynamically loaded video and I also can't seem to separate the video toolbar from the video itself. Any help would be greatly appreciated... I've spent dozens of hours trying to figure this sucker out.
This is my first post and I actually joined this site just to talk about this problem. What I want is to load dynamic movies and check for the dimensions of the video. If the video is in widescreen format, I want to move the movie into the center of the flash player.
Here's a better example, let's say I create a flash video player from the flvplayback component and lock the dimensions of the player so the movie has to play inside a 400x300 window. The video player toolbar (play button, volume control, etc) is about 45 pixels high, so the actual stage is 400x345.
Now when I load a movie dynamically that has an aspect ratio of 4:3 (standard ratio for video) the video gets resized and everything looks fine. However, if I load a widescreen video, the video player toolbar automatically attaches to the bottom of the video. Instead of it being centered vertically with a black border. So let's say we have a widescreen video that is 400x200, I can't seem to figure out how to add a black bar between the video player toolbar and the video itself.
I've attached to images to show what I mean. The first shows what I want it to look like, the second image shows what's happening.
--
The solution I think is to check the height of the dynamically loaded movie and then compare it to the stage height.
What I thought would work would be something like this (forgive syntax errors, just presenting the logic):
if (myflvvideo.height < (Stage.height - 45)) // 45 represents the toolbar
{
myflvvideo._y = ((Stage.height - 45) - myflvvideo.height) / 2;
}
However, the above doesn't work right... I can't seem to get the dimensions of a dynamically loaded video and I also can't seem to separate the video toolbar from the video itself. Any help would be greatly appreciated... I've spent dozens of hours trying to figure this sucker out.