Package-level declarations

Types

Link copied to clipboard
class ActivityMediaSurfaceProvider<Activity : Activity>(activityClass: KClass<Activity>, activitySurfaceHolder: Activity.() -> SurfaceHolder?, observer: LifecycleManagerObserver = LifecycleManagerObserver()) : MediaSurfaceProvider, ActivityLifecycleSubscribable

A MediaSurfaceProvider that provides a SurfaceHolder from a given Activity

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class AVPlayerLayerMediaSurfaceProvider(initialLayer: <Error class: unknown class>?) : BaseMediaSurfaceProvider<<Error class: unknown class>>

A BaseMediaSurfaceProvider that attempts to grab the MediaSurface from an AVPlayerLayer

class AVPlayerViewControllerMediaSurfaceProvider(initialViewController: <Error class: unknown class>?) : BaseMediaSurfaceProvider<<Error class: unknown class>>

A BaseMediaSurfaceProvider that attempts to grab the MediaSurface from an AVPlayerViewController

Link copied to clipboard
abstract class BaseMediaManager(mediaSurfaceProvider: MediaSurfaceProvider?, coroutineContext: CoroutineContext) : MediaManager, CoroutineScope

An abstract implementation for MediaManager

Link copied to clipboard
abstract class BaseMediaSurfaceProvider<Value>(initialValue: Value?)

A MediaSurfaceProvider that grabs a MediaSurface from a given Value

Link copied to clipboard
abstract class BasePlaybackStateRepo(createInitialState: HotStateFlowRepo<PlaybackState>.() -> PlaybackState, coroutineContext: CoroutineContext) : HotStateFlowRepo<PlaybackState>

An abstract ColdStateFlowRepo for managing PlaybackState

Link copied to clipboard

Default implementation of BaseMediaManager

Default implementation of BaseMediaManager

actual class DefaultMediaManager

Default implementation of BaseMediaManager

Default implementation of BaseMediaManager

Default implementation of BaseMediaManager

Link copied to clipboard
class DefaultMediaPlayer(createPlaybackStateRepo: (CoroutineContext) -> BasePlaybackStateRepo, coroutineContext: CoroutineContext) : MediaPlayer, CoroutineScope

A default implementation of MediaPlayer

Link copied to clipboard

Default implementation of PlayableMedia

Default implementation of PlayableMedia

Default implementation of PlayableMedia

Default implementation of PlayableMedia

Default implementation of PlayableMedia

Link copied to clipboard

Manages media playback

Link copied to clipboard
Link copied to clipboard
actual sealed class MediaSource

The source at which PlayableMedia can be found

expect sealed class MediaSource

The source at which PlayableMedia can be found

actual sealed class MediaSource

The source at which PlayableMedia can be found

actual sealed class MediaSource

The source at which PlayableMedia can be found

actual sealed class MediaSource

The source at which PlayableMedia can be found

Link copied to clipboard
actual data class MediaSurface

A surface on which the video component of a PlayableMedia can be rendered. Exposes a SurfaceHolder to bind to

expect class MediaSurface

A surface on which the video component of a PlayableMedia can be rendered

actual data class MediaSurface

A surface on which the video component of a PlayableMedia can be rendered.

actual class MediaSurface

A surface on which the video component of a PlayableMedia can be rendered

actual class MediaSurface

A surface on which the video component of a PlayableMedia can be rendered

Link copied to clipboard
typealias MediaSurfaceBinding = (<Error class: unknown class>?) -> Unit
Link copied to clipboard

Controller for rendering a PlayableMedia to a MediaSurface

Link copied to clipboard
interface PlayableMedia

A media that can be played by a MediaPlayer

Link copied to clipboard
sealed class PlaybackError : Exception

An Exception that may occur during playback

Link copied to clipboard

A KalugaState of playback

Link copied to clipboard

A StateRepo/MutableStateFlow of PlaybackState

Link copied to clipboard
open class PlaybackStateRepo(mediaManager: MediaManager, coroutineContext: CoroutineContext) : BasePlaybackStateRepo
Link copied to clipboard
data class Resolution(val width: Int, val height: Int)

The screen resolution of a video

Link copied to clipboard
data class TrackInfo(val id: Int, val type: TrackInfo.Type, val language: String)

Info of the track of a PlayableMedia

Link copied to clipboard
class UIViewMediaSurfaceProvider(initialView: <Error class: unknown class>?) : BaseMediaSurfaceProvider<<Error class: unknown class>>

A BaseMediaSurfaceProvider that attempts to grab the MediaSurface from a UIView Requires that UIView.layer is an AVPlayerLayer

Link copied to clipboard

Controller for adjusting the volume

Properties

Link copied to clipboard

A Flow that provides the Duration of the current PlayableMedia of a MediaPlayer. If no PlayableMedia is loaded this will result in Duration.ZERO.

Link copied to clipboard

If true this PlayableMedia has a video component

Functions

Link copied to clipboard
Link copied to clipboard

Attempts to create a MediaSource from a url string

Attempts to create a MediaSource from a url string

Attempts to create a MediaSource from a url string

Attempts to create a MediaSource from a url string

Attempts to create a MediaSource from a url string

Link copied to clipboard
suspend fun MediaPlayer.play(playbackParameters: PlaybackState.PlaybackParameters = PlaybackState.PlaybackParameters(), restartIfStarted: Boolean = false)

Forces the MediaPlayer to start playback and suspends until playback has completed

Link copied to clipboard
fun MediaPlayer.playTime(pollingInterval: Duration): Flow<Duration>

A Flow that polls the playtime of the current PlayableMedia of a MediaPlayer as a Duration. If no PlayableMedia is loaded this will result in Duration.ZERO.