2012-08-13

MediaPlayer

Properties

advertisingState (type: PlayerFramework.AdvertisingState, read/write)
Gets or sets the current advertising state of the player.

audioTracks (type: AudioTrackList, read-only)
Gets the audio tracks for the current media source.

autobuffer (type: Boolean, read/write)
Gets or sets a value that indicates whether to automatically start buffering the current media source.

autohide (type: Boolean, read/write)
Gets or sets a value that specifies whether interactive elements (e.g. the control panel) will be hidden automatically.

autohideBehavior (type: PlayerFramework.AutohideBehavior, read/write)
Gets or sets the behavior of the autohide feature (e.g. enable autohide during playback only).

autohideTime (type: Number, read/write)
Gets or sets the amount of time (in seconds) before interactive elements (e.g. the control panel) will be hidden automatically.

autoload (type: Boolean, read/write)
Gets or sets a value that specifies whether to start loading the current media source automatically.

autoplay (type: Boolean, read/write)
Gets or sets a value that specifies whether to automatically start playing the current media source.

buffered (type: TimeRanges, read-only)
Gets the buffered time ranges for the current media source.

captionTracks (type: Array, read-only)
Gets the caption and subtitle tracks for the current media source.

controls (type: Boolean, read/write)
Gets or sets a value that specifies whether to display the native controls for the current media source.

currentAudioTrack (type: AudioTrack, read/write)
Gets or sets the current audio track.

currentCaptionTrack (type: TextTrack, read/write)
Gets or sets the current caption/subtitle track.

currentSrc (type: String, read-only)
Gets the URL of the current media source.

currentTime (type: Number, read/write)
Gets or sets the current playback position (in seconds).

customAudioTracks (type: Array, read/write)
Gets the custom audio tracks for the current media source.

defaultInteractiveViewModel (type: PlayerFramework.InteractiveViewModel, read-only)
Gets the view model that will be restored following a temporary change to the current interactive view model (e.g. during an ad).

defaultPlaybackRate (type: Number, read/write)
Gets or sets the playback rate to use when play is resumed.

duration (type: Number, read-only)
Gets the duration (in seconds) of the current media source.

element (type: HTMLElement, read-only)
Gets the host element for the control.

ended (type: Boolean, read-only)
Gets a value that specifies whether playback has ended.

endTime (type: Number, read/write)
Gets or sets the end time (in seconds) of the current media source. This is useful in live streaming scenarios.

error (type: MediaError, read-only)
Gets the current error state of the player.

height (type: String, read/write)
Gets or sets the height of the host element.

initialTime (type: Number, read-only)
Gets the earliest possible position (in seconds) that playback can begin.

interactiveActivationMode (type: PlayerFramework.InteractionType, read/write)
Gets or sets the type of interactions that will cause interactive elements (e.g. the control panel) to be shown.

interactiveDeactivationMode (type: PlayerFramework.InteractionType, read/write)
Gets or sets the type of interactions that will cause interactive elements (e.g. the control panel) to be hidden.

interactiveViewModel (type: PlayerFramework.InteractiveViewModel, read/write)
Gets or sets the view model that interactive elements are bound to (e.g. the control panel).

isAudioTrackSelectionAllowed (type: Boolean, read-only)
Gets a value that specifies whether audio track selection features are allowed based on the current state of the player.

isAudioTrackSelectionEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether audio track selection features are enabled.

isAudioTrackSelectionVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether audio track selection features are visible.

isCaptionsAllowed (type: Boolean, read-only)
Gets a value that specifies whether caption interactions are allowed based on the current state of the player.

isCaptionsEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether caption interaction features are enabled.

isCaptionsVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether caption interaction features are visible.

isCurrentTimeLive (type: Boolean, read/write)
Gets a value that specifies whether the current playback position is "live".

isFastForwardAllowed (type: Boolean, read-only)
Gets a value that specifies whether fast forward interactions are allowed based on the current state of the player.

isFastForwardEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether fast forward interaction features are enabled.

isFastForwardVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether fast forward interaction features are visible.

isFullScreen (type: Boolean, read/write)
Gets or sets a value that specifies whether the player is in full screen mode.

isFullScreenAllowed (type: Boolean, read-only)
Gets a value that specifies whether full screen interactions are allowed based on the current state of the player.

isFullScreenEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether full screen interaction features are enabled.

isFullScreenVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether full screen interaction features are visible.

isGoLiveAllowed (type: Boolean, read-only)
Gets a value that specifies whether "go live" interactions are allowed based on the current state of the player.

isGoLiveEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether "go live" interaction features are enabled.

isGoLiveVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether "go live" interaction features are visible.

isInteractive (type: Boolean, read/write)
Gets or sets a value that specifies whether the player is currently in interactive mode (e.g. showing the control panel).

