Re: Youtube
Enviado: 28 Jun 2011, 17:43
Gsilva, e se eu for utilizar o outro codigo, o que pega os dois?
Os videos que já estão publicados deixarão de funcionar?
Os videos que já estão publicados deixarão de funcionar?
Código: Selecionar todos
http://youtu.be/fZxbP3sFUrk
http://www.youtube.com/watch?v=fZxbP3sFUrk
Código: Selecionar todos
fZxbP3sFUrk
Código: Selecionar todos
[youtube]{content}[/youtube]
Código: Selecionar todos
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{content}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{content}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
Código: Selecionar todos
<?php
//Simple code for returning an "embed" link, for youtube.
//works mostly with the iframe method.
if(isset($_GET['url'])) {
$url = $_GET['url'];
//Strip out the url itself,
//
$url = str_replace("https://", "", $url);
$url = str_replace("http://", "", $url);
$url = str_replace("www.", "", $url);
//
$url = str_replace("youtube.com/watch?v=", "", $url);
$url = str_replace("youtube.com/v/", "", $url);
$url = str_replace("youtu.be/", "", $url);
//probably in effecient, but i'm too lazy to look up a better way.. so...
$params = split("&", $url);
$embed = $params[0];
//Basically, it'll split the remnants by the "&"s found in the string. We only need the first instance, as the rest
//are just arguements for the video, that aren't compatible in this form.
echo "http://www.youtube.com/embed/".$embed;
//header('Location: http://www.youtube.com/embed/'.$embed );
//and viola!
}; ?>
Código: Selecionar todos
<iframe width="420" height="315" src="embed_youtube.php?url={SIMPLETEXT}" frameborder="0"></iframe>
rohde escreveu:tb estou com um problema como o citado pelo colega acima...
eu vi em um forum de fora q eles usam um iframe apontado para um php que da um output no player porem ele nao funciona direito
vou deixar o código pra vcs, se alguem souber arrumar..
subs. do htmlCódigo: Selecionar todos
<?php //Simple code for returning an "embed" link, for youtube. //works mostly with the iframe method. if(isset($_GET['url'])) { $url = $_GET['url']; //Strip out the url itself, // $url = str_replace("https://", "", $url); $url = str_replace("http://", "", $url); $url = str_replace("www.", "", $url); // $url = str_replace("youtube.com/watch?v=", "", $url); $url = str_replace("youtube.com/v/", "", $url); $url = str_replace("youtu.be/", "", $url); //probably in effecient, but i'm too lazy to look up a better way.. so... $params = split("&", $url); $embed = $params[0]; //Basically, it'll split the remnants by the "&"s found in the string. We only need the first instance, as the rest //are just arguements for the video, that aren't compatible in this form. header('Location: http://www.youtube.com/embed/'.$embed ); //and viola! }; ?>
Código: Selecionar todos
<iframe width="420" height="315" src="embed_youtube.php?url={SIMPLETEXT}" frameborder="0"></iframe>
_Vinny_ escreveu:rohde, qual que é o problema?