asMediaControlContext
fun MediaServiceApi.asMediaControlContext(viewModelScope: CoroutineScope): MediaControlContext
Content copied to clipboard
Use a MediaServiceApi to obtain a MediaControlContext to use on MediaControls. The given viewModelScope should be attached to a LifecycleViewModel: it is necessary for MediaControls to perform asynchronous operations.