what is wrong to this code?
header('Content-type: application/x-shockwave-flash');
$video_id = $_REQUEST['id'];
$content = readfile("http://www.youtube.com/watch?v=$video_id");
echo $content;
Why this code is not working? How should look the code?
i’ve edited like this:
header('Content-type: application/x-shockwave-flash');
$video_id = $_REQUEST['id'];
$content = readfile("http://www.youtube.com/v/$video_id");
echo $content;
and if i get http://localhost/media.php?id=pkyRRD9f0ts in browser it works but if i add it in jwplayer it doesn’t work 🙁
That’s because you’re pulling the entire webpage as you would view it in a browser, not just the video file (youtube specifically doesn’t allow that).
Try echoing an embed html tag instead.