You are here

function emvideo_livevideo_extract in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 contrib/emvideo/providers/livevideo.inc \emvideo_livevideo_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/livevideo.inc, line 83
This include processes livevideo media files for use by emfield.module.

Code

function emvideo_livevideo_extract($embed = '') {

  // <div><embed src="http://www.livevideo.com/flvplayer/embed/591C1350DD174FE0B10C4DCFC88981DA" type="application/x-shockwave-flash" quality="high" WIDTH="445" HEIGHT="369" wmode="transparent"></embed><br/><a href="http://www.livevideo.com/video/embedLink/591C1350DD174FE0B10C4DCFC88981DA/236172/mascot-bloopers-video.aspx">Mascot Bloopers Video</a></div>
  // http://www.livevideo.com/video/591C1350DD174FE0B10C4DCFC88981DA/mascot-bloopers-video.aspx
  // NOTE: the order of the following matters very much in this case...
  return array(
    '@livevideo\\.com/flvplayer/embed/([^\\"]*)\\"@i',
    '@livevideo\\.com/video/([^/]*)/@i',
  );
}