lightbulb_outline Help shape the future of the Google Play Console, Android Studio, and Firebase. Start survey

belongs to Maven artifact androidx.media:media:1.0.0-alpha3

MediaSession2.OnDataSourceMissingHelper

public static interface MediaSession2.OnDataSourceMissingHelper

androidx.media.MediaSession2.OnDataSourceMissingHelper


Interface definition of a callback to be invoked when a MediaItem2 in the playlist didn't have a DataSourceDesc but it's needed now for preparing or playing it. #see #setOnDataSourceMissingHelper

Summary

Public methods

abstract DataSourceDesc onDataSourceMissing(MediaSession2 session, MediaItem2 item)

Called when a MediaItem2 in the playlist didn't have a DataSourceDesc but it's needed now for preparing or playing it.

Public methods

onDataSourceMissing

public abstract DataSourceDesc onDataSourceMissing (MediaSession2 session, 
                MediaItem2 item)

Called when a MediaItem2 in the playlist didn't have a DataSourceDesc but it's needed now for preparing or playing it. Returned data source descriptor will be sent to the player directly to prepare or play the contents.

An exception may be thrown if the returned DataSourceDesc is duplicated in the playlist, so items cannot be differentiated.

Parameters
session MediaSession2: the session for this event

item MediaItem2: media item from the controller

Returns
DataSourceDesc a data source descriptor if the media item. Can be null if the content isn't available.