Jump to content

Embed Video Problem


Graxeon

Recommended Posts

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 :)

Link to comment
https://forums.phpfreaks.com/topic/183163-embed-video-problem/
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/183163-embed-video-problem/#findComment-966764
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/183163-embed-video-problem/#findComment-966945
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.