]> git.mxchange.org Git - friendica.git/commitdiff
fix oembed video thumb display ratio
authorFabio Comuni <fabrix.xm@gmail.com>
Mon, 24 Oct 2011 15:31:14 +0000 (17:31 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Mon, 24 Oct 2011 15:31:14 +0000 (17:31 +0200)
include/oembed.php

index 2933252b3e9dd6acf05346b243049033797a546f..924e61289ed5ac787f571c3534e9ab7490a5603c 100644 (file)
@@ -56,9 +56,11 @@ function oembed_format_object($j){
        switch ($j->type) {
                case "video": {
                        if (isset($j->thumbnail_url)) {
-                               /*$tw = (isset($j->thumbnail_width)) ? $j->thumbnail_width:200;
-                               $th = (isset($j->thumbnail_height)) ? $j->thumbnail_height:180;*/
-                               $tw=150; $th=120; 
+                               $tw = (isset($j->thumbnail_width)) ? $j->thumbnail_width:200;
+                               $th = (isset($j->thumbnail_height)) ? $j->thumbnail_height:180;
+                               $tr = $tw/$th;
+                               
+                               $th=120; $tw = $th*$tr;
                                $tpl=get_markup_template('oembed_video.tpl');
                                $ret.=replace_macros($tpl, array(
                                        '$embedurl'=>$embedurl,