Chapter 2: Audio and Video Elements - Examples

  1. Listing 2-1/2-2/2-3: Video Element with @src (mpeg, ogg, webm)
  2. Listing 2-4: Legacy Browser fallback (video with legacy text)
  3. Listing 2-5: Video Element with full HTML page (mpeg, ogg, webm)
  4. Listing 2-6: Video Element with @autoplay (mpeg, ogg, webm)
  5. Listing 2-7: Video Element with @autoplay and @loop (mpeg, ogg, webm)
  6. Listing 2-8: Video Element with @poster (mpeg, ogg, webm)
  7. Listing 2-9: Video Element with @width, @height (mpeg, ogg, webm)
  8. Listing 2-10: Video Element with @width, @height and incorrect aspect ratio (mpeg, ogg, webm)
  9. Listing 2-11: Video Element with @controls (mpeg, ogg, webm)
  10. Listing 2-12/2-13/2-14: Video Element with @preload (mpeg, ogg, webm)
  11. Listing 2-15/2-16/2-17: Audio Element with @src (wav/ogg/mp3)
  12. Listing 2-18: Audio Element with @autoplay (wav, ogg, mp3)
  13. Listing 2-19: Audio Element with @autoplay and @loop (wav/ogg/mp3)
  14. Listing 2-20: Audio Element with @controls (wav/ogg/mp3)
  15. Listing 2-21/2-22/2-23: Audio Element with @preload (wav, ogg, mp3)
  16. Listing 2-24/2-25: Source element with video and audio elements
  17. Listing 2-26/2-27: Source element with @type for video/audio
  18. Listing 2-28: Video MIME types supported by browser
  19. Listing 2-29: Audio MIME types supported by browser
  20. Video Element with @media query for mobile devices