Graxeon Posted November 27, 2009 Share Posted November 27, 2009 Hey, thanks for looking! File to be embedded: <playlist version="1"> <trackList> <track> <title>SOCCER - RAINBOW</title> <location>http://www.site.com/soccer-rainbow.m4v</location> <duration>23:27</duration> <info> http://www.site.com/info.php?video=RAINBOW&title=SOCCER </info> <meta rel="type">m4v</meta> <image> images.php?title=SOCCER&video=RAINBOW </image> </track> <track> <title>SOCCER</title> <location/> <meta rel="type"/> </track> </trackList> </playlist> Embed code called by "embed.php?p=SOCCER&z=RAINBOW": <?php $title = $_GET['p']; $video = $_GET['z']; $url2='http://www.site.com/media.php?title='.$title.'&video='.$video; $sxml = simplexml_load_file($url2); list($node) = $sxml->xpath('/playlist/tracklist/track/location'); header('Location: '.$node); ?> I didn't write it too well, though :/. I just get a blank page. Can someone please help me fix it? Also, I'm trying to limit usage on this embed script. I want only specified inputs to work with the script. For example, in this script I define exactly what is allowed and the rest give a blank page: <?php if (isset($_GET['url'])) { $converter = array('blankspot' => 'blanks', 'SOCCERRAINBOW' => 'futbolyllber', 'blankspothere' => 'blank'); $url = $_GET['url']; if (isset($converter[$url])) { //The actual execution code takes place here header('Location: '.$node['url']); exit; } } ?> How can I do the same thing for the first script? Thanks for helping Quote Link to comment https://forums.phpfreaks.com/topic/183163-embed-video-problem/ Share on other sites More sharing options...
Graxeon Posted November 27, 2009 Author Share Posted November 27, 2009 P.S. The 2nd question is as important. I can do it in a separate file, I just don't know how to do it exactly in just 1 file. I need more help on the 1st script to go forward Quote Link to comment https://forums.phpfreaks.com/topic/183163-embed-video-problem/#findComment-966647 Share on other sites More sharing options...
Graxeon Posted November 28, 2009 Author Share Posted November 28, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/183163-embed-video-problem/#findComment-966732 Share on other sites More sharing options...
Graxeon Posted November 28, 2009 Author Share Posted November 28, 2009 I modified the code a little bit...but I still get a blank page. Idk why :/ <?php $title = $_GET['p']; $video = $_GET['z']; $url='http://www.site.com/media.php?title='.$title . '&video='.$video ; $string = file_get_contents($url); $sxml = new SimpleXmlElement($string); $node = $sxml->playlist/trackList/track/location; header('Location: '.$node); ?> Can anyone see the problem? Quote Link to comment https://forums.phpfreaks.com/topic/183163-embed-video-problem/#findComment-966764 Share on other sites More sharing options...
Graxeon Posted November 28, 2009 Author Share Posted November 28, 2009 Umm...do I need to clarify my question? I hope Im not confusing anyone xD Quote Link to comment https://forums.phpfreaks.com/topic/183163-embed-video-problem/#findComment-966929 Share on other sites More sharing options...
megaresp Posted November 28, 2009 Share Posted November 28, 2009 Do you need to embed in this way? After much hair pulling, swearing, cursing and muttering, I decided to start using an open source 3rd party product. I use Flowplayer. See this webpage for an example in the wild. Flowplayer solved the following problems for me across a variety of sites... Users missing the required codec for a particular format Some mac users unable to view windows media player files Some PC users unable to view embedded Quicktime A variety of different formats on one site, requiring extra code able to write the correct embedding code for the file type Quote Link to comment https://forums.phpfreaks.com/topic/183163-embed-video-problem/#findComment-966945 Share on other sites More sharing options...
Graxeon Posted November 28, 2009 Author Share Posted November 28, 2009 Sorry, I'm not using that flash player. I'm just trying to embed that XML file through a script Thanks for the link though, I may use it for other purposes Quote Link to comment https://forums.phpfreaks.com/topic/183163-embed-video-problem/#findComment-966947 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.