isLive (type: Boolean, read/write)
Gets a value that specifies whether the current media source is a live stream.

isPlayPauseAllowed (type: Boolean, read-only)
Gets a value that specifies whether play/pause interactions are allowed based on the current state of the player.

isPlayPauseEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether play/pause interaction features are enabled.

isPlayPauseVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether play/pause interaction features are visible.

isPlayResumeAllowed (type: Boolean, read-only)
Gets a value that specifies whether "play resume" interactions are allowed based on the current state of the player.

isPlayResumeEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether "play resume" interaction features are enabled.

isPlayResumeVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether "play resume" interaction features are visible.

isReplayAllowed (type: Boolean, read-only)
Gets a value that specifies whether replay interactions are allowed based on the current state of the player.

isReplayEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether replay interaction features are enabled.

isReplayVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether replay interaction features are visible.

isResolutionIndicatorAllowed (type: Boolean, read-only)
Gets a value that specifies whether resolution indication features are allowed based on the current state of the player.

isResolutionIndicatorEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether resolution indication features are enabled.

isResolutionIndicatorVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether resolution indication features are visible.

isRewindAllowed (type: Boolean, read-only)
Gets a value that specifies whether rewind interactions are allowed based on the current state of the player.

isRewindEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether rewind interaction features are enabled.

isRewindVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether rewind interaction features are visible.

isSignalStrengthAllowed (type: Boolean, read-only)
Gets a value that specifies whether signal strength features are allowed based on the current state of the player.

isSignalStrengthEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether signal strength features are enabled.

isSignalStrengthVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether signal strength features are visible.

isSkipAheadAllowed (type: Boolean, read-only)
Gets a value that specifies whether "skip ahead" interactions are allowed based on the current state of the player.

isSkipAheadEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether "skip ahead" interaction features are enabled.

isSkipAheadVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether "skip ahead" interaction features are visible.

isSkipBackAllowed (type: Boolean, read-only)
Gets a value that specifies whether "skip back" interactions are allowed based on the current state of the player.

isSkipBackEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether "skip back" interaction features are enabled.

isSkipBackVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether "skip back" interaction features are visible.

isSkipNextAllowed (type: Boolean, read-only)
Gets a value that specifies whether "skip next" interactions are allowed based on the current state of the player.

isSkipNextEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether "skip next" interaction features are enabled.

isSkipNextVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether "skip next" interaction features are visible.

isSkipPreviousAllowed (type: Boolean, read-only)
Gets a value that specifies whether "skip previous" interactions are allowed based on the current state of the player.

isSkipPreviousEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether "skip previous" interaction features are enabled.

isSkipPreviousVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether "skip previous" interaction features are visible.

isSlowMotion (type: Boolean, read/write)
Gets or sets a value that specifies whether the player is playing in slow motion.

isSlowMotionAllowed (type: Boolean, read-only)
Gets a value that specifies whether slow motion interactions are allowed based on the current state of the player.

isSlowMotionEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether slow motion interaction features are enabled.

isSlowMotionVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether slow motion interaction features are visible.

isStartTimeOffset (type: Boolean, read/write)
Gets or sets a value that specifies whether the start time is offset.

isTimelineAllowed (type: Boolean, read-only)
Gets a value that specifies whether timeline interactions are allowed based on the current state of the player.

isTimelineEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether timeline interaction features are enabled.

isTimelineVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether timeline interaction features are visible.

isVolumeAllowed (type: Boolean, read-only)
Gets a value that specifies whether volume interactions are allowed based on the current state of the player.

isVolumeEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether volume interaction features are enabled.

isVolumeVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether volume interaction features are visible.

liveTime (type: Number, read/write)
Gets or sets the live position (in seconds).

liveTimeBuffer (type: Number, read/write)
Gets or sets the live buffer time (in seconds) for the current playback position to be considered "live".

loop (type: Boolean, read/write)
Gets or sets a value that specifies whether playback should be restarted after it ends.

mediaElement (type: HTMLMediaElement, read-only)
Gets the media element associated with the player.

mediaExtensionManager (type: Windows.Media.MediaExtensionManager, read/write)
Gets or sets the media extension manager to be used by the player and its plugins. A new instance will be created on first use if one is not already set.

mediaQuality (type: PlayerFramework.MediaQuality, read/write)
Gets or sets the quality of the current media source.

msAudioCategory (type: String, read/write)
Gets or sets a value that specifies the purpose of the media, such as background audio or alerts.

msAudioDeviceType (type: String, read/write)
Gets or sets a value that specifies the output device ID that the audio will be sent to.

