hvis du har et link til youtube kan du vel bare embedde youtube playeren.
- $YTLinkFraDB = "http://www.youtube.com/watch?v=Ho4TPTa_J7g";
-
- function YouTubeVideoCode($url){
-
- if(strstr($url, "?v=")){
- return array_pop(explode("?v=",(strstr($url,"&")?array_shift(explode("&",$url)):$url)));
- }
- else if(strstr($url, "&v=")){
- $parts = explode("&", $url);
- foreach($parts as $part){
- if(strstr($part, "v=")){
- return array_pop(explode("v=", $part));
- }
- }
- }
- else if(strstr($url, "youtu.be")){
- return array_pop(explode("/", $url));
- }else if(strstr($url, "/embed")){
- return array_pop(explode("/", $url));
- }
-
- }
- ?>
- <html>
- <head></head>
- <body>
- <h1>Youtube</h1>
- <?php
- echo '<iframe style="opacity: 0; position: absolute; top: -99999px; left: -99999px;" width="560" height="315" src="http://www.youtube.com/embed/'.YouTubeVideoCode($YTLinkFraDB).'?autoplay=1" frameborder="0" allowfullscreen></iframe>';
- ?>
- </body>
- </html>
noget i den stil
Indlæg senest redigeret d. 11.07.2012 16:54 af Bruger #3427