--- ted.inc	2011-02-25 03:14:18.000000000 +0100
+++ tedPatched.inc	2011-04-25 14:26:04.000000000 +0200
@@ -12,7 +12,8 @@ define('EMVIDEO_TED_MAIN_URL', 'http://t
 define('EMVIDEO_TED_PLAYER_URL', 'http://video.ted.com/assets/player/swf/EmbedPlayer.swf');
 define('EMVIDEO_TED_ID_EMBED_URL', 'http://www.ted.com/talks/embed/id/');
 define('EMVIDEO_TED_ID_VIEW_URL', 'http://ted.com/talks/view/id/');
-define('EMVIDEO_TED_VIDEO_BASE', 'http://video.ted.com/talks/dynamic/');
+//define('EMVIDEO_TED_VIDEO_BASE', 'http://video.ted.com/talks/dynamic');
+define('EMVIDEO_TED_VIDEO_BASE', 'http://video.ted.com/talk/stream/');
 
 define('EMVIDEO_TED_DATA_VERSION', 2);
 
@@ -37,6 +38,7 @@ global $_media_ted_extra;
  *      These will be rendered in a table, with the columns being 'Feature', 'Supported', 'Notes'.
  */
 function emvideo_ted_info() {
+	
   $features = array(
     array(t('Autoplay'), t('Yes'), ''),
     //array(t('RSS Attachment'), t('Yes'), ''),
@@ -101,17 +103,20 @@ function emvideo_ted_extract($embed = ''
   <param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/EvanWilliams_2009-medium.flv&su=http://images.ted.com/images/ted/tedindex/embed-posters/EvanWilliams-2009.embed_thumbnail.jpg&vw=432&vh=240&ap=0&ti=473&introDuration=15330&adDuration=4000&postAdDuration=830&adKeys=talk=evan_williams_on_listening_to_twitter_users;year=2009;theme=speaking_at_ted2009;theme=tales_of_invention;theme=what_s_next_in_tech;theme=words_about_words;theme=not_business_as_usual;event=TED2009;&preAdTag=tconf.ted/embed;tile=1;sz=512x288;" />
   <embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="446" height="326" allowFullScreen="true" allowScriptAccess="always" flashvars="vu=http://video.ted.com/talks/dynamic/EvanWilliams_2009-medium.flv&su=http://images.ted.com/images/ted/tedindex/embed-posters/EvanWilliams-2009.embed_thumbnail.jpg&vw=432&vh=240&ap=0&ti=473&introDuration=15330&adDuration=4000&postAdDuration=830&adKeys=talk=evan_williams_on_listening_to_twitter_users;year=2009;theme=speaking_at_ted2009;theme=tales_of_invention;theme=what_s_next_in_tech;theme=words_about_words;theme=not_business_as_usual;event=TED2009;"></embed></object>
 //*/
+	
   if ($embed && preg_match('@\[ted id=([0-9]+)\]@i', $embed, $matches)) {
-  $result = drupal_http_request(EMVIDEO_TED_ID_EMBED_URL . $matches[1]);
+  	
+  	$result = drupal_http_request(EMVIDEO_TED_ID_EMBED_URL . $matches[1]);
     if ($result->code == 200) {
       $embed = $result->data;
     }
+    
   }
-
-  if ($embed && preg_match('@video.ted.com\/talks\/dynamic\/(.*?)\.flv\&([^\"\']+)@i', $embed, $matches)) {
+  
+  //if ($embed && preg_match('@video.ted.com\/talks\/dynamic\/(.*?)\.flv\&([^\"\']+)@i', $embed, $matches)) {
+  if ($embed && preg_match('@video.ted.com\/talk\/stream\/(.*?)\.mp4\&([^\"\']+)@i', $embed, $matches)) {
     global $_media_ted_extra;
     $_media_ted_extra = $matches[2];
-
     return $matches[1];
   }
 
@@ -127,7 +132,7 @@ function emvideo_ted_data($field, $item)
   // Initialize the data array.
   $data = array();
   $data['emvideo_ted_version'] = EMVIDEO_TED_DATA_VERSION;
-
+  
   // Gather info about the item's raw flash video.
   $url = EMVIDEO_TED_PLAYER_URL . EMVIDEO_TED_VIDEO_BASE . $item['value'];
 
@@ -262,7 +267,8 @@ function theme_emvideo_ted_flash($item, 
     // a bit of backwards compatibility here
     $vars        = $item['value'];
     if (strpos($item['value'], 'vu=') === FALSE) {
-      $vars      = 'vu=' . EMVIDEO_TED_VIDEO_BASE . $item['value'] . '.flv' .
+      //$vars      = 'vu=' . EMVIDEO_TED_VIDEO_BASE . $item['value'] . '.flv' .
+      $vars      = 'vu=' . EMVIDEO_TED_VIDEO_BASE . $item['value'] . '.mp4' .
                   $thumbnail . $extra;
     }
     //TODO remove redundant(?) $embed_url
