Ahh, por lo que significa que usted desea conectar los videos en tu propio sitio. Creo que veo ahora.
Metí la pata con el código, lo que está tratando de hacer aquí no funciona con sitios de vídeo válido zShare. Si introduce una dirección incorrecta, zShares 404 se comporta como se espera - se carga en el iframe y se posiciona correctamente, sin embargo, cuando lo probé con una identificación real, su página rompió el iFrame.
Estas dos líneas de Javascript que incluyen en sus páginas de vídeos están haciendo cuál es su página de estallar.
if (top != self) {
top.location = self.location;
-
- if (top != self) {
- top.location = self.location;
-
Usted no será capaz de cargar sus páginas en iframes. Youre que va a necesitar un enfoque diferente de la cuestión, y no soy del todo seguro de que usted puede cargar sus vídeos directamente, bien. Theres un poco peludo de theyre lógica utilizando para confundir a sus enlaces de vídeo.
EDIT: Idea de último momento - Usted
podría
<html>
<head>
<title></title>
</head>
<body>
<form action="test.php" method="get">
<input type="text" name="id" size="20" length="20" value="" />
<br />
<input type="submit" value="submit" />
</form>
</body>
</html>
-
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <form action="test.php" method="get">
- <input type="text" name="id" size="20" length="20" value="" />
- <br />
- <input type="submit" value="submit" />
- </form>
- </body>
- </html>
-
Analizar y de vídeo de pantalla basados en el ID (tenga en cuenta el cambio en el patrón - todos los identificadores que vi eran 14 dígitos):
<?php
// note that this code presumes that a host site uses the format of:
// [h]ttp://www.someVideoHostAddress.net/video/1947d20fe83a19 (14 digit/letter mix)
function ValidateID($ID='')
{
return preg_match('#^[0-9a-z]{14}$#i',$ID);
}
$MovieID = $_REQUEST['id'];
$bool = ValidateID($MovieID);
if(ValidateID($MovieID))
{
//pull in the source of the target video page
$url = "http://www.someVideoHostAddress.net/video/".$MovieID;
$stream = file_get_contents($url);
//extract the object tag from the source code
$pattern = '/(<object[^>]*?>(?:[\s\S]*?)<\/object>)/si';
$result = preg_match($pattern, $stream, $matches);
//convert relative paths to absolute
$out = $matches[0];
$out = str_replace("name=\"URL\" value=\"", "name=\"URL\" value=\"http://www.someVideoHostAddress.net/", $out);
$out = str_replace("name=\"Player\" src=\"", "name=\"Player\" src=\"http://www.someVideoHostAddress.net/", $out);
?>
<html>
<head>
<title></title>
</head>
<body>
<?php echo $out; ?>
</body>
</html>
<?php
}
?>
-
- <?php
-
- // note that this code presumes that a host site uses the format of:
- // [h]ttp://www.someVideoHostAddress.net/video/1947d20fe83a19 (14 digit/letter mix)
-
- function ValidateID($ID='')
- {
- return preg_match('#^[0-9a-z]{14}$#i',$ID);
- }
-
- $MovieID = $_REQUEST['id'];
- $bool = ValidateID($MovieID);
- if(ValidateID($MovieID))
- {
- //pull in the source of the target video page
- $url = "http://www.someVideoHostAddress.net/video/".$MovieID;
- $stream = file_get_contents($url);
-
- //extract the object tag from the source code
- $pattern = '/(<object[^>]*?>(?:[\s\S]*?)<\/object>)/si';
- $result = preg_match($pattern, $stream, $matches);
-
- //convert relative paths to absolute
- $out = $matches[0];
- $out = str_replace("name=\"URL\" value=\"", "name=\"URL\" value=\"http://www.someVideoHostAddress.net/", $out);
- $out = str_replace("name=\"Player\" src=\"", "name=\"Player\" src=\"http://www.someVideoHostAddress.net/", $out);
- ?>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <?php echo $out; ?>
- </body>
- </html>
- <?php
- }
- ?>
-
I'd love to change the world, but they won't give me the source code.