<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -43,6 +43,7 @@ THE SOFTWARE.
     BOOL _fromYouTube;
     BOOL _fromFlickr;
 	BOOL _embeddedYouTubeView;
+	BOOL _youTubeAutoPlay;
 	BOOL _hasH264Version;
 	BOOL _hasHDH264Version;
 	WebView *_webView;</diff>
      <filename>Plugin/Plugin.h</filename>
    </modified>
    <modified>
      <diff>@@ -119,6 +119,7 @@ BOOL usingMATrackingArea = NO;
 		_hasHDH264Version = NO;
 		_contextMenuIsVisible = NO;
 		_embeddedYouTubeView = NO;
+		_youTubeAutoPlay = NO;
 		_delayingTimer = nil;
 		defaultWhitelist = [NSArray arrayWithObjects:	@&quot;com.apple.frontrow&quot;,
 														@&quot;com.apple.dashboard.client&quot;,
@@ -207,6 +208,16 @@ BOOL usingMATrackingArea = NO;
 		|| ([self src] != nil &amp;&amp; [[self src] rangeOfString: @&quot;youtube-nocookie.com&quot;].location != NSNotFound );
 		
         if (_fromYouTube) {
+			
+			// Check wether autoplay is wanted
+			if ([[self host] isEqualToString:@&quot;www.youtube.com&quot;]
+				|| [[self host] isEqualToString:@&quot;www.youtube-nocookie.com&quot;]) {
+				_youTubeAutoPlay = YES;
+			} else {
+				_youTubeAutoPlay = [[[self _flashVarDictionary:[self src]] objectForKey:@&quot;autoplay&quot;] isEqualToString:@&quot;1&quot;];
+			}
+
+			
 			NSString *videoId = [ self flashvarWithName: @&quot;video_id&quot; ];
 			if (videoId != nil) {
 				[self setVideoId:videoId];
@@ -1339,7 +1350,9 @@ didReceiveResponse:(NSHTTPURLResponse *)response
     [ element setAttribute: @&quot;src&quot; value: [ self _h264VersionUrl ]];
     [ element setAttribute: @&quot;type&quot; value: @&quot;video/mp4&quot; ];
     [ element setAttribute: @&quot;scale&quot; value: @&quot;aspect&quot; ];
-    [ element setAttribute: @&quot;autoplay&quot; value: @&quot;true&quot; ];
+    if (_youTubeAutoPlay) {
+		[ element setAttribute: @&quot;autoplay&quot; value: @&quot;true&quot; ];
+	}
     [ element setAttribute: @&quot;cache&quot; value: @&quot;false&quot; ];
 	
     if( ! [ element hasAttribute: @&quot;width&quot; ] )
@@ -1355,7 +1368,9 @@ didReceiveResponse:(NSHTTPURLResponse *)response
 {
     [ element setAttribute: @&quot;src&quot; value: [ self _h264VersionUrl ] ];
 	[ element setAttribute: @&quot;autobuffer&quot; value:@&quot;autobuffer&quot;];
-	[ element setAttribute: @&quot;autoplay&quot; value:@&quot;autoplay&quot;];
+	if (_youTubeAutoPlay) {
+		[ element setAttribute: @&quot;autoplay&quot; value:@&quot;autoplay&quot;];
+	}
 	[ element setAttribute: @&quot;controls&quot; value:@&quot;controls&quot;];
 	
 	DOMElement* container = [self container];</diff>
      <filename>Plugin/Plugin.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>669fb1c4e99949cc9e594109c804082540448967</id>
    </parent>
  </parents>
  <author>
    <name>fppzdd</name>
    <email>fppzdd@gmail.com</email>
  </author>
  <url>http://github.com/rentzsch/clicktoflash/commit/c9e2bfac1492618c4a92da298af4a4d051ef927f</url>
  <id>c9e2bfac1492618c4a92da298af4a4d051ef927f</id>
  <committed-date>2009-10-01T16:38:32-07:00</committed-date>
  <authored-date>2009-09-15T12:39:57-07:00</authored-date>
  <message>This should fix http://rentzsch.lighthouseapp.com/projects/24342/tickets/276-video-element-always-set-to-autoplay-even-when-youtube-isnt
(cherry picked from commit fad0a55b1fa86829bc96eb7f3a49d081a00edba8)</message>
  <tree>0955fbadbb48e55de47d253e3669d7cc5158c3d3</tree>
  <committer>
    <name>Simone Manganelli</name>
    <email>simX@mac.com</email>
  </committer>
</commit>
