Search in sources :

Example 1 with DownloadNotificationHelper

use of androidx.media3.exoplayer.offline.DownloadNotificationHelper in project media by androidx.

the class DemoDownloadService method getDownloadManager.

@Override
protected DownloadManager getDownloadManager() {
    // This will only happen once, because getDownloadManager is guaranteed to be called only once
    // in the life cycle of the process.
    DownloadManager downloadManager = DemoUtil.getDownloadManager(/* context= */
    this);
    DownloadNotificationHelper downloadNotificationHelper = DemoUtil.getDownloadNotificationHelper(/* context= */
    this);
    downloadManager.addListener(new TerminalStateNotificationHelper(this, downloadNotificationHelper, FOREGROUND_NOTIFICATION_ID + 1));
    return downloadManager;
}
Also used : DownloadNotificationHelper(androidx.media3.exoplayer.offline.DownloadNotificationHelper) DownloadManager(androidx.media3.exoplayer.offline.DownloadManager)

Aggregations

DownloadManager (androidx.media3.exoplayer.offline.DownloadManager)1 DownloadNotificationHelper (androidx.media3.exoplayer.offline.DownloadNotificationHelper)1