Bab 5: Multimedia dan Embedded Content

Bab 5: Multimedia dan Embedded Content

5.1 Audio dan Video

5.1.1 Audio Element

  1. Basic Audio Implementation

    <audio src="music.mp3" controls>
        Browser Anda tidak mendukung audio element.
    </audio>
  2. Audio dengan Multiple Sources

    <audio controls>
        <source src="music.ogg" type="audio/ogg">
        <source src="music.mp3" type="audio/mpeg">
        Browser Anda tidak mendukung audio element.
    </audio>
  3. Audio Attributes

    <audio 
        src="music.mp3"
        controls
        autoplay
        loop
        muted
        preload="auto"
    >
        Browser Anda tidak mendukung audio element.
    </audio>

5.1.2 Video Element

  1. Basic Video Implementation

  2. Video dengan Multiple Sources

  3. Video dengan Tracks

5.1.3 Media Controls

  1. Custom Controls

  2. JavaScript Media API

5.2 Embedded Content

5.2.1 iframes

  1. Basic iframe

  2. Security Attributes

5.2.2 Embedding Maps

  1. Google Maps

  2. OpenStreetMap

5.2.3 Social Media Widgets

  1. YouTube Video

  2. Twitter Timeline

5.3 Canvas dan SVG

5.3.1 Canvas Basics

5.3.2 SVG Introduction

  1. Basic Shapes

  2. Complex Paths

5.3.3 Responsive Images

  1. Picture Element

  2. Srcset Attribute

Latihan Praktik

Latihan 1: Media Player

Buat custom media player dengan:

  • Video element

  • Custom controls

  • Progress bar

  • Volume control

  • Fullscreen button

Latihan 2: Interactive Map

Buat halaman dengan:

  • Embedded Google Maps

  • Custom markers

  • Info windows

  • Location search

Latihan 3: SVG Animation

Buat animasi SVG sederhana:

  • Basic shapes

  • Path animation

  • Text effects

  • Interactivity

Ringkasan Bab

  • HTML5 menyediakan native support untuk multimedia

  • Embedded content memperkaya pengalaman user

  • Canvas untuk grafis dinamis

  • SVG untuk grafis vektor

  • Responsive images untuk optimasi

Quiz Bab 5

  1. Apa perbedaan antara Canvas dan SVG?

  2. Bagaimana cara membuat video responsive?

  3. Apa fungsi dari track element dalam video?

  4. Sebutkan atribut security penting untuk iframe!

  5. Bagaimana cara mengimplementasikan responsive images?

Referensi

Last updated

Was this helpful?