0 Replies Latest reply on Dec 30, 2009 2:28 PM by willm8655

    Chromeless Youtube player help needed.

    willm8655 Level 1

      Hi, i've been trying to get the youtube chromeless player to work for the last day now, but am not being successful.


      I've been trying to use the example code located here: http://code.google.com/apis/youtube/flash_api_reference.html


      So my source file looks like this:



      <?xml version="1.0" encoding="utf-8"?>






      xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">





      // This will hold the API player instance once it is initialized.


      var player:Object;



      var loader:Loader = new Loader();

      loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);


      new URLRequest("http://www.youtube.com/apiplayer?version=3"));



      function onLoaderInit(event:Event):void {



      "onReady", onPlayerReady);


      "onError", onPlayerError);


      "onStateChange", onPlayerStateChange);







      function onPlayerReady(event:Event):void {


      // Event.data contains the event parameter, which is the Player API ID


      trace("player ready:", Object(event).data);



      // Once this event has been dispatched by the player, we can use


      // cueVideoById, loadVideoById, cueVideoByUrl and loadVideoByUrl


      // to load a particular YouTube video.

      player = loader.content;




      function onPlayerError(event:Event):void {


      // Event.data contains the event parameter, which is the error code


      trace("player error:", Object(event).data);




      function onPlayerStateChange(event:Event):void {


      // Event.data contains the event parameter, which is the new player state


      trace("player state:", Object(event).data);




      function onVideoPlaybackQualityChange(event:Event):void {


      // Event.data contains the event parameter, which is the new video quality


      trace("video quality:", Object(event).data);










      However i get the error: "Access of undefined property loader." although it is defined in the line above?


      Has anyone had any success getting the chromeless player working?


      Any help would be much appreciated.