Skip to content

Coroutines

Kotlin coroutines is a popular Kotlin library to handle asynchronous programming and concurrency in the JVM. More information on Coroutines can be found here This module contains several JVM exclusive plugins to aid various tooling needs.

UpdatesPlugin

Plugin using a ReceiveChannel to provide an updated asset whenever the Player View is updated.

Usage

In build.gradle

implementation "com.intuit.playerui.plugins:coroutines:$PLAYER_VERSION"

In Player constructor

import com.intuit.playerui.plugins.coroutines.UpdatesPlugin
val plugins = listOf(UpdatesPlugin())
AndroidPlayer(plugins)

API

The API for this plugin revolves around the ReceiveChannel for asset updates.
Public API available from sources here:

UpdatesPlugin

FlowScopePlugin

Plugin that provides a CoroutineScope that can be used to perform various async operations with the context of the current flow. All operations launched using the scope will be cancelled when player changes state.

Usage

In build.gradle

implementation "com.intuit.playerui.plugins:coroutines:$PLAYER_VERSION"

In Player constructor

import com.intuit.playerui.plugins.coroutines.FlowScopePlugin
val plugins = listOf(FlowScopePlugin())
AndroidPlayer(plugins)

API

Public API available from sources here:

FlowScopePlugin