Embedding Videos Adding Videos to Our Website n
Embedding Videos
Adding Videos to Our Website: n n n Videos can make our pages more interesting and engaging. Most video-hosting websites, such as You. Tube, will provide us with code to copy and paste into our web page. Video-embedding code might not be XHTML valid, requiring us to make changes before the page will pass validation.
Embedding a You. Tube Video: To place a You. Tube video into your web page, go to the video on You. Tube and click on the Share button.
Embedding a You. Tube Video: Next, click on the Embed button that appears.
Embedding a You. Tube Video: Once you have specified the window size, copy and paste this code into your XHTML document. Choose your window size or specify your own dimensions.
You. Tube Video Example: <body> <h 1>Example of Embedding a You. Tube Video</h 1> <iframe width="480" height="390" src="http: //www. youtube. com/embed/n. Foid. IMq. WGY? rel=0" frameborder="0" allowfullscreen></iframe> <h 2>This heading should appear below the embedded video. </h 2> </body> If you wish to resize the video window on your page, you don't need to go back to You. Tube and repeat the process. Just edit the dimensions in the code, making sure to keep the same width-to-height ratio.
Making the You. Tube Code Validate: <body> <h 1>Example of Embedding a You. Tube Video</h 1> <iframe width="480" height="390" src="http: //www. youtube. com/embed/n. Foid. IMq. WGY? rel=0" frameborder="0" allowfullscreen></iframe> <h 2>This heading should appear below the embedded video. </h 2> </body> Attempting to validate this page results in the above error. We can fix this simply by deleting "allowfullscreen" from the code. This has no difference to how our page looks but our page will now pass validation.
- Slides: 7