trace("SET VIDEO SIZE CALLED ==-================");
vOff = 0;
hOff = 0;
viewAspect = 1.3333333333333333;
ht = myVideoPlayer.metadata.height;
wd = myVideoPlayer.metadata.width;
if(wd > ht)
{
ratio = 320 / wd;
vidAspect = ht / wd;
vidWidth = wd * ratio;
vidHeight = vidWidth * vidAspect;
vOff = (240 - vidHeight) / 2;
if(vidHeight > 240)
{
ratio = 240 / ht;
vidHeight = ht * ratio;
vidWidth = wd * ratio;
vOff = 0;
hOff = (320 - vidWidth) / 2;
}
}
else
{
ratio = 240 / ht;
vidAspect = wd / ht;
vidWidth = 320 * vidAspect;
vidHeight = 240;
hOff = (320 - vidWidth) / 2;
}
trace("Scale Ratio: " + ratio + " Video Aspect: " + vidAspect);
myVideoPlayer._width = vidWidth;
myVideoPlayer._height = vidHeight;
myVideoPlayer._x = hOff;
myVideoPlayer._y = vOff;
trace(vOff + " " + hOff);
trace("Height is " + myVideoPlayer.metadata.height);
trace("Width is " + myVideoPlayer.metadata.width);
trace("Duration is " + myVideoPlayer.metadata.duration + " seconds");
videoSizeSet = true;
}
function setVideoLabels(num)
{
numVids = _root.videoResourceList.length;
p = 0;
while(p < selectorButtons.length)
{
selectorButtons[p]._visible = false;
p++;
}
i = 0;
while(i < _root.videoResourceList.length)
{
trace("setting video selector " + _root.videoResourceList[i]);
vidName = _root.videoResourceList[i];
vidName = vidName.slice(0,-4);
selectorButtons[i].vidName = vidName;
selectorButtons[i]._visible = true;
i++;
}
}
function setContentPath(path)
{
videoSizeSet = false;
trace("setting SMALL contentPath to:" + path + "|");
tPath = path;
myVideoPlayer.load(tPath);
trace("contentPath is now " + myVideoPlayer.contentPath);
myVideoPlayer.rewind();
myVideoPlayer.play();
}
stop();
var videoSizeSet = false;
var selectorButtons = Array(videoSelector.vidButton1,videoSelector.vidButton2,videoSelector.vidButton3,videoSelector.vidButton4,videoSelector.vidButton5,videoSelector.vidButton6,videoSelector.vidButton7,videoSelector.vidButton8,videoSelector.vidButton9);