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