MediaPlayback

Plays media using the specified player.

Parameters

<Player>

The type of player used for media playback.

Inheritors

Functions

Link copied to clipboard
abstract fun add(video: Video)
Adds the video to the end of the video list.
abstract fun add(index: Int, video: Video)
Adds the video to the video list at the specified index.
Link copied to clipboard
abstract fun addAll(videos: Collection<Video>)
Add all videos in the collection to the end of the list.
abstract fun addAll(index: Int, videos: Collection<Video>)
Inserts all videos in the collection at the specified index.
Link copied to clipboard
abstract fun clear()
Removes all videos from the list.
Link copied to clipboard
abstract fun destroyPlayer()
Destroys the current player and releases it from memory.
Link copied to clipboard
abstract fun emitErrorEvent(message: String)
Emits an error event with the message passed in the event's properties
abstract fun emitErrorEvent(message: String, exception: Exception)
Emits an error event including the message passed and the exception in the properties
Link copied to clipboard
abstract fun getAnalytics(): Analytics
Returns the analytics component, the part of the player that monitors and tracks video playback and engagement.
Link copied to clipboard
abstract fun getBufferPercentage(): Int
Returns the buffer percentage
Link copied to clipboard
abstract fun getCurrentIndex(): Int
Gets the index from the current video
Link copied to clipboard
abstract fun getCurrentPosition(): Long
Returns the current playhead position of the underlying video player.
Link copied to clipboard
abstract fun getCurrentSource(): Source
Get the current source for the Video.
Link copied to clipboard
abstract fun getCurrentVideo(): Video
Get the currently playing video.
Link copied to clipboard
abstract fun getLiveEdge(): Long
Obtains the playhead position of the "live edge".
Link copied to clipboard
Get the object which handles showing an on-going player notification.
Link copied to clipboard
abstract fun getPlayer(): Player
Get the player used for media playback.
Link copied to clipboard
abstract fun getPlaylist(): List<Video>
Returns a immutable copy of the video list.
Link copied to clipboard
The source selector which uses a delegate to select sources.
Link copied to clipboard
abstract fun getVideoAt(index: Int): Video
Gets a video from the video list at the specified index
Link copied to clipboard
abstract fun getVolume(): Float
Link copied to clipboard
abstract fun hasDvr(): Boolean
Indicates if the current stream is a live video with DVR.
Link copied to clipboard
Returns true if the video is a 360 video otherwise returns false
Link copied to clipboard
abstract fun isInLiveEdge(): Boolean
Checks the current playhead position with the live edge position and determines if it is within range of the live edge.
Link copied to clipboard
abstract fun isLive(): Boolean
Indicates whether the current stream is a live video.
Link copied to clipboard
abstract fun isPlaying(): Boolean
Link copied to clipboard
abstract fun isPlayingAudioOnly(): Boolean
Check if the player is currently playing and the media is audio-only.
Link copied to clipboard
abstract fun isSourceSet(): Boolean
Returns if a source has been set
Link copied to clipboard
abstract fun onTaskRemoved(rootIntent: Intent)
This is called when the MediaPlaybackService is currently running and the user has removed a task that comes from the service's application.
Link copied to clipboard
abstract fun openCurrentVideoSource()
Prepares the player to play the current video source.
Link copied to clipboard
abstract fun openVideo(video: Video, source: Source)
Creates, configures, and prepares a new instance of MediaPlayback
Link copied to clipboard
abstract fun remove(index: Int)
Removes the video at the specified index.
Link copied to clipboard
open fun replace(index: Int, video: Video)
Removes and replaces the video at the specified index.
Link copied to clipboard
abstract fun setCurrentIndex(index: Int)
Sets the current video to the specified index.
Link copied to clipboard
abstract fun setProgressInterval(progressInterval: Int)
Sets the the interval in milliseconds at which to fire PROGRESS events during playback.
Link copied to clipboard
abstract fun setVideoPath(path: String): Video
Replaces player content with the video at the specified path.
abstract fun setVideoPath(videoPath: String, languageCodeCaptionsMap: Map<String, String>): Video
Replace player content with the video and captions at the specified paths.
Link copied to clipboard
abstract fun setVideoSource(video: Video, source: Source)
Sets the video source that will be used for playback.