Advertisement
Guest User

tu

a guest
Apr 11th, 2013
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. I am trying to use youtube video inside adobe flex. I have added the video to the canvas but i cannot fix the size of the video. It is also render in full width and height. Below is my code.
  2.  
  3. <mx:Canvas width="380" height="250" id="uplayer" />
  4.  
  5. public function init(){
  6. _uic = UIComponent(uplayer.addChild (new UIComponent ()));
  7. _uic.width = 380;
  8. _uic.width = 250;
  9.  
  10. _loader = new Loader();
  11. _loader.contentLoaderInfo.addEventListener(Event.INIT, onLoadInit);
  12. var request:URLRequest = new URLRequest("http://www.youtube.com/v/2030agUM_JY?version=2&autoplay=1&fs=0&hd=1");
  13. _loader.load(request);
  14. }
  15.  
  16. private function onLoadInit(event:Event):void {
  17. _player = _loader.content;
  18.  
  19. _playerObject = _player as DisplayObject;
  20.  
  21. //_playerObject.addEventListener("jwplayerReady", onPlayerReady);
  22.  
  23. // RootReference.root = _playerObject.root;
  24.  
  25. _uic.addChild(_loader);
  26. _uic.width = 380;
  27. _uic.width = 250;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement