أفضل شيء لعمل اليوتيوب هو iframe هو يختار افضل طريقة لتشغيل الفيديو حسب النظام والمتصفح. جربت التعديل على pbboardCodeparse.class.php هذا ما وصلت إليه: استبدال function PowerCode_Youtube ب
CODE
function PowerCode_Youtube($linky, $messages){
global $PowerBB;
$linky = str_replace("youtu.be/", "youtube.com/watch?v=", $linky);
$linky = str_ireplace("youtube.com/embed/", "youtube.com/watch?v=", $linky);
if (!strstr($linky,"youtube.com/watch?v=")){return 'Check Youtube Link!!';}
$imgA1 = explode('v=',$linky);
$imgA2 = explode('&',$imgA1[1]);
$link = 'https://www.youtube.com/embed/'.$imgA2[0].'?rel=0';
return '<iframe src="'.$link.'" width="560" height="315" id="ytplayer" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
}
ونضيف
CODE
$text = str_replace('sandbox="allow-popups allow-same-origin" src="https://www.youtube.com', 'src="https://www.youtube.com', $text);
بعد
CODE
$text = str_ireplace("<iframe", '<iframe sandbox="allow-popups allow-same-origin"', $text);
ما رأيكم.؟