HTMLMediaElement.controls

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

HTMLMediaElement.controls 这个负责控制 html 中的controlsHTML 属性,它负责控制播放的媒体 (视频或音频) 的控制条是否显示。.

语法

var ctrls = video.controls;
audio.controls = true;

返回值

类型 Boolean. 是否成功

例子

js
var obj = document.createElement("video");
obj.controls = true;

规范

Specification
HTML Standard
# dom-media-controls

浏览器兼容性

BCD tables only load in the browser

产考文档