Classes
MediaRemoteControl
A simple facade for dispatching media requests to the nearest media player element.
setTarget
Section titled setTargetSet the event target from which to dispatch media requests events from. The events should bubble up from this target to the player element.
getPlayer
Section titled getPlayerReturns the current player instance. This method will attempt to find the player by
searching up from either the given target or default target set via setTarget.
startLoading
Section titled startLoadingDispatch a media-start-loading event to start the media loading process. This will
only work if the media player has been initialized with a custom media loading strategy.
startLoadingPoster
Section titled startLoadingPosterDispatch a media-start-loading-poster event to start the poster image loading process. This will
only work if the media player has been initialized with a custom poster loading strategy.
Dispatch a media-play-request event to begin/resume media playback.
pause
Section titled pauseDispatch a media-pause-request event to pause media playback.
Dispatch a media-mute-request event to set the media volume to mute (0).
unmute
Section titled unmuteDispatch a media-unmute-request event to unmute the media volume and set it back to it’s
previous state.
enterFullscreen
Section titled enterFullscreenDispatch a media-enter-fullscreen-request event to enter fullscreen on the given target.
exitFullscreen
Section titled exitFullscreenDispatch a media-exit-fullscreen-request event to exit fullscreen on the given target.
enterPictureInPicture
Section titled enterPictureInPictureDispatch a media-enter-pip-request event to enter picture-in-picture mode.
exitPictureInPicture
Section titled exitPictureInPictureDispatch a media-exit-pip-request event to exit picture-in-picture mode.
lockScreenOrientation
Section titled lockScreenOrientationDispatch a media-orientation-lock-request event to lock the screen orientation to the given
lock type.
unlockScreenOrientation
Section titled unlockScreenOrientationDispatch a media-orientation-unlock-request event to unlock the screen orientation.
seeking
Section titled seekingDispatch a media-seeking-request event to notify the media player that a seeking process is
happening to the given time. This method will not update the current time, complete the process
by calling seek.
Dispatch a media-seek-request event to notify the media player that a seeking operation has
completed and to seek to the given time. This is generally called after a series
of seeking calls.
seekToLiveEdge
Section titled seekToLiveEdgeDispatch a media-live-edge-request event to seek to the live edge.
changeDuration
Section titled changeDurationDispatch a media-duration-change-request event to update the length of the media in seconds.
changeClipStart
Section titled changeClipStartDispatch a media-clip-start-change-request event to update the clip start time. This is the time
at which media playback should start at.
changeClipEnd
Section titled changeClipEndDispatch a media-clip-end-change-request event to update the clip end time. This is the time
at which media playback should end.
changeVolume
Section titled changeVolumeDispatch a media-volume-change-request event to update the media volume to the given level which
is a value between 0 and 1.
changeAudioTrack
Section titled changeAudioTrackDispatch a media-audio-track-change-request event change to the audio track at the given index.
changeQuality
Section titled changeQualityDispatch a media-quality-change-request event to change to the video quality at the given index.
The special value -1 represents auto quality selection.
requestAutoQuality
Section titled requestAutoQualityRequest auto quality selection. This is simply shorthand for remote.changeQuality(-1).
changeTextTrackMode
Section titled changeTextTrackModeDispatch a media-text-track-change event to change the mode of the text track at the given index.
changePlaybackRate
Section titled changePlaybackRateDispatch a media-rate-change-request event to change the media playback rate.
pauseControls
Section titled pauseControlsDispatch a media-pause-controls-request event to pause controls idle tracking. Pausing
tracking will result in the controls being visible until remote.resumeControls()
is called. This method is generally used when building custom controls and you’d like to prevent
the UI from disappearing.
resumeControls
Section titled resumeControlsDispatch a media-resume-controls-request event to resume idle tracking on controls. See
pauseControls for more information.
togglePaused
Section titled togglePausedDispatch requests to toggle the media playback state.
toggleControls
Section titled toggleControlsDispatch requests to toggle the controls visibility.
toggleMuted
Section titled toggleMutedDispatch requests to toggle the media muted state.
toggleFullscreen
Section titled toggleFullscreenDispatch requests to toggle the media fullscreen state on the given target.
togglePictureInPicture
Section titled togglePictureInPictureDispatch requests to toggle the media picture-in-picture mode.
toggleCaptions
Section titled toggleCaptionsDispatch requests to toggle the current media captions text track mode.
disableCaptions
Section titled disableCaptionsTurn captions off.
requestAirPlay
Section titled requestAirPlayDispatch a request to connect to AirPlay.
requestGoogleCast
Section titled requestGoogleCastDispatch a request to connect to Google Cast.