Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r17932: LJSUP-7606: Sharing from YouTube to LJ -...

Committer: gariev
LJSUP-7606: Sharing from YouTube to LJ - URL modification

U   trunk/htdocs/update.bml
Modified: trunk/htdocs/update.bml
===================================================================
--- trunk/htdocs/update.bml	2010-12-14 12:01:23 UTC (rev 17931)
+++ trunk/htdocs/update.bml	2010-12-15 04:40:41 UTC (rev 17932)
@@ -140,10 +140,11 @@
     if ($url) {
         ## currently, the URL is for YouTube only.
         ## in future support for other quick embeds will be added.
-        $url = LJ::ehtml($url);
-        $event .= <<"EMBED";
-<object width="640" height="385"><param name="movie" value="$url"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="$url" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
+        if ($url =~ m!http://www.youtube.com/watch\?v=(\w+)!) {
+            $event .= <<"EMBED";
+<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/$1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
 EMBED
+        }
     }
  
     # in case of repost other entry by its uri we should check its visibility

Tags: bml, gariev, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments