Player

interface Player

A player holding a THEOplayer instance that can be hosted by a DefaultUI or UIController.

All properties are backed by State or MutableState objects, so reads from within a Composable function will automatically subscribe to changes of that property.

Types

Link copied to clipboard
object Companion

Contains properties to access the current Player.

Properties

Link copied to clipboard
abstract var activeAudioTrack: MediaTrack<AudioQuality>?

Returns or sets the active audio track.

Link copied to clipboard
abstract var activeSubtitleTrack: TextTrack?

Returns or sets the active subtitle track.

Link copied to clipboard
abstract val activeVideoQuality: VideoQuality?

Returns the currently active video quality.

Link copied to clipboard
abstract val ads: Ads?

Returns the raw Ads API of the backing THEOplayer instance.

Link copied to clipboard
abstract val audioTracks: List<MediaTrack<AudioQuality>>

Returns all available audio tracks.

Link copied to clipboard
abstract val cast: Cast?

Returns the raw Cast API of the backing THEOplayer instance.

Link copied to clipboard
abstract val castReceiverName: String?

Returns the name of the connected Chromecast receiver, if any.

Link copied to clipboard
abstract val castState: PlayerCastState

Returns the casting state of the player.

Link copied to clipboard
abstract val currentTime: Double

Returns the current playback position of the media, in seconds.

Link copied to clipboard
abstract val duration: Double

Returns the duration of the media, in seconds.

Link copied to clipboard
abstract val ended: Boolean

Returns whether playback has reached the end of the media.

Link copied to clipboard
abstract val error: THEOplayerException?

Returns any fatal error the player has encountered, if any.

Link copied to clipboard
abstract val firstPlay: Boolean

Returns whether the player has already started playback before.

Link copied to clipboard
abstract var fullscreen: Boolean

Returns or sets whether the player should be shown in fullscreen mode.

Link copied to clipboard
abstract val loading: Boolean

Returns whether the player is currently waiting for more data to resume playback.

Link copied to clipboard
abstract var muted: Boolean

Returns or sets whether the audio is muted.

Link copied to clipboard
abstract val paused: Boolean

Returns whether the player is paused.

Link copied to clipboard
abstract var playbackRate: Double

Returns or sets the playback rate of the player.

Link copied to clipboard
abstract val player: Player?

Returns the backing THEOplayer instance.

Link copied to clipboard
abstract val playingAd: Boolean

Returns whether the player is currently playing an ad.

Link copied to clipboard
abstract val readyState: ReadyState

Returns the ReadyState of the player.

Link copied to clipboard
abstract val seekable: TimeRanges

Returns the ranges of the media to which the player can seek.

Link copied to clipboard
abstract val seeking: Boolean

Returns whether the player is seeking.

Link copied to clipboard
abstract var source: SourceDescription?

Returns or sets the player's source.

Link copied to clipboard
abstract val streamType: StreamType

Returns the StreamType of the media.

Link copied to clipboard
abstract val subtitleTracks: List<TextTrack>

Returns all available subtitle tracks.

Link copied to clipboard
abstract var targetVideoQuality: VideoQuality?

Returns or sets the target video quality.

Link copied to clipboard
abstract val theoplayerView: THEOplayerView?

Returns the wrapped THEOplayer view.

Link copied to clipboard
abstract val videoHeight: Int

Returns the height of the active video rendition, in pixels.

Link copied to clipboard
abstract val videoQualities: List<VideoQuality>

Returns all available video qualities.

Link copied to clipboard
abstract val videoWidth: Int

Returns the width of the active video rendition, in pixels.

Link copied to clipboard
abstract var volume: Double

Returns or sets the audio volume of the player.

Functions

Link copied to clipboard
abstract fun pause()

Pauses playback.

Link copied to clipboard
abstract fun play()

Starts or resumes playback.