@Tankey, default MyBB youtube video parser uses <iframe> - see video_youtube_embed template.
@|FBI|MMFB, add this as new MyCode in ACP -> Configuration (square bracket code as Regular Expression, HTML as Replacement). Then use in post like other BBCodes.
@hiig, you can edit the MyBB parser (inc/class_parser.php). First this line:
$message = preg_replace("#\[video=(.*?)\](.*?)\[/video\]#ei", "\$this->mycode_parse_video('$1', '$2');", $message);
Would have to change the regex so it contains also optional start=[youtube time format].
Then edit this function:
function mycode_parse_video($video, $url)
{
global $templates;
if(empty($video) || empty($url))
{
return "[video={$video}]{$url}[/video]";
}
$parsed_url = @parse_url(urldecode($url));
if($parsed_url == false)
{
return "[video={$video}]{$url}[/video]";
}
$fragments = array();
if($parsed_url['fragment'])
{
$fragments = explode("&", $parsed_url['fragment']);
}
$queries = explode("&", $parsed_url['query']);
$input = array();
foreach($queries as $query)
{
list($key, $value) = explode("=", $query);
$key = str_replace("amp;", "", $key);
$input[$key] = $value;
}
$path = explode('/', $parsed_url['path']);
switch($video)
{
case "dailymotion":
list($id, ) = split("_", $path[2], 1); // http://www.dailymotion.com/video/fds123_title-goes-here
break;
case "metacafe":
$id = $path[2]; // http://www.metacafe.com/watch/fds123/title_goes_here/
$title = htmlspecialchars_uni($path[3]);
break;
case "myspacetv":
$id = $path[4]; // http://www.myspace.com/video/fds/fds/123
break;
case "yahoo":
$id = $path[1]; // http://xy.screen.yahoo.com/fds-123.html
// Support for localized portals
$domain = explode('.', $parsed_url['host']);
if($domain[0] != 'screen')
{
$local = $domain[0].'.';
}
else
{
$local = '';
}
break;
case "vimeo":
$id = $path[1]; // http://vimeo.com/fds123
break;
case "youtube":
if($fragments[0])
{
$id = str_replace('!v=', '', $fragments[0]); // http://www.youtube.com/watch#!v=fds123
}
elseif($input['v'])
{
$id = $input['v']; // http://www.youtube.com/watch?v=fds123
}
else
{
$id = $path[1]; // http://www.youtu.be/fds123
}
break;
default:
return "[video={$video}]{$url}[/video]";
}
if(empty($id))
{
return "[video={$video}]{$url}[/video]";
}
$id = htmlspecialchars_uni($id);
eval("\$video_code = \"".$templates->get("video_{$video}_embed")."\";");
return $video_code;
}
to take the start time into consideration and in case it's youtube video, write it to variable.
And lastly edit the mentioned template and add the time variable to <iframe>.