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.
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.
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.
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
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> 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> kamu bisa menambahkan parameter untuk mengontrol tampilan:
<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> 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.
Google Drive menawarkan solusi hosting video yang hemat biaya untuk website. Dibandingkan mengupload video langsung ke server, embed dari Google Drive memiliki beberapa keuntungan:
Berikut cara mengembed video dari Google Drive ke website:
https://drive.google.com/file/d/FILE_ID/preview<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>
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.