HTML

Cara Embed Video Dari Google Drive

Google Drive bukan hanya untuk menyimpan file, tapi juga bisa digunakan untuk hosting video yang bisa di-embed ke website. Ini sangat berguna karena Google Drive menawarkan storage gratis hingga 15GB dan bandwidth yang cepat.

Mengapa Embed Video dari Google Drive?

  • Gratis hingga 15GB storage
  • Bandwidth cepat dan stabil
  • Tidak perlu hosting video sendiri
  • Mudah dikelola dan diorganisir
  • Support berbagai format video (MP4, AVI, MOV, dll)

Step 1: Upload Video ke Google Drive

Buka Google Drive (drive.google.com) dan klik tombol Baru > Upload File. Pilih video yang ingin di-upload. Tunggu hingga upload selesai. Ukuran maksimal file adalah 5TB.

Step 2: Atur Sharing Video

Klik kanan pada video yang sudah di-upload dan pilih Bagikan. Ubah akses menjadi Siapa saja yang memiliki link. Ini penting agar video bisa diakses dari website.

Step 3: Dapatkan File ID

Buka video di Google Drive dan perhatikan URL di browser. File ID adalah string setelah /d/ dan sebelum /view. Contoh: https://drive.google.com/file/d/FILE_ID_DISINI/view

Step 4: Embed dengan iframe

Gunakan kode HTML berikut untuk embed video:

<iframe src="https://drive.google.com/file/d/FILE_ID/preview" 
    width="640" height="480" 
    allow="autoplay" 
    allowfullscreen>
</iframe>

Step 5: Responsive Embed

Untuk membuat video responsive (menyesuaikan ukuran layar):

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
<div class="video-container">
    <iframe src="https://drive.google.com/file/d/FILE_ID/preview" 
        allow="autoplay" allowfullscreen>
    </iframe>
</div>

Customisasi Embed

Anda bisa menambahkan parameter untuk mengontrol tampilan:

  • autoplay=1: Video otomatis play
  • loop=1: Video loop terus
  • mute=1: Video tanpa suara
<iframe src="https://drive.google.com/file/d/FILE_ID/preview?autoplay=1&loop=1&mute=1" 
    width="640" height="480" allow="autoplay" allowfullscreen>
</iframe>

Troubleshooting

  • Video tidak muncul: Pastikan sharing diatur ke Siapa saja
  • Loading lama: Kompres video sebelum upload
  • Tidak bisa autoplay: Browser modern memblokir autoplay dengan suara
  • Error quota exceeded: Video terlalu banyak diakses, gunakan YouTube sebagai alternatif

Kesimpulan

Embed video dari Google Drive adalah solusi gratis dan mudah untuk menampilkan video di website. Cocok untuk tutorial, presentasi, atau konten video lainnya tanpa perlu hosting video sendiri.


You may also like


0 Comments


Leave a Reply

Scroll to Top