public class BitmovinDownloadService
Android Service that handles downloading content for offline playback. Can be extended to implement custom notification behaviour.
public static com.google.android.exoplayer2.scheduler.Requirements DEFAULT_REQUIREMENTS
public BitmovinDownloadService()
public BitmovinDownloadService(int flags)
@Nullable protected com.google.android.exoplayer2.scheduler.Scheduler getScheduler()
@NotNull public com.google.android.exoplayer2.scheduler.Requirements getRequirements()
protected android.app.Notification getForegroundNotification(BitmovinDownloadState[] downloadStates)
Returns a Notification
to be displayed when this service running in the foreground.
This method is called when there is a task state change and periodically while there are active tasks.
On API level 26 and above, this method may also be called just before the service stops, with an empty downloadStates
array. The returned notification is used to satisfy system requirements for foreground services.
downloadStates
- The states of all current tasks.protected void onTaskStateChanged(BitmovinDownloadState downloadState)
protected static boolean allTasksFinished(java.util.Map<java.lang.String,com.bitmovin.player.offline.options.OfflineOptionEntryState> downloadStates)
Returns true
if all states are finished, else false
.
downloadStates
- The states to check.true
if all states are finished, else false
.