Contains binary file data of a complete well-formed media file in a supported format.
Supported media formats include:
Media type | Format | MIME type |
---|---|---|
audio 🔊 | MP3 | audio/mpeg |
audio 🔊 | WAV | audio/wav |
audio 🔊 | OGG | audio/ogg |
audio 🔊 | AAC | audio/mp4 |
video 📺 | MP4 | video/mp4 |
video 📺 | WebM | video/webm |
video 📺 | OGG | video/ogg |
Getting the value of this field allows you to check whether the media is playing or not.
Setting the value of this field to true will cause the media to begin playing from the current position.
Setting the value of this field to false will pause playback at the current position.
loop height,width,visible, etc.Media files should be kept small to respect the user's limited memory resources and ensure quick loading times. In cases where long audio needs to be played, one way this can be achieved by having the audio split into self-contained playable segments, switching playback between audio tags when required, where one audio tag has the audio segment currently being played and the other audio tag pre-buffers the next segment of audio to be played when the current segment finishes. This approach might require an elaborate implmenetation depending on how much user interaction is required, but is just possible way that progressively-buffered media could be implemented.
For larger video media, it is both resource-intensive and wasteful to load the entire video into the tag at once. An efficient approach is to have the media pre-split into segments. Once the first segment has been loaded into the video element, the segment can begin to play while the next segement is being buffered into a scalar element. The new segment data can then be assigned to the media element when it is necessary to transition to the next part of the video. If the next required segment is not ready yet (or the user has jumped to a point in the video that falls within an unbuffered segment) some manner of 'buffering' indicator should ideally be displayed to remind the user to be patient.