465 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+5 more
uiuxaesthetics says

Anyone work with the chromeless player of the youtube api yet? Here is my code that is working.


//------Security Settings----//
import flash.system.Security;
Security.allowDomain("i.ytimg.com");
Security.allowDomain("s.ytimg.com");
Security.allowDomain("youtube.com");
Security.allowDomain("www.youtube.com");
Security.allowDomain("s2.youtube.com");

var youTubeLoader:Loader;
var youTubePlayer:Object;

function loadYouTubeVideo():void{
    if(youTubeVideoLoaded){
        youTubePlayer.destroy();
        youTubeLoader = null;
        youTubePlayer = null;
        youTubeVideoLoaded = false;
        youTubeVideoHolder.removeChildAt(0);
    }
    youTubeLoader = new Loader();
    youTubeLoader.contentLoaderInfo.addEventListener(Event.INIT, initializeYouTubeVideo);
    youTubeLoader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
}

function initializeYouTubeVideo(e:Event):void {
    youTubeLoader.contentLoaderInfo.removeEventListener(Event.INIT, initializeYouTubeVideo);
    youTubeVideoHolder.addChild(youTubeLoader);
    youTubeLoader.content.addEventListener("onReady", youTubeReady);
}

function youTubeReady(event:Event):void {
    youTubeLoader.content.removeEventListener("onReady", youTubeReady);
    youTubePlayer = new Object();
    youTubePlayer = youTubeLoader.content;
    youTubePlayer.loadVideoById(youTubeVideoId,0,youTubeVideoQuality);
    youTubePlayer.setSize(StageWidth, StageHeight);
}

I have searched google high and low and cannot find anywhere, why I am getting these errors when I test inside flash IDE , I don’t get them in the debug player only locally with Flash IDE .

Error opening URL 'http://www.youtube.com/get_video?noflv=1&asv=3&video_id=0UjsXo9l6I8&eurl=file%3A%2F%2F%2FC%7C%2FUsers%2FCP%2FDesktop%2FFAITHFUL%255FFINAL%2FbackgroundModule.swf&t=vjVQa1PpcFNMO9tM2sNKMLRPGatkQrywPI8YYRh8XTo=&ps=chromeless&fmt=34&el=embedded&splay=1'
Error opening URL 'http://video-stats.video.google.com/s?fs=0&fv=WIN%209%2C0%2C115%2C0&len=281.156&ps=chromeless&scoville=1&bt=0.613&ns=yt&w=1024&fexp=903709,907021&vid=zK9GBESMYY1N3UKcrdQv6qAhHrmnPfCFC&h=589&bc=260204&playerh=948&plid=AASNabXL_syqg1YR&hbd=4352260&el=embedded&eurl=file%3A%2F%2F%2FC%7C%2FUsers%2FCP%2FDesktop%2FFAITHFUL%255FFINAL%2FbackgroundModule.swf&splay=1&hl=en&rt=1.072&st=0.042&fmt=34&hbt=7.765&et=0.042&docid=0UjsXo9l6I8&screenh=1050&sd=BADC208C7HH1281385068213679&md=1&bd=256960&cfps=0&playerw=1024&screenw=1680'
Error opening URL 'http://s2.youtube.com/s?ctp=1&docid=0UjsXo9l6I8&yttk=1&ns=yt&fmt=34&vid=zK9GBESMYY1N3UKcrdQv6qAhHrmnPfCFC&et=0.395&plid=AASNabXL_syqg1YR&asv=3&st=0.395&el=embedded&ps=chromeless'
2580 posts Put a Donk On It
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+10 more
ThemeProvince says

You only need: Security.allowDomain(“www.youtube.com”) for it too work.

465 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+5 more
uiuxaesthetics says

true but that doesn’t fix those errors??

2580 posts Put a Donk On It
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+10 more
ThemeProvince says
true but that doesn’t fix those errors??

Nah but I have built a youtube class and I only needed that one statement.

465 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+5 more
uiuxaesthetics says

Have you ever got those errors I posted above, when building your class?

2580 posts Put a Donk On It
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+10 more
ThemeProvince says
Have you ever got those errors I posted above, when building your class?

never Error Opening URL Error.

Just a few sandbox violations that didn’t affect it.

1552 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 100+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+3 more
dSKY says

I have worked with official AS3 API from youtube , and I’ve never got those errors.
If I find the file, I could send it to you…

3256 posts
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
ParkerAndKent says

Is the youTubeVideoId defined in the right way?

465 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+5 more
uiuxaesthetics says

@dSKY that would be awesome ..hitting my head against the wall on this one.

@p&K I think so, its a string variable read from XML
<youtubevideoid>0UjsXo9l6I8</youtubevideoid>
& the video plays fine, it is just the youtube api apparently is trying to access those other URL ’s and the flash IDE doesn’t like it
723 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+4 more
BigZ says

How is the unloading with the AS3 API ? I remember having huge problems with the unloading of the AS2 player.

by
by
by
by
by
by