Foren / Cotonti / Extensions / Working on a plugin...

Mynt
#17439 4. Oktober 2009, 02:08
To help out here is some resource links I gathered for you:

FLV PLAYER:
http://www.osflv.com/

This will help you learn about API in the documentation for sending flash vars to the SWF.

For the Player itself, I highly reccomend:
http://www.longtailvideo.com/players/jw-flv-player/

As it supports a multitude of flash media

As for your URL stripper, heres something for Youtube.. Note it might have to be editted but you get the jist:

function get_link($url){ 
if ($html = file_get_contents($url)){ 
if(preg_match_all("/\b(?:video_id)\b:.*/", $html, $matches)){ 
$ref = $matches[0][0]; 
//echo $ref.'<br>'; 
preg_match_all("/\'[^\'\\\\\r\n]*(?:\\\\.[^\'\\\\\r\n]*)*\'/", $ref, $match); 
//video_id:'WAvj0iY1Zig',l:'142',t:'OEgsToPDskLspgdtd49MOElkAv_WEJmW',sk:'2ZgBZFfneV2DzW3Zb8g2AAC1 
//print_r ($match); 
$id1 = str_replace("'", "", $match[0][0]); 
$id2 = str_replace("'", "", $match[0][2]); 
$id3 = str_replace("'", "", $match[0][3]); 
$id = $id1.'&t='.$id2.'&sk='.$id3; 
//echo $id; 
$url = 'http://youtube.com/get_video.php?video_id='.$id; 
$url = get_headers($url); 
//$url = print_r($url); 
$url = $url[9]; 
//echo $id; 
$url = substr($url,10); 
$url = $url.'.flv'; 

//echo $url; 
return $url; 
} 
return false; 
} 
} 

And ofcourse heres something you can part through to find out how each url from a variety of places parse there media.

http://userscripts.org/scripts/review/47636


Hope this helps out!

-Mynt
"I only sleep when I know I won't miss a thing."