HTML Audio Video DOM Reference Manual

HTML audio/video methods

方法 描述
addTextTrack() 向音频/视频添加新的文本轨道。
canPlayType() 检测浏览器是否能播放指定的音频/视频类型。
load() 重新加载音频/视频元素。
play() 开始播放音频/视频。
pause() 暂停当前播放的音频/视频。


HTML audio/video attributes

属性 描述
audioTracks 返回表示可用音频轨道的 AudioTrackList 对象。
autoplay 设置或返回是否在加载完成后随即播放音频/视频。
buffered 返回表示音频/视频已缓冲部分的 TimeRanges 对象。
controller 返回表示音频/视频当前媒体控制器的 MediaController 对象。
controls 设置或返回音频/视频是否显示控件(比如播放/暂停等)。
crossOrigin 设置或返回音频/视频的 CORS 设置。
currentSrc 返回当前音频/视频的 URL。
currentTime 设置或返回音频/视频中的当前播放位置(以秒计)。
defaultMuted 设置或返回音频/视频默认是否静音。
defaultPlaybackRate 设置或返回音频/视频的默认播放速度。
duration 返回当前音频/视频的长度(以秒计)。
ended 返回音频/视频的播放是否已结束。
error 返回表示音频/视频错误状态的 MediaError 对象。
loop 设置或返回音频/视频是否应在结束时重新播放。
mediaGroup 设置或返回音频/视频所属的组合(用于连接多个音频/视频元素)。
muted 设置或返回音频/视频是否静音。
networkState 返回音频/视频的当前网络状态。
paused 设置或返回音频/视频是否暂停。
playbackRate 设置或返回音频/视频播放的速度。
played 返回表示音频/视频已播放部分的 TimeRanges 对象。
preload 设置或返回音频/视频是否应该在页面加载后进行加载。
readyState 返回音频/视频当前的就绪状态。
seekable 返回表示音频/视频可寻址部分的 TimeRanges 对象。
seeking 返回用户是否正在音频/视频中进行查找。
src 设置或返回音频/视频元素的当前来源。
startDate 返回表示当前时间偏移的 Date 对象。
textTracks 返回表示可用文本轨道的 TextTrackList 对象。
videoTracks 返回表示可用视频轨道的 VideoTrackList 对象。
volume 设置或返回音频/视频的音量。

HTML audio/video events

event describe
abort Fired when audio/video loading has been abandoned.
canplay Fired when the browser can start playing audio/video.
canplaythrough Fired when the browser can play without stalling due to buffering.
durationchange Fired when the duration of the audio/video has changed.
emptied Fired when the current playlist is empty.
ended Fired when the current playlist has ended.
error Fired when an error occurs during audio/video loading.
loadeddata Fired when the browser has loaded the current frame of the audio/video.
loadedmetadata Fired when the browser has loaded the audio/video metadata.
loadstart Fired when the browser starts looking for audio/video.
pause Fired when audio/video has been paused.
play Fired when the audio/video has started or is no longer paused.
playing Fired when the audio/video is ready after being paused or stopped due to buffering.
progress Fired when the browser is downloading audio/video.
ratechange Fired when the playback speed of the audio/video has changed.
seeked Fired when the user has moved/jumped to a new location in the audio/video.
seeking Fired when the user starts moving/jumping to a new location in the audio/video.
stalled Fired when the browser tries to get media data, but the data is not available.
suspend Fired when the browser deliberately does not fetch media data.
timeupdate Fired when the current playback position has changed.
volumechange Fired when the volume has changed.
waiting Fired when the video stops because the next frame needs to be buffered.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325642726&siteId=291194637