Pogledajte određenu poruku
Staro 26. 09. 2010.   #1
webarto
expert
Grand Master
 
Avatar webarto
 
Datum učlanjenja: 11.04.2010
Poruke: 998
Hvala: 141
959 "Hvala" u 153 poruka
webarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished road
Default PHP YouTube Embed Function

PHP YouTube Embed Function

PHP kôd:
function youtube($id$type "standard"$w 600$h 385){
    switch(
$type){
    case 
"standard":
    return(
'<object width="'.$w.'" height="'.$h.'"><param name="movie" value="http://www.youtube.com/v/'.$id.'?fs=1&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'.$id.'?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$w.'" height="'.$h.'"></embed></object>');
    break;

    case 
"valid":
    return(
'<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/'.$id.'?fs=1&amp;hl=en_US&amp;rel=0" width="'.$w.'px" height='.$h.'px">
      <param name="movie" value="http://www.youtube.com/v/'
.$id.'?fs=1&amp;hl=en_US&amp;rel=0" />
      <param name="quality" value="high" />
      <param name="wmode" value="transparent" />
      <param name="align" value="TC" />
      <param name="scale" value="exactfit" />
    </object>'
);
    break;
    
    case 
"iframe":
    return(
'<iframe class="youtube-player" type="text/html" width="'.$w.'" height="'.$h.'" src="http://www.youtube.com/embed/'.$id.'"></iframe>');
    break;
    }

Source: http://webarto.com/57/php-youtube-embed-function
Demo: http://webarto.com/demo.php?demo=56
Code: http://sorskod.com/d30PpLJw
webarto je offline   Odgovorite uz citat