// add youku using iframe
function
wp_iframe_handler_youku(
$matches
,
$attr
,
$url
,
$rawattr
) {
// If the user supplied a fixed width AND height, use it
if
( !
empty
(
$rawattr
[
'width'
]) && !
empty
(
$rawattr
[
'height'
]) ) {
$width
= (int)
$rawattr
[
'width'
];
$height
= (int)
$rawattr
[
'height'
];
}
else
{
list(
$width
,
$height
) = wp_expand_dimensions( 480, 400,
$attr
[
'width'
],
$attr
[
'height'
] );
}
$iframe
=
'<iframe width='
. esc_attr(
$width
) .
' height='
. esc_attr(
$height
) .
' src="http://player.youku.com/embed/'
. esc_attr(
$matches
[1]) .
'" frameborder=0 allowfullscreen></iframe>'
;
return
apply_filters(
'iframe_youku'
,
$iframe
,
$matches
,
$attr
,
$url
,
$ramattr
);
}
wp_embed_register_handler(
'youku_iframe'
,
'#http://v.youku.com/v_show/id_(.*?).html#i'
,
'wp_iframe_handler_youku'
);
// add tudou using iframe
function
wp_iframe_handler_tudou(
$matches
,
$attr
,
$url
,
$rawattr
) {
// If the user supplied a fixed width AND height, use it
if
( !
empty
(
$rawattr
[
'width'
]) && !
empty
(
$rawattr
[
'height'
]) ) {
$width
= (int)
$rawattr
[
'width'
];
$height
= (int)
$rawattr
[
'height'
];
}
else
{
list(
$width
,
$height
) = wp_expand_dimensions( 480, 400,
$attr
[
'width'
],
$attr
[
'height'
] );
}
$iframe
=
'<iframe width='
. esc_attr(
$width
) .
' height='
. esc_attr(
$height
) .
' src="http://www.tudou.com/programs/view/html5embed.action?code='
. esc_attr(
$matches
[1]) .
'" frameborder=0 allowfullscreen></iframe>'
;
return
apply_filters(
'iframe_tudou'
,
$iframe
,
$matches
,
$attr
,
$url
,
$ramattr
);
}
wp_embed_register_handler(
'tudou_iframe'
,
'#http://www.tudou.com/programs/view/(.*?)/#i'
,
'wp_iframe_handler_tudou'
);