MediaElement - Appendices - Web Development with jQuery (2015)

Web Development with jQuery (2015)

Part IV. Appendices

Appendix U. MediaElement

MediaElement Options

Option

Description

Type

alwaysShowControls

Determines whether controls are hidden when the mouse cursor leaves a video.
Default value: false

Boolean

alwaysShowHours

Determines whether the hour marker is present in video time, for example, HH:MM:SS. This option shows the HH: portion.
Default value: false

Boolean

AndroidUseNativeControls

Determines whether native controls are used on Android devices.
Default value: false

Boolean

audioWidth

If a value is provided, it overrides the width of the <audio> element.
Default value: -1

Integer

audioHeight

If a value is provided, it overrides the height of the <audio> element.
Default value: -1

Integer

autosizeProgress

Determines whether the size of the progress bar should be automatically calculated based on the size of other elements.
Default value: true

Boolean

autoRewind

Returns to the beginning when media ends.
Default value: true

Boolean

clickToPlayPause

Determines whether clicking a <video> element toggles play/pause.
Default value: true

Boolean

defaultAudioHeight

The default height in pixels of an <audio> player. This value is used if no height is specified on the element.
Default value: 30

Integer

defaultAudioWidth

The default width in pixels of an <audio> player. This value is used if no width is specified on the element.
Default value: 400

Integer

defaultSeekBackwardInterval

The default amount of time to move backward when a key is pressed.
The default value is:
function(media)
{
return (media.duration * 0.5);
}

Function

defaultSeekForwardInterval

The default amount of time to move forward when a key is pressed.
The default value is:
function(media)
{
return (media.duration * 0.5);
}

Function

defaultVideoHeight

The default height in pixels of a <video> player. This value is used if no height is specified on the element.
Default value: 270

Integer

defaultVideoWidth

The default width in pixels of a <video> player. This value is used if no width is specified on the element.
Default value: 480

Integer

enableAutosize

Enables Flash and Silverlight players to resize to content size.
Default value: true

Boolean

enableKeyboard

Enables and disables keyboard support.
Default value: true

Boolean

features

The order of controls or plugins on the control bar.
Default value: ['playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen']

Array

framesPerSecond

This option is used when the showTimecodeFrameCount option is set to true. It indicates the number of frames per second.
Default value: 25

Integer

hideVideoControlsOnLoad

Determines whether video controls should hide when a video loads.
Default value: false

Boolean

iPadUseNativeControls

Determines whether to use native controls on an iPad.
Default value: false

Boolean

iPhoneUseNativeControls

Determines whether to use native controls on an iPhone.
Default value: false

Boolean

keyActions

An array of keyboard commands.
The default value is an array that initializes the following key actions: space key to play or pause the media; up and down arrow keys to increase or decrease the volume; left and right arrows to seek backward or forward; F to enter or exit full-screen model and M to mute or unmute the volume.

Array

loop

Determines whether to loop an audio track.
Default value: false

Boolean

pauseOtherPlayers

Determines whether to pause other players on the page when the player starts.
Default value: true

Boolean

poster

URL to a poster image.
Default value: "

String

showPosterWhenEnded

Determines whether to show the poster when the video has ended.
Default value: false

Boolean

showTimecodeFrameCount

Show the frame rate in the time code. FF:HH:MM:SS. This option adds the FF: portion. The framesPerSecond option determines the value.
Default value: false

Boolean

startVolume

The volume level when the player starts.
Default value: 0.8

Float

videoWidth

If a value is provided, it overrides the width of the <video> element.
Default value: -1

Integer

videoHeight

If a value is provided, it overrides the height of the <video> element.
Default value: -1

Integer