<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DrPunchBlog &#187; youTube</title>
	<atom:link href="http://yo.drpunchman.com/tag/youtube/feed/" rel="self" type="application/rss+xml" />
	<link>http://yo.drpunchman.com</link>
	<description>Living the feaver dream.</description>
	<lastBuildDate>Thu, 02 Feb 2012 02:19:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>One last YouTube Effect.</title>
		<link>http://yo.drpunchman.com/2011/07/10/one-last-youtube-effect/</link>
		<comments>http://yo.drpunchman.com/2011/07/10/one-last-youtube-effect/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 17:47:09 +0000</pubDate>
		<dc:creator>DrPunchman</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Motion Graphics]]></category>
		<category><![CDATA[Drugs]]></category>
		<category><![CDATA[efx]]></category>
		<category><![CDATA[Ratatat]]></category>
		<category><![CDATA[sleep]]></category>
		<category><![CDATA[squares]]></category>
		<category><![CDATA[VIDEO]]></category>
		<category><![CDATA[youTube]]></category>

		<guid isPermaLink="false">http://yo.drpunchman.com/?p=6747</guid>
		<description><![CDATA[OK, NOW I can sleep. I had to knock out one more out. I am in love with this effect, admittedly it is the video that makes it ( view the original on the drill down ). I totally wish I had a video that rendered small enough to post&#8230; Media Encoder kept pushing stuff [...]]]></description>
			<content:encoded><![CDATA[<p>OK, NOW I can sleep.<br />
I had to knock out one more out.</p>
<p>I am in love with this effect, admittedly it is the video that makes it ( view the original on the drill down ).</p>
<p><img class="aligncenter size-large wp-image-6748" title="Screen shot 2011-07-10 at 2.02.31 AM" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-10-at-2.02.31-AM-570x343.png" alt="" width="470" height="282" /></p>
<p>I totally wish I had a video that rendered small enough to post&#8230; Media Encoder kept pushing stuff out to 300+ MG (Adobe Media Encoder, you suck), and I don&#8217;t know Apple Compressor well enough to get a decent web-friendly video under 100 MG.</p>
<p><span id="more-6747"></span></p>
<p><img class="aligncenter size-large wp-image-6757" title="Worried Business Man" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-10-at-10.38.56-AM-570x424.png" alt="" width="470" height="349" /></p>
<p><img class="aligncenter size-large wp-image-6755" title="Business Man" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-10-at-10.38.26-AM-570x426.png" alt="" width="470" height="351" /></p>
<p><img class="aligncenter size-large wp-image-6754" title="Inter-racial 3 some" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-10-at-10.37.50-AM-570x424.png" alt="" width="470" height="349" /></p>
<p><img class="aligncenter size-large wp-image-6752" title="Old Couple" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-10-at-10.36.15-AM-570x426.png" alt="" width="470" height="351" /></p>
<p><img class="aligncenter size-large wp-image-6751" title="Man Flexing" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-10-at-10.35.55-AM-570x426.png" alt="" width="470" height="351" /></p>
<p><img class="aligncenter size-large wp-image-6750" title="man yelling" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-10-at-10.35.36-AM-570x425.png" alt="" width="470" height="350" /></p>
<p><img class="aligncenter size-large wp-image-6756" title="Face" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-10-at-10.38.40-AM-570x423.png" alt="" width="470" height="348" /></p>
<p>The original Video, before I abused it:</p>
<p style="text-align: center;"><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/KhrteSZXFzM&amp;ap=%2526fmt%3D18" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed wmode="opaque" src="http://www.youtube.com/v/KhrteSZXFzM&amp;ap=%2526fmt%3D18" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></p>
<p style="text-align: left;">Because you have been good, here is a snippet of the code I&#8217;m using (before clean up):</p>
<p style="text-align: left;">
<pre class="brush: as3; title: ; notranslate">
private function drawPxl():void
{

	var _tempPxl:pxlclr = _pxlA;

	_parent.visible = false;
	var test:MovieClip = new MovieClip();
	do
	{
		var s = shape( _tempPxl.x, _tempPxl.y, _tempPxl.color );
		test.addChild( s );

		_tempPxl = _tempPxl.next;

	} while (_tempPxl != null);

	// remove all childeren
	while( _out.numChildren &gt; 2 ) _out.removeChildAt(0); 

	_out.addChild(test);

}

// Make Squares
private function shape( xxx, yyy, clor ) : MovieClip
{

	var _shape:MovieClip = new MovieClip();

	_shape.graphics.lineStyle(1,clor,0.3);
	_shape.graphics.moveTo(-4,-4);
	_shape.graphics.lineTo(-4,4);
	_shape.graphics.lineTo(4,4);
	_shape.graphics.lineTo(4,-4);
	_shape.graphics.lineTo(-4,-4);
	_shape.rotation = Math.random() * 90;

	_shape.x = xxx;
	_shape.y = yyy;

	return _shape;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://yo.drpunchman.com/2011/07/10/one-last-youtube-effect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-10-at-2.02.31-AM-150x150.png" length="57767" type="image/jpg" />	</item>
		<item>
		<title>Video v. Pixels</title>
		<link>http://yo.drpunchman.com/2011/07/10/video-v-pixels/</link>
		<comments>http://yo.drpunchman.com/2011/07/10/video-v-pixels/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 07:12:32 +0000</pubDate>
		<dc:creator>DrPunchman</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Motion Graphics]]></category>
		<category><![CDATA[Bassnecter]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[Noisia]]></category>
		<category><![CDATA[pixel data]]></category>
		<category><![CDATA[Ratatat]]></category>
		<category><![CDATA[setPixel]]></category>
		<category><![CDATA[Skrillex]]></category>
		<category><![CDATA[VIDEO]]></category>
		<category><![CDATA[youTube]]></category>

		<guid isPermaLink="false">http://yo.drpunchman.com/?p=6734</guid>
		<description><![CDATA[I&#8217;ve been modifying my YouTube Video Class&#8230; and I really wanted to experiment with the Bitmap Classes as well. The result is pretty dandy. The above effect (Shower Door) is my favorite, it consistently looks the best on all videos. It overlays a random pattern of pixels from previous frames over the live video feed and blurs them [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been modifying my YouTube Video Class&#8230;<br />
and I really wanted to experiment with the Bitmap Classes as well. The result is pretty dandy.</p>
<p><img class="aligncenter size-full wp-image-6735" title="Shower Door" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-09-at-11.40.35-PM.png" alt="" width="398" height="299" /></p>
<p>The above effect (Shower Door) is my favorite, it consistently looks the best on all videos. It overlays a random pattern of pixels from previous frames over the live video feed and blurs them at random.</p>
<p>Go to the next page to see 3 other settings: Rain, Embiggen, and Sunny Day.</p>
<p><span id="more-6734"></span></p>
<p><img class="aligncenter size-full wp-image-6737" title="Screen shot 2011-07-09 at 11.46.02 PM" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-09-at-11.46.02-PM.png" alt="Rain" width="397" height="297" /></p>
<p style="text-align: center;">Rain (Above)</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-6738" title="Embiggen" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-09-at-11.50.42-PM.png" alt="" width="398" height="298" /></p>
<p style="text-align: center;">Embiggen (Above)</p>
<p><img class="aligncenter size-full wp-image-6739" title="Sunny Day" src="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-10-at-12.04.50-AM.png" alt="" width="397" height="297" /></p>
<p style="text-align: center;">Sunny Day (Above)</p>
<p>I don&#8217;t think all of these will make it to the final class, but once I got the class built in, it was a lot of fun tweaking settings. At the end of the day (for me) I am looking to completely distort the video data itself, all I really want is color and motion, because the videos are almost NEVER the real official video, but random photos, fan-video, logos, advertisement, and other crap. YouTube is to Music Videos what Andy Worhol is to Campbell&#8217;s Soup. &#8230;or maybe worse what Mr.Brainwash is to Andy Worhol&#8217;s Campbell&#8217;s Soup.</p>
]]></content:encoded>
			<wfw:commentRss>http://yo.drpunchman.com/2011/07/10/video-v-pixels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://yo.drpunchman.com/wp-content/uploads/2011/07/Screen-shot-2011-07-09-at-11.40.35-PM-150x150.png" length="26133" type="image/jpg" />	</item>
		<item>
		<title>AS3 YouTube API</title>
		<link>http://yo.drpunchman.com/2010/03/09/as3-youtube-api/</link>
		<comments>http://yo.drpunchman.com/2010/03/09/as3-youtube-api/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 03:16:07 +0000</pubDate>
		<dc:creator>DrPunchman</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Art Douglas]]></category>
		<category><![CDATA[pickles]]></category>
		<category><![CDATA[VIDEO]]></category>
		<category><![CDATA[youTube]]></category>

		<guid isPermaLink="false">http://yo.drpunchman.com/?p=898</guid>
		<description><![CDATA[This is my simple youTube Player class using their API. Thanks to Art Douglas for the video playlist youTube.as [ download coming soon ]]]></description>
			<content:encoded><![CDATA[<p>This is my simple youTube Player class using their API.<br />

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="400" height="600" align="center">
      <param name="movie" value="http://yo.drpunchman.com/wp-content/uploads/2010/03/testTube.swf" />
      <param name="align" value="center" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://yo.drpunchman.com/wp-content/uploads/2010/03/testTube.swf" width="400" height="600" align="center">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<br />
Thanks to <a href="http://www.youtube.com/user/ARTIED" target="_blank">Art Douglas</a> for the video playlist</p>
<p><span id="more-898"></span><br />
youTube.as</p>
<pre class="brush: as3; title: ; notranslate">
package com.drpunchlogic
{
	/*	

		YOU MIGHT WANT TO READ THIS FIRST:

http://code.google.com/apis/youtube/flash_api_reference.html

http://code.google.com/apis/youtube/flash_api_reference.html#GettingStarted

http://code.google.com/apis/youtube/flash_api_reference.html#Adding_event_listener

		good to know:

http://code.google.com/apis/youtube/articles/tubeloc.html

		this is based off of the example located at: http://code.google.com/apis/youtube/flash_api_reference.html#loadVideoById

	*/

/*
-------------------------------------------------
	INCLUDE STUFF
-------------------------------------------------
*/
	// security
	import flash.system.Security;
    import flash.system.SecurityPanel;
	import flash.system.LoaderContext;

	// display objects
	import flash.display.MovieClip;
	import flash.display.Loader;
	import flash.geom.Rectangle;

	// standard events
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.events.ProgressEvent;
	import flash.events.EventDispatcher;
	import flash.events.KeyboardEvent;

	// error checking
	import flash.events.ErrorEvent;
	import flash.events.IOErrorEvent;
	import flash.errors.IOError;
	import flash.errors.MemoryError;

	// networking
	import flash.net.URLRequest;
	import flash.net.navigateToURL;

	// TweenMax
	import com.greensock.*;
	import com.greensock.easing.*;

	// Custom
	// ---- OOPS (traces out to text box)
	import com.drpunchlogic.oops;
	// ---- XML
	import com.drpunchlogic.youTubeXML;
	// ---- GALLERY
	import com.drpunchlogic.youTubeGallery;

	// -----------------------

	public class youTube extends MovieClip
	{
// START --------------------------

/*
-------------------------------------------------
	SHARED VARIABLES
-------------------------------------------------
*/
		private var loader:Loader;
		private var _youTube:Object; // This will hold the API player instance once it is initialized.

		public var _nowPlaying:uint = 0; // The current video uint

		//public var _file:String = &quot;http://www.youtube.com/v/UA3TLWplbHs&quot;; // the file we want to play
		public var _file:Array = new Array(); // the file we want to play in an array for the XML

		// oops
		private var _log:String = '';

		// player controls
		public var _ctrl:youTubeBtn;
		private var _isFirstPlay:Boolean = true;

		// OOPS
		public var _oops:oops; // TRACE CLASS
		public var _say:Function;

		// XML
		public var _X:youTubeXML; // XML CLASS

		// GALLERY
		public var _G:youTubeGallery; // GALLERY CLASS

/*
-------------------------------------------------
	YOU TUBE!
-------------------------------------------------
*/
		public function youTube() : void
		{
			_oops = new oops();
			_oops.x = 260;
			addChild( _oops );
			_say = _oops.say;

			_say( &quot;\n\n[ testTube! ]&quot; );

			// first thing I am going to do is add security
			sercureDom();

			// after it is secure, INIT the player
			addEventListener( &quot;SEC&quot;, init );

		} 

/*
-------------------------------------------------
	SECURE DOMAINS
-------------------------------------------------
*/
		private function sercureDom() : void
		{
			_say( &quot;[ sercureDom ]&quot; );

			/*
			The player SWF file on www.youtube.com needs to communicate with your host SWF file.
			Your code must call Security.allowDomain() to allow this communication.
			*/

			Security.allowDomain(&quot;www.youtube.com&quot;);

			// ok, let's init
			//dispatchEvent( new Event( &quot;SEC&quot; ) );
			init();
		}

/*
-------------------------------------------------
	INIT
-------------------------------------------------
*/
		public function init( ) : void
		{
			_say( &quot;[ init ]&quot; );

			// we don't need the event listener any longer
			removeEventListener( &quot;SEC&quot;, init );

			// add XML
			addEventListener( &quot;XMLFIN&quot; , XMLready ); // &lt;-- Start Movie After XML is finished
			// parse XML
			addXML();

			// normally yes, but today we want the XML to tell us when it is ready.
			/*
			loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
			loader.load(new URLRequest(&quot;http://www.youtube.com/apiplayer?version=3&quot;));
			*/

		}
/*
-------------------------------------------------
	XML READY
-------------------------------------------------
*/
		public function XMLready( e:Event ) : void
		{
			_say( &quot;[ XML ready ]\n&quot; );

			// kill listener we don't need
			removeEventListener( &quot;XMLFIN&quot; , XMLready ); 

			// create file array
			for( var i:uint = 0; i &lt; _X._itemArr.length; i++ )
			{
				_file.push( _X._itemArr[i].video );
			}

			// add a gallery
			addGallery(); // not needed for the player

			// start loading movies
			loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
			loader.load(new URLRequest(&quot;http://www.youtube.com/apiplayer?version=3&quot;));
		}
/*
-------------------------------------------------
	LOADER
-------------------------------------------------
*/
		private function onLoaderInit(event:Event):void {
			addChild(loader);
			loader.content.addEventListener(&quot;onReady&quot;, onPlayerReady);
			loader.content.addEventListener(&quot;onError&quot;, onPlayerError);
			loader.content.addEventListener(&quot;onStateChange&quot;, onPlayerStateChange);
			loader.content.addEventListener(&quot;onPlaybackQualityChange&quot;, onVideoPlaybackQualityChange);
		}

/*
-------------------------------------------------
	READY?
-------------------------------------------------
*/
		private function onPlayerReady(e:Event):void {
			// Event.data contains the event parameter, which is the player API ID
			_say(&quot;\t{ ready: &quot; + Object(e).data + &quot; }&quot; );

			// Once this event has been dispatched by the player, we can use
			// cueVideoById, loadVideoById, cueVideoByUrl and loadVideoByUrl
			// to load a particular YouTube video.
			_youTube = loader.content;

			// Set appropriate player dimensions for your application
			_youTube.setSize(400, 300);
			// We are playing a movie smaller then 640 so let's not load some big format we won't use:
			_youTube.setPlaybackQuality( &quot;small&quot; );

			// don't allow multiple loads of the video player and controls
			if( _isFirstPlay )
			{
				// lets add the controls
				ctrls();

				// play the first video
				newVideo( _nowPlaying );

				_isFirstPlay = false;
			}
		}
/*
-------------------------------------------------
	ERROR, WTF?
-------------------------------------------------
*/
		private function onPlayerError(e:Event):void {
			// Event.data contains the event parameter, which is the error code
			_say(&quot;\t{ error: &quot; +  Object(e).data + &quot; }&quot;,1 );
		}
/*
-------------------------------------------------
	MARK CHANGES
-------------------------------------------------
*/
		private function onPlayerStateChange(e:Event):void {
			// Event.data contains the event parameter, which is the new _youTube state
			_say(&quot;\t{ state: &quot; + Object(e).data + &quot; }&quot; );
			// send new event to controller
			_ctrl.stateChange( Object(e).data );

			// activate gallery buttons
			if( Object(e).data == 1 ) _G.btnOnOff( true );
			//if( Object(e).data == 5 ) _G.btnOnOff( false );

		}

		private function onVideoPlaybackQualityChange(e:Event):void {
			// Event.data contains the event parameter, which is the new video quality
			_say(&quot;\t{ quality: &quot; + Object(e).data + &quot; }&quot; );
		}
/*
-------------------------------------------------
	PLAY THE VIDEO
-------------------------------------------------
*/
		public function newVideo( i:uint ) : void
		{
			_say(&quot;\t{ file: &quot; + _file[i] + &quot; }&quot;,3 );
			// let's load a movie to play
			_youTube.loadVideoByUrl( _file[i] , 3);

			_nowPlaying = i;
		}
/*
	This next little area is to prep the
	thumbnail gallery section
*/

/*
-------------------------------------------------
	NEXT VIDEO
-------------------------------------------------
*/
	public function prepFile() : void
	{
		// let's get a movie ready to play
		_youTube.cueVideoByUrl( _file[ _nowPlaying ] , 0);

	}
/*
	That is basically everything we need,
	So, I'm going to add the controls now.
*/
/*
-------------------------------------------------
	CONTROLS
-------------------------------------------------
*/
		public function ctrls() : void
		{

			_say( &quot;[ ctrl ]&quot; );

			_ctrl = new youTubeBtn( );
			_ctrl.x = _ctrl.width / 2;
			_ctrl.y = 300;
			_ctrl.name = &quot;ctrl&quot;;

			addChild( _ctrl );

			_ctrl.init( _youTube, this );

			// this isn't part of controlls, I just want to show/hide oops
			_ctrl.shbtn.addEventListener( MouseEvent.CLICK, showhideOOPS );

		} 

/*
	Let's add a gallery to the video player
*/
/*
-------------------------------------------------
	ADD XML
-------------------------------------------------
*/
	private function addXML() : void
	{
		// add the XML from the feed
		var feed:String = &quot;http://gdata.youtube.com/feeds/api/playlists/&quot;;
		// 43697368FC276DB2 &lt;-- mine
		// DF668B5F247C0CE7 &lt;-- another
		feed += &quot;D7FE57402F99A513&quot;; //&lt;--- playlist id
		feed += &quot;?&quot;;
		feed += &quot;&amp;start-index=1&quot;;
		//feed += &quot;&amp;max-results=12&quot;;
		feed += &quot;&amp;v=2&quot;;

		_X = new youTubeXML( this, feed );

	}
/*
-------------------------------------------------
	ADD GALLERY
-------------------------------------------------
*/
	private function addGallery() : void
	{
		// add the gallery thumbnails
		_G = new youTubeGallery( this, _X._itemArr );
		_G.x = 0;
		_G.y = 330;
		addChild( _G );
	}

/*
-------------------------------------------------
	SHOW/HIDE OOPS
-------------------------------------------------
*/
		private function showhideOOPS( e:Event ) : void
		{
			//( _oops.visible ) ? _oops.visible = false : _oops.visible = true;
			( _oops.x == 0 ) ? [ TweenLite.to(_oops, 1, {x:260}) , TweenLite.to(_G, 1, {x:0}) ] : [ TweenLite.to(_oops, 1, {x:0}) ,TweenLite.to(_G, 1, {x:-404}) ];
		}
// END --------------------
	}
}
</pre>
<p>[ download coming soon ]</p>
]]></content:encoded>
			<wfw:commentRss>http://yo.drpunchman.com/2010/03/09/as3-youtube-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

