X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Foembed.php;h=e2504b7eb8554e040e24e43da081d1e97da1b66d;hb=428fce633feea10d0ba1b04be34a82fbc4448904;hp=52068efc763fab6599e4d98b2168452c4815f9c6;hpb=acc4bbeb6ebc832da2a8b5a37b764a6a53dd1214;p=friendica.git diff --git a/include/oembed.php b/include/oembed.php index 52068efc76..e2504b7eb8 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -1,6 +1,6 @@ query("//link[@type='application/json+oembed']"); foreach($entries as $e){ $href = $e->getAttributeNode("href")->nodeValue; - $txt = fetch_url($href); + $txt = fetch_url($href . '&maxwidth=425'); + break; } } } @@ -43,7 +47,7 @@ function oembed_fetch_url($embedurl){ if ($txt==false || $txt==""){ // try oohembed service - $ourl = "http://oohembed.com/oohembed/?url=".urlencode($embedurl); + $ourl = "http://oohembed.com/oohembed/?url=".urlencode($embedurl).'&maxwidth=425'; $txt = fetch_url($ourl); } @@ -61,7 +65,8 @@ function oembed_fetch_url($embedurl){ } function oembed_format_object($j){ - $embedurl = $j->embedurl; + $a = get_app(); + $embedurl = $j->embedurl; $jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null) ); $ret=""; switch ($j->type) { @@ -74,6 +79,7 @@ function oembed_format_object($j){ $th=120; $tw = $th*$tr; $tpl=get_markup_template('oembed_video.tpl'); $ret.=replace_macros($tpl, array( + '$baseurl' => $a->get_baseurl(), '$embedurl'=>$embedurl, '$escapedhtml'=>base64_encode($jhtml), '$tw'=>$tw,