Search code examples
htmlvideoxhtmlw3c

Following w3c best practice video solution with youtube <iframe> embed code


According to w3schools, the best HTML solution for embedding videos directly into a web app is to use the video, object, and embed tags to deal with various issues inherent in video embedding. However, the next chapter after shows an example that embeds a youtube video with the standard youtube embed code that uses the iframe tag. Why is it that w3schools is not implementing their own solution into their youtube example? Thanks in advance.

Edit: Fixed my error by renaming w3c to w3schools


Solution

  • W3schools is not W3C.

    The two methods explained on the site are different solutions to a common problem, adding a video to your site. Both have their pros and cons: for example, YouTube will host the video for you, but if you want to use the HTML video-tag, you will have to upload it to your server or some other web storage.

    It's up to you what solution to use.