]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Fixed youtube regex.
authorBobby Richter <secretrobotron@gmail.com>
Thu, 28 Apr 2011 20:06:24 +0000 (16:06 -0400)
committerBobby Richter <secretrobotron@gmail.com>
Thu, 28 Apr 2011 20:06:24 +0000 (16:06 -0400)
players/youtube/popcorn.youtube.js

index 878848e2d62938dd7150ea8fade20da9c9f64131..b416692bf0bbc4db220defe87d6b5f2c896d2820 100644 (file)
@@ -59,7 +59,7 @@ var onYouTubePlayerReady;
       return;
     }
     
-    var matches = url.match( /((http:\/\/)?www\.)?youtube\.[a-z]+\/watch\?v\=[a-z0-9]+/i );    
+    var matches = url.match( /((http:\/\/)?www\.)?youtube\.[a-z]+\/watch\?v\=[a-z0-9_]+/i );    
     // Return id, which comes after first equals sign
     return matches ? matches[0].split( "=" )[1] : "";
   }
@@ -70,7 +70,7 @@ var onYouTubePlayerReady;
       return;
     }
     
-    var matches = url.match( /^http:\/\/?www\.youtube\.[a-z]+\/e\/[a-z0-9]+/i );
+    var matches = url.match( /^http:\/\/?www\.youtube\.[a-z]+\/e\/[a-z0-9_]+/i );
     
     // Return id, which comes after first equals sign
     return matches ? matches[0].split( "/e/" )[1] : "";