msHorizontalMirror (type: Boolean, read/write)
Gets or sets a value that specifies whether the media is flipped horizontally.

msIsLayoutOptimalForPlayback (type: Boolean, read-only)
Gets a value that specifies whether the media can be rendered more efficiently.

msIsStereo3D (type: Boolean, read-only)
Gets a value that specifies whether the system considers the media to be stereo 3D.

msPlayToDisabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the DLNA PlayTo device is available.

msPlayToPrimary (type: Boolean, read/write)
Gets or sets the primary DLNA PlayTo device.

msPlayToSource (type: Object, read-only)
Gets the media source for use by the PlayToManager.

msRealTime (type: Boolean, read/write)
Gets or sets a value that specifies whether or not to enable low-latency playback.

msStereo3DPackingMode (type: String, read/write)
Gets or sets the frame-packing mode for stereo 3D video content.

msStereo3DRenderMode (type: String, read/write)
Gets or sets a value that specifies whether the system display is set to stereo display.

msZoom (type: Boolean, read/write)
Gets or sets a value that specifies whether the video frame is trimmed to fit the display.

muted (type: Boolean, read/write)
Gets or sets a value that indicates whether the audio is muted.

networkState (type: PlayerFramework.NetworkState, read-only)
Gets the current network state for the player.

paused (type: Boolean, read-only)
Gets a value that specifies whether playback is paused.

playbackRate (type: Number, read/write)
Gets or sets the playback rate for the current media source.

played (type: TimeRanges, read-only)
Gets the played time ranges for the current media source.

playerState (type: PlayerFramework.PlayerState, read/write)
Gets or sets the current state of the player.

plugins (type: Array, read-only)
Gets the plugins associated with the player.

poster (type: String, read/write)
Gets or sets the URL of an image to display while the current media source is loading.

preload (type: String, read/write)
Gets or sets a hint to how much buffering is advisable for the current media source.

readyState (type: PlayerFramework.ReadyState, read-only)
Gets the current readiness state of the player.

replayOffset (type: Number, read/write)
Gets or sets the amount of time (in seconds) to offset the current playback position during replay.

scrubbing (type: Boolean, read-only)
Gets a value that specifies whether the user is scrubbing.

seekable (type: TimeRanges, read-only)
Gets the seekable time ranges of the current media source.

seeking (type: Boolean, read-only)
Gets a value that specifies whether the player is currently moving to a new playback position.

seekWhileScrubbing (type: Boolean, read/write)
Gets or sets a value that specifies whether the current video frame should be updated while the user is scrubbing.

signalStrength (type: Number, read/write)
Gets or sets the signal strength of the current media source. This is useful in adaptive streaming scenarios.

skipAheadInterval (type: Number, read/write)
Gets or sets the amount of time (in seconds) that the "skip ahead" feature will seek forward.

skipBackInterval (type: Number, read/write)
Gets or sets the amount of time (in seconds) that the "skip back" feature will seek backward.

slowMotionPlaybackRate (type: Number, read/write)
Gets or sets the playback rate to use when in slow motion.

sources (type: Array, read/write)
Gets or sets the media sources to be considered.

src (type: String, read/write)
Gets or sets the URL of the current media source to be considered.

startTime (type: Number, read/write)
Gets or sets the start time (in seconds) of the current media source. This is useful in live streaming scenarios.

startupTime (type: Number, read/write)
Gets or sets the position (in seconds) where playback should start. This is useful for resuming a video where the user left off in a previous session.

textTracks (type: TextTrackList, read-only)
Gets the text tracks for the current media source.

tracks (type: Array, read/write)
Gets or sets the tracks for the player.

videoHeight (type: Number, read-only)
Gets the intrinsic height of the current video (in pixels).

videoWidth (type: Number, read-only)
Gets the intrinsic width of the current video (in pixels).

volume (type: Number, read/write)
Gets or sets the volume level (from 0 to 1) for the audio portions of media playback.

width (type: String, read/write)
Gets or sets the width of the host element.

Methods

addClass(name)
Adds the specified CSS class to the host element.

name: (type: String) The name of the class to add. Multiple classes can be added using space-delimited names.

canPlayType(type)
Returns a value that specifies whether the player can play a given media type.

type: (type: String) The type of media to be played.

Returns: (type: String) One of the following values: "probably", "maybe", or an empty string if the media cannot be rendered.

decreasePlaybackRate()
Decreases the current playback rate by a factor of two. After the rate reaches 1 (normal speed), it will flip to -1, and then begins to rewind.

dispose()
Shuts down and releases all resources.

focus()
Gives focus to the host element.

Returns: (type: Object)

increasePlaybackRate()
Increases the current playback rate by a factor of two. After the rate reaches -1, it flips to 1 (normal speed), and then begins to fast forward.

