Saturday, March 10, 2012

Display multiple youtube videos in one frame using iframe


You  may not want to embed a lot of  YouTube videos in one post using YouTube embed function. You can use iframe  to display multiple YouTube videos in a frame to save space.
Below is the same code, result displayed after the code:

<table align="center" border="1" cellpadding="0" cellspacing="0" style="background: #52C9CB; border: #64f1f3 1px solid; color: #555555; text-align: center; width: 600px;"><tbody>
<tr>
<td><a href="http://www.youtube.com/v/4oSCuEtxRK8" target="frame138">Part 1</a></td>
<td><a href="http://www.youtube.com/v/y7ae_cZahPs" target="frame138">Part 2</a></td>
<td><a href="http://www.youtube.com/v/IUCEEh-ASH8" target="frame138">Part 3</a></td>
<td><a href="http://www.youtube.com/v/W1zaEiZawsI" target="frame138">Part 4</a></td>
<td><a href="http://www.youtube.com/v/ZNqAOzgS370" target="frame138">Part 5</a></td>
 <td><a href="http://www.youtube.com/v/ZNqAOzgS370" target="frame138">Part 6</a>
</td>
 </tr>
</tbody></table>
<iframe height="600" name="frame138" src="http://www.youtube.com/v/4oSCuEtxRK8" width="100%"></iframe>


Tips:
1. YouTube videos address format  should be similar to http://www.youtube.com/v/4oSCuEtxRK8

2.  Target name and iframe  name (here is frame138) should be the same in one post, but should be different for different posts.

Below is the result: (Click part 1 to part 6, display  in the same frame)
Video:PHP Tutorials: Register & Login: User login
Part of the 'Register & Login' Project from phpcademy. This tutorials walks you through how to process a username and password based login against details found in a database, set a session, and process a logout function. Phpcademy Official website: http://phpacademy.org

Part 1 Part 2 Part 3 Part 4 Part 5 Part 6

1 comment:

  1. Is there a way to add the description of the video below?

    ReplyDelete