سمة التحميل المسبق لـ HTML <audio>

❮ علامة <audio> HTML

مثال

يعتقد المؤلف أنه لا يجب تحميل الصوت عند تحميل الصفحة:

<audio controls preload="none">
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>

التعريف والاستخدام

تحدد السمة preloadما إذا كان المؤلف يعتقد أنه يجب تحميل ملف الصوت عند تحميل الصفحة وكيف يعتقد ذلك.

تسمح preloadالسمة للمؤلف بتقديم تلميح إلى المتصفح حول ما يعتقد أنه سيؤدي إلى أفضل تجربة للمستخدم. قد يتم تجاهل هذه السمة في بعض الحالات.

ملاحظة: يتم تجاهل سمة التحميل المسبق إذا كانت autoplayموجودة.


دعم المتصفح

تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم السمة بشكل كامل.

Attribute
preload 4.0 9.0 4.0 4.0 11.5

بناء الجملة

<audio preload="auto|metadata|none">

قيم السمات

Value Description
auto The author thinks that the browser should load the entire audio file 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 audio file when the page loads

❮ علامة <audio> HTML