load()
Reloads the current media source.

Returns: (type: Object)

msClearEffects()
Clears all effects from the media pipeline.

Returns: (type: Object)

msFrameStep(forward)
Steps the video forward or backward by one frame.

forward: (type: Boolean) If true, the video is stepped forward, otherwise the video is stepped backward.

Returns: (type: Object)

msInsertAudioEffect(activatableClassId,effectRequired,config)
Inserts the specified audio effect into the media pipeline.

activatableClassId: (type: String) The audio effects class.

effectRequired: (type: Boolean)

config: (type: Object)

Returns: (type: Object)

msInsertVideoEffect(activatableClassId,effectRequired,config)
Inserts the specified video effect into the media pipeline.

activatableClassId: (type: String) The video effects class.

effectRequired: (type: Boolean)

config: (type: Object)

Returns: (type: Object)

msSetMediaProtectionManager(mediaProtectionManager)
Sets the media protection manager for a given media pipeline.

mediaProtectionManager: (type: Object)

Returns: (type: Object)

msSetVideoRectangle(left,top,right,bottom)
Sets the dimensions of a sub-rectangle within a video.

left: (type: Number) The left position of the rectangle.

top: (type: Number) The top position of the rectangle.

right: (type: Number) The right position of the rectangle.

bottom: (type: Number) The bottom position of the rectangle.

Returns: (type: Object)

pause()
Pauses playback of the current media source.

Returns: (type: Object)

play()
Loads and starts playback of the current media source.

Returns: (type: Object)

playResume()
Resets the playback rate and resumes playing the current media source.

Returns: (type: Object)

removeClass(name)
Removes the specified CSS class from the host element.

name: (type: String) The name of the class to remove. Multiple classes can be removed using space-delimited names.

replay()
Supports instant replay by applying an offset to the current playback position.

Returns: (type: Object)

update(mediaSource)
Updates the player and its plugins with the specified media source (i.e. options).

mediaSource: (type: Object) A JSON object that represents a media source.

Events

advertisingstatechange
Occurs when the advertising state of the player has changed.

canplay
Occurs when playback is possible, but would require further buffering.

canplaythrough
Occurs when playback to end is possible without requiring a stop for further buffering.

completescrub
Occurs when a scrub has completed.

currentaudiotrackchange
Occurs when the current audio track has changed.

currentaudiotrackchanging
Occurs when the current audio track is in the process of changing.

currentcaptiontrackchange
Occurs when the current caption track has changed.

currentcaptiontrackchanging
Occurs when the current caption track is in the process of changing.

durationchange
Occurs when the duration is updated.

emptied
Occurs when the media element is reset to its initial state.

ended
Occurs when the end of playback is reached.

ending
Occurs before the ended event. Presents an opportunity for a deferral to occur. Useful for postroll ads.

error
Fires when an error occurs during object loading.

fullscreenchange
Occurs when full screen state of the player changes.

initialized
Occurs after the player has finished initializing itself and all plugins.

interactivestatechange
Occurs when player is going in or out of interactive mode.

interactiveviewmodelchange
Occurs when the view model used to drive interactive components such as the control panel is changed. This will happen when an ad start or ends.

loadeddata
Occurs when media data is loaded at the current playback position.

loadedmetadata
Occurs when the duration and dimensions of the media have been determined.

loading
Occurs before the source is set and offers the ability to perform blocking async operations.

loadstart
Occurs when Internet Explorer begins looking for media data.

msvideoformatchanged
Occurs when the video format changes.

msvideoframestepcompleted
Occurs when the video frame has been stepped forward or backward one frame.

msvideooptimallayoutchanged
Occurs when the msIsLayoutOptimalForPlayback state changes.

mutedchange
Occurs when the muted state of the player changes.

pause
Occurs when playback is paused.

play
Occurs when the play method is requested.

playerstatechange
Occurs when the state of the player has changed.

playing
Occurs when the audio or video has started playing.

progress
Occurs to indicate progress while downloading media data.

ratechange
Occurs when the playback rate is increased or decreased.

readystatechange
Occurs when the readyState property has changed.

scrub
Occurs when a scrub is in progress.

seek
Occurs when a seek has taken place.

seeked
Occurs when the seek operation ends.

seeking
Occurs when the current playback position is moved.

stalled
Occurs when the download has stopped.

starting
Occurs after the media has loaded, but before playback has started. Presents an opportunity for a deferral or cancellation to occur. Useful for preroll ads.

startscrub
Occurs when a scrub is starting.

suspend
Occurs if the load operation has been intentionally halted.

timeupdate
Occurs to indicate the current playback position.

volumechange
Occurs when the volume is changed, or playback is muted or unmuted.

waiting
Occurs when playback stops because the next frame of a video resource is not available.

Show more