function emvideo_tudou_extract in Embedded Media Field 6
Same name and namespace in other branches
- 6.3 contrib/emvideo/providers/tudou.inc \emvideo_tudou_extract()
hook emvideo_PROVIDER_extract this is called to extract the video code from a pasted URL or embed code.
Parameters
$embed: an optional string with the pasted URL or embed code
Return value
either an array of regex expressions to be tested, or a string with the video code to be used if the hook tests the code itself, it should return either the string of the video code (if matched), or an empty array. otherwise, the calling function will handle testing the embed code against each regex string in the returned array.
File
- contrib/
emvideo/ providers/ tudou.inc, line 57 - Provide support for the Tudou provider to the emfield.module.
Code
function emvideo_tudou_extract($embed = '') {
// http://www.tudou.com/programs/view/uprLNXyEGpc/
// <object width="400" height="300"><param name="movie" value="http://www.tudou.com/v/uprLNXyEGpc"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed src="http://www.tudou.com/v/uprLNXyEGpc" type="application/x-shockwave-flash" width="400" height="300" allowFullScreen="true" wmode="transparent" allowScriptAccess="always"></embed></object>
return array(
'@tudou\\.com/programs/view/([^"\\&/]+)@i',
'@tudou\\.com/v/([^"\\&/]+)@i',
);
}