HTLM5 has methods, properties, and events. This is for <audio> and <video> elements.
The Methods
Method | Explanation |
---|
<addTextTrack()> | Adds a new text track |
<canPlayType()> | Check if browser can play the specified audio and video type |
<load()> | Re-Load audio video element |
<play()> | Starts playing |
<pause()> | Pause the playing |
reference : www.w3schools.com
The Properties
Properties | Explanation |
---|
audioTracks | Returns an AudioTrackList object representring available audio tracks |
autoplay | Set wheter the audio / video should start playing as soon as it's loaded |
buffered | Returns a TimeRanges object representring the buffered parts of audio video |
controller | Returns the MediaController object representing the current media controller of the audio / video |
controls | Sets or Returns whether the audio / video should display controls (like play / pause, etc) |
crossOrigin | Sets or Returns of CORS setting of the audio / video |
currentSrc | Returns the URL of the current audio / video |
currentTime | Sets or Returns the current playback position in the audio / video |
defaultMuted | Sets or returns whether the audio/video should be muted by default |
defaultPlaybackRate | Sets or Returns the default speed of the audio / video playback |
duration | Returns the length of the current audio / video |
ended | Returns whether the playback of audio / video has ended or not |
error | Returns a MediaError object representing the error state of the audio / video |
loop | Set whether the audio / video should start over again when finished |
mediaGroup | Sets or Return the group of audio / video belongs to |
muted | Sets or Return whether the audio is muted or not |
networkState | Return the network state of audio / video |
paused | Returns whether the audio / video is paused or not |
playbackRate | Sets or Returns the speed of audio / video playback |
played | return a TimeRanges object representing the played parts of audio / video |
preload | Sets or Returns whether the audio / video should be loaded when the page is load |
readyState | Returns the current ready state of the audio / video |
seekable | Returns a TimeRanges object representing the seekable parts of the audio / video |
src | Set or Returns the current source of the audio / video element |
startDate | Returns a Date object representing the current time offset |
textTracks | Returns a TextTrackList object representing the available text tracks |
videoTracks | Return a VideoTrackList object representing the available video tracks |
volume | Sets or Returns the volume of audio / video |
|
|
The Events
Event | Explanation |
---|
abort | Fires when loading of an audio / video is aborted |
canplay | Fires when the browser can start playing the audio / video |
canplaythrough | Fires when the browser can play through the audio / video without stopping for buffering |
durationchange | Fires when the duration of the audio / video is changed |
emptied | Fires when the current playlist is empty |
ended | Fires when the current playlist is ended |
error | Fires when an error occured during the loading of an audio / video |
loadeddata | Fires when the browser has loaded the current frame of the audio / video |
loadedmetadata | Fires when the browser has loaded meta data for the audio / video |
loadstart | Fires when the browser starts looking for the audio / video |
pause | Fires when the audio / video has been paused |
play | Fires when the audio / video has been started or is no longer paused |
playing | Fires when audio / video is playing after have been paused or stopped for buffering |
progress | Fires when the browser is downloading the audio / video |
ratechange | Fires when the playing speed of audio / video is changed |
seeked | Fires when finished moving / skipping to a new position in the audio / video |
seeking | Fires when starts moving / skipping to a new position in the audio / video |
stalled | Fires when the browser is trying to get media data , but data is not available |
suspend | Fires when the browser is intentionally not getting media data |
timeupdate | Fires when the current playback position has changed |
volumechange | Fires when the volume has been change |
waiting | Fires when the video stops because it needs to buffer the next frame |
|
|
No comments
Mohon untuk berkomentar yang baik dan bijak