youtube embended

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    youtube embended

    But the problem was the logo, for some reason, in that player the logo is a 30~up to 60% bigger, and in fullscreen mode it uses 1/6 of the screen.
    The CL (chromeless player) already watermark the logo, so after a few hours of testing & error, I managed to embed YT videos without watermark!

    It uses the basis of the download YT FLV scripts, to obtain the random code FLV url (the "get_video" one). But cuz JW FLV Media player gives can't pass special characters as URL, it has to be in a XML playlist.
    Code:
    <?php
    function str_between($string, $start, $end){ 
    	$string = " ".$string; $ini = strpos($string,$start); 
    	if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini; 
    	return substr($string,$ini,$len); 
    }
    function get_youtube_download_link(){
    $youtube_link = "http://www.youtube.com/watch?v=".$_GET['v'];
    $youtube_page = file_get_contents($youtube_link);
    $v_id = str_between($youtube_page, "&video_id=", "&");
    $t_id = str_between($youtube_page, "&t=", "&");
    $flv_link = "http://www.youtube.com/get_video?video_id=$v_id&t=$t_id";
    
    die('<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
    	<channel>
    		<title></title>
    		<link></link>
    		<item>
    			<title></title>
    			<media:content url="'.$flv_link.'&.flv" type="video/x-flv" />
    			<media:thumbnail url="http://i.ytimg.com/vi/'.$_GET['v'].'/2.jpg" />
    		</item>
    	</channel>
    </rss>
    ');
    }
    get_youtube_download_link();
    ?>
    Now, you can embed a JW FLV Media Player with the url: "http://xxxxxxxxx.com/YT.php?v=YOUTUBEID" and it will stream directly from YouTube with no watermark.

    NOTE: As for the ToS, it contradicts with the YT API ToS. As for the content, you're owner of your videos copyrights on top of wathever YT may have. YT API allows this and the use of others players. The code itselfs doesn't modify any of the YT technologies, what it's forbidden by the ToS, and JW FLV MP is free to use on free sites.

    In short: there should not be any problem if you use it on non-commercial sites and embebbing YOUR OWN videos.
    ________________
    Jacques
    jacques@gw-designs.co.za
    http://coding.biz.tm
    Come join and lets make it a place to learn all the noobies how to code
    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

    #2
    I can tell I'm doing wrong?

    riderz,
    I can tell I'm doing wrong? ..

    Code:
    <?php 
    function str_between($string, $start, $end){  
        $string = " ".$string; $ini = strpos($string,$start);  
        if ($ini == 0) return ""; $ini += strlen($start); $len = strpos 
    
    ($string,$end,$ini) - $ini;  
        return substr($string,$ini,$len);  
    } 
    function get_youtube_download_link(){ 
    $youtube_link = "http://www.youtube.com/watch?v=".$_GET['v']; 
    $youtube_page = file_get_contents($youtube_link); 
    $v_id = str_between($youtube_page, "&video_id=", "&"); 
    $t_id = str_between($youtube_page, "&t=", "&"); 
    $flv_link = "http://www.youtube.com/get_video?video_id=$v_id&t=$t_id"; 
    
    die('<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"> 
        <channel> 
            <title></title> 
            <link></link> 
            <item> 
                <title></title> 
                <media:content url="'.$flv_link.'&.flv"  
    
    type="video/x-flv" /> 
                <media:thumbnail url="http://i.ytimg.com/vi/'.$_GET 
    
    ['v'].'/2.jpg" /> 
            </item> 
        </channel> 
    </rss> 
    '); 
    } 
    get_youtube_download_link(); 
    ?>
    Codigo HTML:

    Code:
    <embed src="player.swf" width="450"height="324" allowscriptaccess="always" allowfullscreen="true" flashvars="file=http://emprendedoresperu.com/miss15/yt.php?v=r3MWhGmXtwM" autostart="true">
    </embed>
    Error: Playlist could not be loaded due to crossdomain policy restrictions.
    Test Link: lTest


    many thanks.

    Regards,
    Giancarlo
    .
    Last edited by gcamasca; 08.03.11, 21:14.

    Comment

    Working...
    X