HTMLMediaElement.loop

 
HTMLMediaElement.loop 属性是 HTML 标签 loop 属性的映射,它决定了媒体元素播放结束时是否重新开始。
 

原文:The HTMLMediaElement.loop property reflects the loop HTML attribute, which controls whether the media element should start over when it reaches the end.

语法

var loop = video.loop;
audio.loop = true;

返回值

一个布尔值 Boolean (en-US).

示例

var obj = document.createElement('video');
obj.loop = true; // true

规范

Specification Status Comment
HTML Living Standard
HTMLMediaElement.loop
Living Standard No change from HTML5
HTML5
HTMLMediaElement.loop
Recommendation Initial definition.

浏览器兼容性

BCD tables only load in the browser

相关链接