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.

示例

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.

浏览器兼容性

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
loop property (Yes) (Yes) 11.0 (11.0) 9 ? ?
Feature Android Edge Firefox Mobile (Gecko) Firefox OS (Gecko) IE Mobile Opera Mobile Safari Mobile
loop property (Yes) (Yes) 11.0 (11.0) (Yes) ? ? ?

相关链接

文档标签和贡献者

 此页面的贡献者: newming
 最后编辑者: newming,