The easy embeds feature added in WordPress 2.9 allows you to directly publish a URL (a single line, plain text, without a link ).
The video in the URL is displayed on the Wordpress blog, and the video size is adjusted based on the blog layout.
However, by default, the youku video sharing website in China is not supported. I created the following plug-in based on the WordPress embeds interface, allowing your Wordpress blog to publish Youku videos through a line of links, you do not need to find the complex and troublesome Flash Embedded Code of Youku.
function wp_embed_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'] ); } return apply_filters( 'embed_youku', '<embed src="http://player.youku.com/player.php/sid/' . esc_attr($matches[1]) . '/v.swf" quality="high" width="' . esc_attr($width) . '" height="' . esc_attr($height) . '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>', $matches, $attr, $url, $rawattr ); }wp_embed_register_handler( 'youku', '#http://v.youku.com/v_show/id_(.*?).html#i', 'wp_embed_handler_youku' );
Put the above Code in the current topic'sfunctions.php
File, or add a plug-in header, upload it to the plug-in directory, and activate it.
After the installation, you only need to paste the youku video link directly into the WordPress log Content to display the video. If xxxxxxx is the video ID, the insertion method is:
Or
[Embed] http://v.youku.com/v_show/id_xxxxxxxxxxxxx.html#/embed]