Atribut pramuat HTML <video>
Contoh
Penulis berpikir bahwa video TIDAK boleh dimuat saat halaman dimuat:
<video controls preload="none">
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
Definisi dan Penggunaan
Atribut preload
menentukan apakah dan bagaimana menurut penulis bahwa video harus dimuat saat halaman dimuat.
Atribut preload
tersebut memungkinkan penulis untuk memberikan petunjuk kepada browser tentang apa yang menurutnya akan menghasilkan pengalaman pengguna terbaik. Atribut ini dapat diabaikan dalam beberapa kasus.
Catatan: Atribut preload
diabaikan jika
autoplay
ada.
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung atribut tersebut.
Attribute | |||||
---|---|---|---|---|---|
preload | 4.0 | 9.0 | 4.0 | 3.1 | 10.5 |
Sintaksis
<video preload="auto|metadata|none">
Nilai Atribut
Value | Description |
---|---|
auto | The author thinks that the browser should load the entire video when the page loads |
metadata | The author thinks that the browser should load only metadata when the page loads |
none | The author thinks that the browser should NOT load the video when the page loads |
tag <video> HTML