<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using multiple AS2 YouTube Chromeless  players in AS3</title>
	<atom:link href="http://www.perkstoveland.com/archives/40/feed" rel="self" type="application/rss+xml" />
	<link>http://www.perkstoveland.com/archives/40</link>
	<description>This is my blog. Per Kristian Stoveland. I am a designer-turned-programmer, with a passion for creative coding.</description>
	<lastBuildDate>Sat, 13 Feb 2010 17:17:37 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Carlos</title>
		<link>http://www.perkstoveland.com/archives/40/comment-page-1#comment-138</link>
		<dc:creator>Carlos</dc:creator>
		<pubDate>Fri, 01 Jan 2010 02:54:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.perkstoveland.com/?p=40#comment-138</guid>
		<description>Update: I&#039;ve installed Parallels for mac on my machine, and installed Windows.

The windows debugger version of flash player 10 works fine. No crashes.

There&#039;s a definite mac problem here.

Also, I can&#039;t see my previous comment above on Firefox in Windows! But on Safari, I see it. So weird! I have cleared the caches of course.</description>
		<content:encoded><![CDATA[<p>Update: I&#8217;ve installed Parallels for mac on my machine, and installed Windows.</p>
<p>The windows debugger version of flash player 10 works fine. No crashes.</p>
<p>There&#8217;s a definite mac problem here.</p>
<p>Also, I can&#8217;t see my previous comment above on Firefox in Windows! But on Safari, I see it. So weird! I have cleared the caches of course.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos</title>
		<link>http://www.perkstoveland.com/archives/40/comment-page-1#comment-137</link>
		<dc:creator>Carlos</dc:creator>
		<pubDate>Fri, 01 Jan 2010 01:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.perkstoveland.com/?p=40#comment-137</guid>
		<description>Thanks for this great youtube wrapper! Allowing multiple youtube videos on stage is a god send.

I am experiencing my browser (flash plugin) crash hard. Every time I simply uncomment the lines

import com.perkstoveland.....Display

AND

player = new Display( WRAPPER_URL );

And debug the project, the browser crashes. (Both firefox and safari, OS X 10.6, Intel)

If I just run (not debug) everything works fine.

I&#039;m thinking it&#039;s something to do with local connection?

I&#039;ve even tried downgrading to flash player debugger version 9 from 10, but both versions crash hard.

Any insight?? Thanks!!</description>
		<content:encoded><![CDATA[<p>Thanks for this great youtube wrapper! Allowing multiple youtube videos on stage is a god send.</p>
<p>I am experiencing my browser (flash plugin) crash hard. Every time I simply uncomment the lines</p>
<p>import com.perkstoveland&#8230;..Display</p>
<p>AND</p>
<p>player = new Display( WRAPPER_URL );</p>
<p>And debug the project, the browser crashes. (Both firefox and safari, OS X 10.6, Intel)</p>
<p>If I just run (not debug) everything works fine.</p>
<p>I&#8217;m thinking it&#8217;s something to do with local connection?</p>
<p>I&#8217;ve even tried downgrading to flash player debugger version 9 from 10, but both versions crash hard.</p>
<p>Any insight?? Thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eli</title>
		<link>http://www.perkstoveland.com/archives/40/comment-page-1#comment-136</link>
		<dc:creator>eli</dc:creator>
		<pubDate>Sun, 13 Sep 2009 00:22:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.perkstoveland.com/?p=40#comment-136</guid>
		<description>okay.. issue somewhat solved.

Before creating a new Display(WRAPPER_URL)... you have to listen for the DisplayEvent.LOADED event..

It&#039;s not enough to just fire off an event for when the _wrapper loads (cause that just means that the youtubewrapper.swf loaded.. not that the apiplayer from www.youtube.com has loaded inside of it.

I felt like I&#039;d tried this in the past.. but I must have tried it in the wrong way.

Of course, this has led to new and more fun issues.. now.. it seems that if you try to call .loadVideoById() or even if you try to cue it.. set it up.. and then issue .playVideo()... the videos will always play.. but some of them will still show the triangular &quot;play&quot; graphic in the middle of the video..

Okay, so... solved that issue..

Here is the proper event flow:
1. create  myYouTube = new Display (WRAPPER_URL);
2. listen for DisplayEvent.LOADED
3. once LOADED, add listener for DisplayEvent.STATE_CUED that calls a playMyVideo() function.
4. do myYouTube.cueStartUpVideoById(&quot;vidID&quot;);
5. in playMyVideo, remove the STATE_CUED listener and issue the .playVideo()

This appears to work. ..the wrapper with the youtubeapi loads, cued video loads, then it plays.  Currently, I&#039;m testing by loading 3 videos.

Naturally, the code i&#039;m using is more complicated.. but this should help people get over the &quot;hump&quot; as it were..</description>
		<content:encoded><![CDATA[<p>okay.. issue somewhat solved.</p>
<p>Before creating a new Display(WRAPPER_URL)&#8230; you have to listen for the DisplayEvent.LOADED event..</p>
<p>It&#8217;s not enough to just fire off an event for when the _wrapper loads (cause that just means that the youtubewrapper.swf loaded.. not that the apiplayer from <a href="http://www.youtube.com" rel="nofollow">http://www.youtube.com</a> has loaded inside of it.</p>
<p>I felt like I&#8217;d tried this in the past.. but I must have tried it in the wrong way.</p>
<p>Of course, this has led to new and more fun issues.. now.. it seems that if you try to call .loadVideoById() or even if you try to cue it.. set it up.. and then issue .playVideo()&#8230; the videos will always play.. but some of them will still show the triangular &#8220;play&#8221; graphic in the middle of the video..</p>
<p>Okay, so&#8230; solved that issue..</p>
<p>Here is the proper event flow:<br />
1. create  myYouTube = new Display (WRAPPER_URL);<br />
2. listen for DisplayEvent.LOADED<br />
3. once LOADED, add listener for DisplayEvent.STATE_CUED that calls a playMyVideo() function.<br />
4. do myYouTube.cueStartUpVideoById(&#8221;vidID&#8221;);<br />
5. in playMyVideo, remove the STATE_CUED listener and issue the .playVideo()</p>
<p>This appears to work. ..the wrapper with the youtubeapi loads, cued video loads, then it plays.  Currently, I&#8217;m testing by loading 3 videos.</p>
<p>Naturally, the code i&#8217;m using is more complicated.. but this should help people get over the &#8220;hump&#8221; as it were..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eli</title>
		<link>http://www.perkstoveland.com/archives/40/comment-page-1#comment-135</link>
		<dc:creator>eli</dc:creator>
		<pubDate>Sat, 12 Sep 2009 17:54:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.perkstoveland.com/?p=40#comment-135</guid>
		<description>also, I do not have the Flash IDE... so I cannot look at the wrapper FLA.

Can you just paste the .as code for the wrapper into a reply.. blackboxing this issue makes it harder... maybe seeing the code will make it easier for me to understand what exactly is happening inside of the wrapper.

Thank you.</description>
		<content:encoded><![CDATA[<p>also, I do not have the Flash IDE&#8230; so I cannot look at the wrapper FLA.</p>
<p>Can you just paste the .as code for the wrapper into a reply.. blackboxing this issue makes it harder&#8230; maybe seeing the code will make it easier for me to understand what exactly is happening inside of the wrapper.</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eli</title>
		<link>http://www.perkstoveland.com/archives/40/comment-page-1#comment-134</link>
		<dc:creator>eli</dc:creator>
		<pubDate>Sat, 12 Sep 2009 17:39:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.perkstoveland.com/?p=40#comment-134</guid>
		<description>I was looking at your Display.as code.. and it seems there&#039;s no way to check that the _wrapper has fully loaded.

You have an event listener on it for Event.INIT that calls onWrapperLoadComplete... but that function does nothing but remove itself as an event listener (and the onWrapperLoadProgress listener).

I noticed this because I was getting the &quot;Send failed because the object is not connected&quot; error when trying to use .loadVideoById() but not when just using .cueVideoById()  and started reading through the code to try and see what the issue was.

Does it make sense to try and modify the Display.as code not return a newly created Display(WRAPPER) until the wrapper loads (that would get around the issue of multiple youtube.Displays locking eachother up..

or.. is it best to just have it fire off an event letting us know that the _wrapper is actually loaded? (and try to figure out another way around the multiple Display issue)

Anyway, i&#039;m going to experiment with it to see what happens.</description>
		<content:encoded><![CDATA[<p>I was looking at your Display.as code.. and it seems there&#8217;s no way to check that the _wrapper has fully loaded.</p>
<p>You have an event listener on it for Event.INIT that calls onWrapperLoadComplete&#8230; but that function does nothing but remove itself as an event listener (and the onWrapperLoadProgress listener).</p>
<p>I noticed this because I was getting the &#8220;Send failed because the object is not connected&#8221; error when trying to use .loadVideoById() but not when just using .cueVideoById()  and started reading through the code to try and see what the issue was.</p>
<p>Does it make sense to try and modify the Display.as code not return a newly created Display(WRAPPER) until the wrapper loads (that would get around the issue of multiple youtube.Displays locking eachother up..</p>
<p>or.. is it best to just have it fire off an event letting us know that the _wrapper is actually loaded? (and try to figure out another way around the multiple Display issue)</p>
<p>Anyway, i&#8217;m going to experiment with it to see what happens.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: perk</title>
		<link>http://www.perkstoveland.com/archives/40/comment-page-1#comment-131</link>
		<dc:creator>perk</dc:creator>
		<pubDate>Wed, 26 Aug 2009 09:19:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.perkstoveland.com/?p=40#comment-131</guid>
		<description>Hi Eli, and thanks for your feedback. I have noticed this bug myself, but have not managed to correct it yet (haven&#039;t had much time for debugging). I notice that when this happens, a refresh of the page usually corrects this. 

This problem only seems to exist when instantiating multiple players in the same code block. Each time you call the constructor, a call to youtube is made to load in their chromeless player. If multiple calls come at the same time, i kinda chokes up. I suspect that the problem is retrieving the youtube player from youtube at almost the same time makes the player not load.   

I will take a closer look at this when i get the time. Let me know if you stumble upon a solution.</description>
		<content:encoded><![CDATA[<p>Hi Eli, and thanks for your feedback. I have noticed this bug myself, but have not managed to correct it yet (haven&#8217;t had much time for debugging). I notice that when this happens, a refresh of the page usually corrects this. </p>
<p>This problem only seems to exist when instantiating multiple players in the same code block. Each time you call the constructor, a call to youtube is made to load in their chromeless player. If multiple calls come at the same time, i kinda chokes up. I suspect that the problem is retrieving the youtube player from youtube at almost the same time makes the player not load.   </p>
<p>I will take a closer look at this when i get the time. Let me know if you stumble upon a solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eli</title>
		<link>http://www.perkstoveland.com/archives/40/comment-page-1#comment-130</link>
		<dc:creator>eli</dc:creator>
		<pubDate>Mon, 24 Aug 2009 00:45:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.perkstoveland.com/?p=40#comment-130</guid>
		<description>I like what you&#039;ve done here.  Though, it seems to work in a very spotty manner for me (when trying to cue up two videos in two Display() variables).

Sometimes the first video will load, and other times, the second one will only load.. and sometimes they will both load.

By &quot;load&quot; I mean that you see the &quot;YouTube&quot; logo and the &quot;Play&quot; graphic in the middle of the screen.

When the player does not load, I just see the perpetual &quot;rotating circle thingy&quot; graphic.

I think the issue comes up if you try to initialize the Display() variables too close together.  (I&#039;m expirementing with trying to preload one so that the youtubewrapper.swf gets cached maybe)

This code recreates:

var container:Sprite = new Sprite();
container.x = 10;
container.y = 10;

var youtubeDisplay:Display = new Display(WRAPPER_URL);
var youtubeDisplay2:Display = new Display(WRAPPER_URL);

youtubeDisplay2.y = youtubeDisplay.height;

container.addChild(youtubeDisplay);
container.addChild(youtubeDisplay2);

addChild(container);</description>
		<content:encoded><![CDATA[<p>I like what you&#8217;ve done here.  Though, it seems to work in a very spotty manner for me (when trying to cue up two videos in two Display() variables).</p>
<p>Sometimes the first video will load, and other times, the second one will only load.. and sometimes they will both load.</p>
<p>By &#8220;load&#8221; I mean that you see the &#8220;YouTube&#8221; logo and the &#8220;Play&#8221; graphic in the middle of the screen.</p>
<p>When the player does not load, I just see the perpetual &#8220;rotating circle thingy&#8221; graphic.</p>
<p>I think the issue comes up if you try to initialize the Display() variables too close together.  (I&#8217;m expirementing with trying to preload one so that the youtubewrapper.swf gets cached maybe)</p>
<p>This code recreates:</p>
<p>var container:Sprite = new Sprite();<br />
container.x = 10;<br />
container.y = 10;</p>
<p>var youtubeDisplay:Display = new Display(WRAPPER_URL);<br />
var youtubeDisplay2:Display = new Display(WRAPPER_URL);</p>
<p>youtubeDisplay2.y = youtubeDisplay.height;</p>
<p>container.addChild(youtubeDisplay);<br />
container.addChild(youtubeDisplay2);</p>
<p>addChild(container);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wes</title>
		<link>http://www.perkstoveland.com/archives/40/comment-page-1#comment-129</link>
		<dc:creator>Wes</dc:creator>
		<pubDate>Thu, 20 Aug 2009 04:07:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.perkstoveland.com/?p=40#comment-129</guid>
		<description>&lt;a href=&quot;http://www.badongo.com/file/16685249&quot; rel=&quot;nofollow&quot;&gt;source file&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p><a href="http://www.badongo.com/file/16685249" rel="nofollow">source file</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wes</title>
		<link>http://www.perkstoveland.com/archives/40/comment-page-1#comment-128</link>
		<dc:creator>Wes</dc:creator>
		<pubDate>Thu, 20 Aug 2009 04:05:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.perkstoveland.com/?p=40#comment-128</guid>
		<description>Hi all:
I have added localconnection security and changed localconnection name to &quot;name + millisecs + randomNumber&quot;, and now it works in AIR. However, it doesn&#039;t play mulitple videos in AIR. And there is the source file and a packaged AIR file, thx at all. &lt;a&gt;source file&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Hi all:<br />
I have added localconnection security and changed localconnection name to &#8220;name + millisecs + randomNumber&#8221;, and now it works in AIR. However, it doesn&#8217;t play mulitple videos in AIR. And there is the source file and a packaged AIR file, thx at all. <a>source file</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wes</title>
		<link>http://www.perkstoveland.com/archives/40/comment-page-1#comment-127</link>
		<dc:creator>Wes</dc:creator>
		<pubDate>Tue, 18 Aug 2009 08:56:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.perkstoveland.com/?p=40#comment-127</guid>
		<description>I forget to say that I give localconnection allowDomain(&quot;*&quot;) and allowInsecureDomain(&quot;*&quot;), but it&#039;s still not work.</description>
		<content:encoded><![CDATA[<p>I forget to say that I give localconnection allowDomain(&#8221;*&#8221;) and allowInsecureDomain(&#8221;*&#8221;), but it&#8217;s still not work.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
