Youtube have many new update ,
so i'm try hack this , for html5 and RWD...
hack point
1. compatible https
2. compatible long url and short url
3. of cause html5 , no flash
4. for bootstrap3 responsive embed , 16:9 and 4:3 and RWD
5 .mobile can full screen
just edit 2 files
\class\textsanitizer\youtube\youtube.php
\language\english\formdhtmltextarea.php
step1. edit \class\textsanitizer\youtube\youtube.php
old default height and width
var text2 = prompt(enterFlashWidthPhrase, "425");
var text3 = prompt(enterFlashHeightPhrase, "350");
change to 16:9
var text2 = prompt(enterFlashWidthPhrase, "16");
var text3 = prompt(enterFlashHeightPhrase, "9");
--
old only long url
if (!preg_match("/^http://(www.)?youtube.com/watch?v=(.*)/i", $url, $matches)) {
trigger_error("Not matched: {$url} {$width} {$height}", E_USER_WARNING);
return "";
}
$src = "http://www.youtube.com/v/" . $matches[2];
change to compatible long url and short url , (i'm code beginner, so stupid code)
if (preg_match("/^http[s]?://(www.)?youtu.be/(.*)/i", $url, $matches) ) { }
elseif (preg_match("/^http[s]?://(www.)?youtube.com/watch?v=(.*)/i", $url, $matches)) { }
else{
trigger_error("Not matched: {$url} {$width} {$height}", E_USER_WARNING);
return "";
}
$src = "http://www.youtube.com/embed/" . $matches[2];
--
old for flash object
$code = "";
change to bootstrap3 RWD embed-responsive 16by9 and 4by3
$code = "{$width}by{$height}'>" .
"
";
--
step2. edit language \language\english\formdhtmltextarea.php
define('_XOOPS_FORM_ALT_ENTERHEIGHT','(Video 16:9 or 4:3) input Height 9 or 3 :');
define('_XOOPS_FORM_ALT_ENTERWIDTH','(Video 16:9 or 4:3) input Width 16 or 4 :');
done!
try this
use newbb dhtml , click youtube, paste short url
input video width , default 16
input video height , default 9
test more, long and short , 16:9 and 4:3
post topic , video is widescreen , so black of 4:3 .
try my mobile phone, RWD ok !
thanks , i'm come from taiwan. (not china)
my english very pool , so embarrassed
everybody can change my pool translate :P
and hope next version have new best youtube code.
my blog
http://3q.9527.tw/80