function emvideo_ustreamlive_extract in Embedded Media Field 6.3
Same name and namespace in other branches
- 6 contrib/emvideo/providers/ustreamlive.inc \emvideo_ustreamlive_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/ ustreamlive.inc, line 96
Code
function emvideo_ustreamlive_extract($embed = '') {
// <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="320" id="utv654382"><param name="flashvars" value="viewcount=false&autoplay=false&brand=embed"/><param name="allowfullscreen" value="true"/><param name="allowscriptaccess" value="always"/><param name="movie" value="http://www.ustream.tv/flash/live/240437"/><embed flashvars="viewcount=false&autoplay=false&brand=embed" width="400" height="320" allowfullscreen="true" allowscriptaccess="always" id="utv654382" name="utv_n_741085" src="http://www.ustream.tv/flash/live/240437" type="application/x-shockwave-flash" /></object><a href="http://www.ustream.tv/" style="padding:2px 0px 4px;width:400px;background:#FFFFFF;display:block;color:#000000;font-weight:normal;font-size:10px;text-decoration:underline;text-align:center;" target="_blank">Stream videos at Ustream</a>
return array(
'@ustream\\.tv/flash/live/([^"\\&\\?]+)@i',
);
}