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.

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

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)

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

UpdatesPlugin

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.

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)

Public API available from sources here:

FlowScopePlugin