embedding videos. adding videos to our website: videos can make our pages more interesting and...
Post on 24-Dec-2015
215 Views
Preview:
TRANSCRIPT
Embedding Videos
Adding Videos to Our Website: Videos can make our pages more interesting
and engaging. Most video-hosting websites, such as
YouTube, 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 YouTube Video:
To place a YouTube video into your web
page, go to the video on YouTube and click on the Share button.
Embedding a YouTube Video:
Next, click on the Embed button that
appears.
Embedding a YouTube Video:
Choose your window size or specify your
own dimensions.
Once you have specified the window size, copy and paste this code into your XHTML document.
YouTube Video Example:<body><h1>Example of Embedding a YouTube Video</h1><iframe width="480" height="390"
src="http://www.youtube.com/embed/nFoidIMqWGY?rel=0" frameborder="0" allowfullscreen></iframe>
<h2>This heading should appear below the embedded video.</h2></body>
If you wish to resize the video window on your page, you don't need to go back to YouTube and repeat the process. Just edit the
dimensions in the code, making sure to keep the same
width-to-height ratio.
Making the YouTube Code Validate:
<body><h1>Example of Embedding a YouTube Video</h1><iframe width="480" height="390"
src="http://www.youtube.com/embed/nFoidIMqWGY?rel=0" frameborder="0" allowfullscreen></iframe>
<h2>This heading should appear below the embedded video.</h2></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.
top related