OGDownloads

Entry point for download-to-go.

// Optional, once, before the first manager() call:
OGDownloads.initialize(context, OGDownloadsConfig.Builder()
.setNotificationSmallIcon(R.drawable.ic_download)
.build())

val manager = OGDownloads.manager(context)
manager.add(mediaItem) // clear or DRM'd VOD
player.load(mediaItem) // plays offline once COMPLETED

Downloads continue in the background via a foreground service the SDK declares in its manifest; no app-side service setup is required.

Functions

Link copied to clipboard
fun initialize(context: Context, config: OGDownloadsConfig)

Applies global configuration. Call before the first manager call; when the infrastructure already exists (playback, or the download service restarted by the system, auto-initializes it with OGDownloadsConfig.DEFAULT whenever downloads exist on disk) the configuration is applied to the running infrastructure — the call never throws. Skipping it uses OGDownloadsConfig.DEFAULT.

Link copied to clipboard

The process-wide download manager (created lazily on first call).