OGPlayer React Native SDK
    Preparing search index...

    Variable OGDownloadsConst

    OGDownloads: {
        add(item: OGMediaItem, config?: OGDownloadConfig): Promise<void>;
        addListener(callback: (event: OGDownloadEvent) => void): { remove(): void };
        list(): Promise<OGDownload[]>;
        pause(url: string): void;
        pauseAll(): void;
        remove(url: string, item?: OGMediaItem): Promise<void>;
        renewLicense(item: OGMediaItem): Promise<OfflineLicenseInfo>;
        resume(url: string): void;
        resumeAll(): void;
    } = ...

    Offline downloads — the imperative module mirroring OGDownloads / OGDownloadManager on the native SDKs. Downloads are keyed by media URL; playing a downloaded URL through <OGPlayerView> picks up the local copy automatically (clear content AND DRM content with its stored persistent license) — no player-side code change. VOD only: add() of a live item is rejected natively.

    DRM note (v1): downloads support DRM with static license headers. If the item carries a drm.tokenProvider, it is called ONCE in this wrapper — before the request crosses to native — and the returned headers are merged into the license headers used to fetch the persistent license during the download. Renewal-capable token flows fetch a fresh token per OGDownloads.renewLicense call, which goes through the wrapper the same way (renewal: true).

    Type Declaration

    • add: function
      • Queues a download (idempotent per URL — re-adding a completed or in-flight URL is a no-op). For DRM items this also acquires the persistent offline license during the download; see the DRM note above for how tokenProvider items are handled. Resolves once the request has been handed to the native download manager — progress and completion arrive via OGDownloads.addListener.

        Parameters

        Returns Promise<void>

    • addListener: function
      • Subscribes to download events: stateChanged on every state transition, throttled progress while downloading, and failed with the mirrored OGPlayerError. Returns a subscription — call remove() to stop.

        Parameters

        Returns { remove(): void }

    • list: function
    • pause: function
      • Pauses the download with this media URL.

        Parameters

        • url: string

        Returns void

    • pauseAll: function
    • remove: function
      • Deletes the downloaded media AND releases/erases its stored license.

        For DRM'd downloads on Android, pass the item (same drm config used for OGDownloads.add) so the Widevine release request to the license server can authenticate — without it, token-authorized deployments leak that device's server-side offline slot until it expires. A tokenProvider is invoked once (renewal: true) before the call crosses the bridge. iOS ignores item: FairPlay persistent keys are erased locally, no server round-trip exists.

        Parameters

        Returns Promise<void>

    • renewLicense: function
    • resume: function
      • Resumes a paused/failed download with this media URL.

        Parameters

        • url: string

        Returns void

    • resumeAll: function