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.

Kenapa 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

kamu 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.

Kenapa Embed Video dari Google Drive?

Google Drive menawarkan solusi hosting video yang hemat biaya untuk website. Dibandingkan mengupload video langsung ke server, embed dari Google Drive memiliki beberapa keuntungan:

  • Hemat bandwidth server - Video di-stream dari server Google, bukan dari server kamu
  • Penyimpanan gratis - Google Drive menyediakan 15GB storage gratis
  • Kualitas adaptif - Google otomatis menyesuaikan kualitas video berdasarkan koneksi pengguna
  • Mudah dikelola - Upload, edit, atau hapus video langsung dari Google Drive

Langkah-Langkah Embed

Berikut cara mengembed video dari Google Drive ke website:

  1. Upload video - Upload video ke Google Drive kamu
  2. Atur sharing - Klik kanan file video > Share > General access > Pilih "Anyone with the link"
  3. Salin link - Copy link sharing video dari Google Drive
  4. Ekstrak file ID - Dari URL, ambil file ID (bagian setelah /d/ dan sebelum /view)
  5. Buat embed URL - Gunakan format: https://drive.google.com/file/d/FILE_ID/preview

Contoh Kode Embed

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

Ganti FILE_ID dengan ID file video kamu. Contoh lengkap:

<!-- Responsive video container -->
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
  <iframe 
    src="https://drive.google.com/file/d/1aBcDeFgHiJkLmNoPqRsTuVwXyZ/preview" 
    style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
    allow="autoplay" 
    allowfullscreen
  ></iframe>
</div>

Tips dan Troubleshooting

  • Video tidak muncul - Pastikan sharing setting diatur ke "Anyone with the link"
  • Error loading - Cek apakah file ID sudah benar dan video belum dihapus
  • Responsive design - Gunakan wrapper div dengan padding-bottom untuk ratio 16:9
  • Loading lambat - Kompres video sebelum upload untuk performa lebih baik
  • Keamanan - Gunakan link sharing terbatas jika video bersifat rahasia

Kesimpulan

Mengembed video dari Google Drive adalah solusi praktis untuk menampilkan video di website tanpa membebani server. Dengan konfigurasi yang benar, video akan tampil responsif dan dapat diakses oleh semua pengunjung website.


You may also like


0 Comments


Leave a Reply

Comments with links or spam keywords will be rejected.
Scroll to Top