pallycon_drm_sdk 1.1.4 copy "pallycon_drm_sdk: ^1.1.4" to clipboard
pallycon_drm_sdk: ^1.1.4 copied to clipboard

PallyCon DRM Flutter SDK. This plugin provides a cross-platform (iOS, Android) API for PallyCon DRM used functions.

PallyCon DRM SDK for Flutter Development Guide #

pub package

A Flutter pallycon_drm_sdk plugin which provides easy to apply Multi-DRM(Android: Widevine, iOS: FairPlay) when developing media service apps for Android and iOS. Please refer to the links below for detailed information.

support environment #

  • Android 5.0 (Lolipop) & Android targetSdkVersion 31 or higher
  • iOS 12.0 higher
  • This SDK supports ExoPlayer version 2.18.1 on Android.

Important #

  • To develop using the SDK, you must first sign up for the PallyCon Admin Site and obtain a Site ID.

SDK usage #

To add PallyConDrmSdk to your Flutter app, read the Installation instructions. Below are the Android and iOS properties required for PallyConDrmSdk to work properly.

Android

compileSdkVersion

Make sure you set compileSdkVersion in "android/app/build.gradle".

android {
  compileSdkVersion 34

  ...
}
copied to clipboard

Permissions

Inside the SDK, the following 4 items are used in relation to user permission.

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
copied to clipboard

You can add the Maven repository configuration to the repositories block in your android/build.gradle file as follows:

allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://maven.pkg.github.com/inka-pallycon/pallycon-widevine-android-sdk")
            credentials {
                username = "GitHub user id"
                password = "GitHub access token"
            }
        }
    }
}
copied to clipboard
iOS

PallyCon DRM SDK Flutter uses PallyConFPSSDK. PallyConFPSSDK is supposed to be downloaded as cocoapods.

SDK requirements #

  • Minimum supported version: 11.2

Initialize #

PallyConDrmSdk.initialize(siteId);
copied to clipboard

Set Event #

Register events that occur inside the SDK.

PallyConDrmSdk.onPallyConEvent.listen((event) {
    var downloadState = DownloadStatus.pending;
    switch (event.eventType) {
        case PallyConEventType.prepare:
          // 
          break;
        case PallyConEventType.complete:
          // Called when download is complete
          break;
        case PallyConEventType.pause:
          // Called when downloading is stopped during download
          break;
        case PallyConEventType.download:
          // Called when download starts
          break;
        case PallyConEventType.contentDataError:
          // Called when an error occurs in the parameters passed to the sdk
          break;
        case PallyConEventType.drmError:
          // Called when a license error occurs
          break;
        case PallyConEventType.licenseServerError:
          // Called when an error comes down from the license server
          break;
        case PallyConEventType.downloadError:
          // Called when an error occurs during download
          break;
        case PallyConEventType.networkConnectedError:
          // Called in case of network error
          break;
        case PallyConEventType.detectedDeviceTimeModifiedError:
          // Called when device time is forcibly manipulated
          break;
        case PallyConEventType.migrationError:
          // Called when sdk migration fails
          break;
        case PallyConEventType.unknown:
          // Internally called when an unknown error occurs
          break;
  }
  // content state
}).onError((error) {
  // 
});
copied to clipboard

When downloading, register a listener to know the size of the currently downloaded data.

PallyConDrmSdk.onDownloadProgress.listen((event) {
    // event.url is url
    // event.percent is downloaded percent
});
copied to clipboard

Get content download status #

Get the current download status of the content.

PallyConDownloadState downloadState =
        await PallyConDrmSdk.getDownloadState(PallyConContentConfiguration);
    switch (downloadState) {
      case PallyConDownloadState.DOWNLOADING:
        break;
      case PallyConDownloadState.PAUSED:
        break;
      case PallyConDownloadState.COMPLETED:
        break;
      default:
        break;
    }
copied to clipboard

Download #

Describes the API required for the content download process.

// start download
PallyConDrmSdk.addStartDownload(PallyConContentConfiguration);

// stop download
PallyConDrmSdk.stopDownload(PallyConContentConfiguration);

// cancel downloads
PallyConDrmSdk.cancelDownloads();

// pause downloads
PallyConDrmSdk.pauseDownloads();

// resume downloads
PallyConDrmSdk.resumeDownloads();
copied to clipboard

Remove License or Contents #

Remove the downloaded license and content.

// remove downloaded content
PallyConDrmSdk.removeDownload(PallyConContentConfiguration);

// remove license for content
PallyConDrmSdk.removeLicense(PallyConContentConfiguration);
copied to clipboard

Release #

Called when you end using the SDK.

PallyConDrmSdk.release();
copied to clipboard
6
likes
130
points
34
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.25 - 2025.04.09

PallyCon DRM Flutter SDK. This plugin provides a cross-platform (iOS, Android) API for PallyCon DRM used functions.

Homepage
Repository (GitHub)

Documentation

API reference

License

unknown (license)

Dependencies

flutter, pallycon_drm_sdk_android, pallycon_drm_sdk_interface, pallycon_drm_sdk_ios, plugin_platform_interface

More

Packages that depend on pallycon_drm_sdk