belongs to Maven artifact androidx.media2:media2:1.0.0-alpha01

MediaSession2.OnDataSourceMissingHelper

public static interface MediaSession2.OnDataSourceMissingHelper

androidx.media2.MediaSession2.OnDataSourceMissingHelper


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

Summary

Public methods

abstract DataSourceDesc2 onDataSourceMissing(MediaSession2 session, MediaItem2 item)

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

Public methods

onDataSourceMissing

public abstract DataSourceDesc2 onDataSourceMissing (MediaSession2 session, 
                MediaItem2 item)

Called when a MediaItem2 in the playlist didn't have a DataSourceDesc2 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 DataSourceDesc2 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
DataSourceDesc2 a data source descriptor if the media item. Can be null if the content isn't available.