This project is read-only.

MediaPlayer

Properties

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

audioTracks (type: Array, read/write)
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.

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/write)
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).

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).

isAudioAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the audio control is allowed based on the current state of the player.

isAudioEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the audio control is enabled.

isAudioVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the audio control is visible.

isCaptionsAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the captions control is allowed based on the current state of the player.

isCaptionsEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the captions control is enabled.

isCaptionsVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the captions control is visible.

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

isElapsedTimeAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the elapsed time control is allowed based on the current state of the player.

isElapsedTimeEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the elapsed time control is enabled.

isElapsedTimeVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the elapsed time control is visible.

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

isFastForwardEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the fast forward control is enabled.

isFastForwardVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the fast forward control is 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 interaction with the full screen control is allowed based on the current state of the player.

isFullScreenEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the full screen control is enabled.

isFullScreenVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the full screen control is visible.

isGoLiveAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the go live control is allowed based on the current state of the player.

isGoLiveEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the go live control is enabled.

isGoLiveVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the go live control is 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.

isMediaQualityAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the media quality control is allowed based on the current state of the player.

isMediaQualityEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the media quality control is enabled.

isMediaQualityVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the media quality control is visible.

isMuteAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the mute control is allowed based on the current state of the player.

isMuteEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the mute control is enabled.

isMuteVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the mute control is visible.

isPauseAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the pause control is allowed based on the current state of the player.

isPauseEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the pause control is enabled.

isPauseVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the pause control is visible.

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

isPlayPauseEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the play/pause control is enabled.

isPlayPauseVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the play/pause control is visible.

isPlayResumeAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the play/resume control is allowed based on the current state of the player.

isPlayResumeEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the play/resume control is enabled.

isPlayResumeVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the play/resume control is visible.

isRemainingTimeAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the remaining time control is allowed based on the current state of the player.

isRemainingTimeEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the remaining time control is enabled.

isRemainingTimeVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the remaining time control is visible.

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

isReplayEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the replay control is enabled.

isReplayVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the replay control is visible.

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

isRewindEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the rewind control is enabled.

isRewindVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the rewind control is visible.

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

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

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

isSkipAheadAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the skip ahead control is allowed based on the current state of the player.

isSkipAheadEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the skip ahead control is enabled.

isSkipAheadVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the skip ahead control is visible.

isSkipBackAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the skip back control is allowed based on the current state of the player.

isSkipBackEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the skip back control is enabled.

isSkipBackVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the skip back control is visible.

isSkipNextAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the skip next control is allowed based on the current state of the player.

isSkipNextEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the skip next control is enabled.

isSkipNextVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the skip next control is visible.

isSkipPreviousAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the skip previous control is allowed based on the current state of the player.

isSkipPreviousEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the skip previous control is enabled.

isSkipPreviousVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the skip previous control is 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 interaction with the slow motion control is allowed based on the current state of the player.

isSlowMotionEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the slow motion control is enabled.

isSlowMotionVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the slow motion control is 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 interaction with the timeline control is allowed based on the current state of the player.

isTimelineEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the timeline control is enabled.

isTimelineVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the timeline control is visible.

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

isVolumeEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the volume control is enabled.

isVolumeMuteAllowed (type: Boolean, read-only)
Gets a value that specifies whether interaction with the volume/mute control is allowed based on the current state of the player.

isVolumeMuteEnabled (type: Boolean, read/write)
Gets or sets a value that specifies whether the volume/mute control is enabled.

isVolumeMuteVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the volume/mute control is visible.

isVolumeVisible (type: Boolean, read/write)
Gets or sets a value that specifies whether the volume control is 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 player is currently moving to a new playback position due to a scrub operation.

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 due to a seek operation.

seekWhileScrubbing (type: Boolean, read/write)
Gets or sets a value that specifies whether the current video frame should be updated during a scrub operation.

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 control will seek forward.

skipBackInterval (type: Number, read/write)
Gets or sets the amount of time (in seconds) that the skip back control 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.

testForMediaPack (type: Boolean, read/write)
Gets or sets whether a test for the media feature pack should be performed prior to allowing content to be laoded. This is useful to enable if Windows 8 N/KN users will be using this app.

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.

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.

msClearEffects()
Clears all effects from the media pipeline.

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.

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)

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)

msSetMediaProtectionManager(mediaProtectionManager)
Sets the media protection manager for a given media pipeline.
  • mediaProtectionManager: (type: Windows.Media.Protection.MediaProtectionManager)

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.

pause()
Pauses playback of the current media source.

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

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

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.

retry()
Reloads the current media source and resumes where playback was left off.

update(mediaSource)
Updates the player and its plugins with the specified media source (e.g. the current playlist item).
  • mediaSource: (type: Object) A JSON object containing the set of options that represent a media source.

Events

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

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

canplaythrough
Occurs when playback to the end is possible without requiring further buffering.

currentaudiotrackchange
Occurs when the current audio track has changed.

currentaudiotrackchanging
Occurs when the current audio track is changing and presents an opportunity for custom behavior. Used by the adaptive plugin.

currentcaptiontrackchange
Occurs when the current caption track has changed.

currentcaptiontrackchanging
Occurs when the current caption track is changing and presents an opportunity for custom behavior. Used by the captions plugin.

durationchange
Occurs when the media 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 and presents an opportunity for deferral. Useful for postroll ads.

error
Occurs when the media element encounters an error.

fullscreenchange
Occurs when the full screen state of the player is changed.

initialized
Occurs when the player has finished initializing itself and its plugins.

interactivestatechange
Occurs when the interactive state of the player is changed.

interactiveviewmodelchange
Occurs when the view model used to drive interactive components such as the control panel is changed (e.g. when an ad start or ends).

islivechange
Occurs when the live state of the media source changes.

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 media source is set and offers the ability to perform blocking operations.

loadstart
Occurs after the media source is set and the player 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 media has started playing.

progress
Occurs when progress is made while downloading media data.

ratechange
Occurs when the playback rate is increased or decreased.

readystatechange
Occurs when the ready state has changed.

scrub
Occurs when a scrub operation is requested.

scrubbed
Occurs when a scrub operation ends.

scrubbing
Occurs when the current playback position is moved due to a scrub operation.

seek
Occurs when a seek operation is requested.

seeked
Occurs when a seek operation ends.

seeking
Occurs when the current playback position is moved due to a seek operation.

stalled
Occurs when the media download has stopped.

started
Occurs after playback has started.

starting
Occurs before playback has started and presents an opportunity for deferral or cancellation. Useful for preroll ads.

suspend
Occurs when the load operation has been intentionally halted.

timeupdate
Occurs when the current playback position is updated.

updated
Occurs when the player is updated with a new media source (e.g. when the current playlist item is changed).

volumechange
Occurs when the volume is changed.

waiting
Occurs when playback stops because the next video frame is unavailable.

Last edited Apr 24, 2013 at 9:35 PM by timgreenfield, version 13