Jump to content

Displaying videos problem


graham23s

Recommended Posts

Hi GUys,

 

1 thing i seem to still have a problem with is the modulous part of php i have a random video from you tube like :

 

<?php

  ## video for testing
  $video = '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/w_1516P6zE8"></param>
            <param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/w_1516P6zE8" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355">
            </embed></object>';
            
  ## show 2 ontop of each other

?>

 

i was wanting to display my videos like:

 

Video 1 Video 2

Video 3 Video 4

 

can anyone tell me the best way or point me to a tutorial , anything would be great.

 

thanks guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/75077-displaying-videos-problem/
Share on other sites

Hi Mate,

 

thanks for the link, i tried this:

 

<?php

  ## video for testing
  $video = '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/w_1516P6zE8"></param>
            <param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/w_1516P6zE8" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355">
            </embed></object>';
            
  ## show 2 ontop of each other
  $i = 0;
  
  echo '<table align="center">';
  
  if ($i==0) {
  
  echo '<tr><td>'.$video.'</td>';
  
  } else {

  echo '<td>'.$video.'</td></tr>';
  
  } 

  $i++; $i=$i % 2;
  
  echo '</table>';
?>

 

to basically show the same video 4 times, but it only shows it once am i missing somehting in my code at all?

 

thanks guys

 

Graham

Yes, you don't have a loop. Try:

 

<?php

  ## video for testing
  $video = '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/w_1516P6zE8"></param>
            <param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/w_1516P6zE8" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355">
            </embed></object>';
            
  ## show 2 ontop of each other
  $i = 0;
  
  echo '<table align="center">';
  for($x=0;$x<4;$x++){
  if ($i==0) {
  
  echo '<tr><td>'.$video.'</td>';
  
  } else {

  echo '<td>'.$video.'</td></tr>';
  
  } 

  $i++; $i=$i % 2;
  }
  echo '</table>';
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.