- Broke out creating the video UI into a method.

- Bank on the video UI having sane width/height. 


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@697 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2008-11-12 05:26:58 +00:00
parent e4dd02746c
commit f5e900eedd
2 changed files with 22 additions and 5 deletions
+12 -5
View File
@@ -64,6 +64,7 @@ import com.threerings.util.Util;
import com.threerings.flash.video.FlvVideoPlayer;
import com.threerings.flash.video.SimpleVideoDisplay;
import com.threerings.flash.video.VideoPlayer;
import com.threerings.flash.video.VideoPlayerCodes;
/**
@@ -250,12 +251,18 @@ public class MediaContainer extends Sprite
protected function setupVideo (url :String) :void
{
var player :FlvVideoPlayer = new FlvVideoPlayer();
var vid :SimpleVideoDisplay = new SimpleVideoDisplay(player);
// vid.addEventListener(VideoPlayerCodes.SIZE, handleVideoSizeKnown);
_media = vid;
addChildAt(vid, 0);
_media = createVideoUI(player);
addChildAt(_media, 0);
player.load(url);
updateContentDimensions(SimpleVideoDisplay.NATIVE_WIDTH, SimpleVideoDisplay.NATIVE_HEIGHT);
updateContentDimensions(_media.width, _media.height);
}
/**
* Create the actual display for the VideoPlayer.
*/
protected function createVideoUI (player :VideoPlayer) :DisplayObject
{
return new SimpleVideoDisplay(player);
}
/**
@@ -103,6 +103,16 @@ public class SimpleVideoDisplay extends Sprite
_knob.addEventListener(MouseEvent.MOUSE_DOWN, handleKnobDown);
}
override public function get width () :Number
{
return NATIVE_WIDTH;
}
override public function get height () :Number
{
return NATIVE_HEIGHT;
}
/**
* Stop playing our video.
*/