Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing a fixed size from embedding a clip

Status
Not open for further replies.

DaSe

Programmer
Feb 14, 2008
149
GB
Hello guys....

Here I have a piece of code that goes like this:
Code:
<?php 
function embedVideo($url){ 
    if(preg_match("#[URL unfurl="true"]http://(.*)\.youtube\.com/watch\?v=(.*)(&(.*))?#",[/URL] $url, $matches)){ 
        ?> 
        <object width="300" height="169"> 
        <param name="movie" value="[URL unfurl="true"]http://www.youtube.com/v/<?php[/URL] echo $matches[2];?>&hl=en&fs=1"></param> 
        <param name="allowFullScreen" value="false"></param> 
        <param name="allowscriptaccess" value="always"></param> 
        <embed src="[URL unfurl="true"]http://www.youtube.com/v/<?php[/URL] echo $matches[2];?>&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="false" width="300" height="169" autostart="1"></embed> 
           </object> 
       <?php 
    }elseif(preg_match("#[URL unfurl="true"]http://www\.metacafe\.com/watch/(([/URL][^/].*)/([^/].*))/?#", $url, $matches)){ 
        ?> 
        <embed flashVars="playerVars=showStats=no|autoPlay=yes|videoTitle="  src="[URL unfurl="true"]http://www.metacafe.com/fplayer/<?php[/URL] echo $matches[1];?>.swf" width="300" height="169" wmode="transparent" pluginspage="[URL unfurl="true"]http://www.macromedia.com/go/getflashplayer"[/URL] type="application/x-shockwave-flash"> </embed> 
       <?php 
    } 
} 


$youtubeVideo1 = $speakShow;
embedVideo($youtubeVideo1); 

$metacafeVideo1=$speakShow;
embedVideo($metacafeVideo1);
?>

The problem is that if someone decides to embed a clip of a large ratio from you tube - it will appear large - I've been trying to change the width in this code but it looks like it's always overlayed by the embedded clip sizes. I want every clip on my page to have width="300" height="169" - how can I do this ? The next frustrating issue is ( after 100 tries ) the clips don't autostart / autoplay at all...I've tried to use autostart=1 or a=1...I'd be grateful for any comments..Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top