خاصية تحكم HTML Audio / Video DOM

❮ مرجع DOM الصوت / الفيديو HTML

مثال

تحقق مما إذا كان الفيديو يحتوي على وحدة تحكم في الوسائط:

var vid = document.getElementById("myVideo");
alert("Controller: " + vid.controller);

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

تقوم خاصية وحدة التحكم بإرجاع وحدة تحكم الوسائط الحالية الخاصة بالصوت / الفيديو.

بشكل افتراضي ، لا يحتوي عنصر الصوت / الفيديو على وحدة تحكم في الوسائط. إذا تم تحديد وحدة تحكم وسائط ، فستقوم خاصية وحدة التحكم بإعادتها ككائن MediaController.

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


دعم المتصفح

Property
controller Not supported Not supported Not supported Not supported Not supported

بناء الجملة

audio|video.controller

قيمة الإرجاع

Type Description
MediaController Object Represents the media controller of the audio/video.

MediaController Object properties/methods:

  • buffered - get the buffered ranges of the audio/video
  • seekable - get the seekable ranges of the audio/video
  • duration - get the duration of the audio/video
  • currentTime - get or set the current playback position of the audio/video
  • paused - check if the audio/video is paused
  • play() - play the audio/video
  • pause() - pause the audio/video
  • played - check if the audio/video has been played
  • defaultPlaybackRate - get or set the default playback rate of the audio/video
  • playbackRate - get or set the current playback rate of the audio/video
  • volume - get or set the volume of the audio/video
  • muted - get or set if the audio/video is muted

❮ مرجع DOM الصوت / الفيديو HTML