Forum Moderators: coopster

Message Too Old, No Replies

i want a help on streaming video

how to stream a video..rather strip a video

         

xtremepaul

2:12 pm on Jan 25, 2008 (gmt 0)

10+ Year Member



hi,
am new here..am not much of a coder..but i know something here and there..
i want to make a plugin for my software..
i want to load a 3rd part video from my site..
its picking n the details like the title of the video and some comments not the movie..
i will paste some codes here..can anybody help?
i took the code from an another plugin which snatches video from another site.
$vidlink="http://www.*****.com/video.php?viewid=".$smallvideocode;
$str=festa_get_contents($vidlink);
//now the main part where help needed

$pos = strpos($str, "allowScriptAccess");
$strip1=substr($str,$pos,10688);
$pos = strpos($strip1, "");
$post = strpos($strip1, ".flv")-$pos+4;
$strip2=substr($strip1,$pos,$post);
$picturelink="http://www.*****.com/".$strip2.".jpg";

if i take $post away i will get a blank player..movie not loaded..
if $post is there i will get nothing..
what must be wrong?

phparion

5:37 pm on Jan 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



what is "festa_get_contents()" function in your code? I never saw it in PHP before. Are you looking for stream_get_contents()?

xtremepaul

1:48 am on Jan 26, 2008 (gmt 0)

10+ Year Member



I think thats not the problem when i put stream.. it gave an error..
Call to undefined function: stream_file_get_contents()

phparion

5:03 am on Jan 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



it's stream_get_contents() [php.net]

of course it is the problem because you are using an unknown function unless and untill you have written the definition of that function yourself.

xtremepaul

6:20 am on Jan 26, 2008 (gmt 0)

10+ Year Member



function festa_file_get_contents($url) {

if (function_exists('curl_init')){
$ch=curl_init();
$timeout=10; // set to zero for no timeout
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$file_contents=curl_exec($ch);
curl_close($ch);
} else {
$file_contents=file_get_contents($url);
}
return $file_contents;
}

i think there s some other problem

mehh

5:59 pm on Jan 26, 2008 (gmt 0)

10+ Year Member



you've defined the function festa_file_get_contents but are calling festa_get_contents. change one or the other

xtremepaul

3:02 am on Jan 27, 2008 (gmt 0)

10+ Year Member



i didnt get you can u plz explain to me about what you said?
change one or the other

jatar_k

12:39 pm on Jan 27, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the function name in your 3rd post is "festa_file_get_contents"

in your first post your code calls "festa_get_contents"

those are not the same, so either there is some other function called "festa_get_contents" or you are just calling the wrong name

xtremepaul

2:03 pm on Jan 27, 2008 (gmt 0)

10+ Year Member



sorry it is
"festa_file_get_contents"
yes it was a mistake not to type _file in my first post.