ข้อมูลอ้างอิงHTML

HTML โดยตัวอักษร HTML ตามหมวดหมู่ รองรับ HTML Browser แอตทริบิวต์ HTML HTML Global Attributes เหตุการณ์ HTML HTML สี HTML Canvas HTML เสียง/วิดีโอ ชุดอักขระ HTML HTML Doctypes การเข้ารหัส URL HTML รหัสภาษา HTML รหัสประเทศ HTML ข้อความ HTTP วิธี HTTP ตัวแปลง PX เป็น EM แป้นพิมพ์ลัด


คุณสมบัติตัวควบคุม 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