我正在尝试在 adobe flex 中使用 youtube 视频。我已将视频添加到画布,但我无法修复视频的大小。它也以全宽和全高呈现。下面是我的代码。
pastebin 上的代码http://pastebin.com/hN3NHRpp
<mx:Canvas width="380" height="250" id="uplayer" />
public function init(){
_uic = UIComponent(uplayer.addChild (new UIComponent ()));
_uic.width = 380;
_uic.width = 250;
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.INIT, onLoadInit);
var request:URLRequest = new URLRequest("http://www.youtube.com/v/2030agUM_JY?version=2&autoplay=1&fs=0&hd=1");
_loader.load(request);
}
private function onLoadInit(event:Event):void {
_player = _loader.content;
_playerObject = _player as DisplayObject;
//_playerObject.addEventListener("jwplayerReady", onPlayerReady);
// RootReference.root = _playerObject.root;
_uic.addChild(_loader);
_uic.width = 380;
_uic.width = 250;
}