npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pallycon-react-native-sdk

v1.1.1

Published

pallyCon multi-drm react-native sdk

Downloads

7

Readme

PallyCon Multi-DRM SDK for React-Native Development Guide

A React-Native pallycon-react-native-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 PallyConMultiDrmSdk to your React-Native app, read the Installation instructions. Below are the Android and iOS properties required for PallyConMultiDrmSdk to work properly.

compileSdkVersion

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

android {
  compileSdkVersion 31

  ...
}

PallyCon Multi DRM SDK React Native uses PallyConFPSSDK. PallyConFPSSDK is supposed to be downloaded as cocoapods.

SDK requirements

  • Minimum supported version: 11.2

Import

import PallyConMultiDrmSdk , {
	PallyConEventType,
	PallyConContentConfiguration,
	PallyConDownloadState
} from 'pallycon-react-native-sdk';

Initialize

PallyConMultiDrmSdk.initialize(siteId);

Set Event

Register events that occur inside the SDK.

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.complete, (event) => {
	// Called when download is complete
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.pause, (event) => {
	// Called when downloading is stopped during download
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.remove, (event) => {
	// Called when download remove
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.stop, (event) => {
	// Called when download stops
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.download, (event) => {
	// Called when download starts
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.contentDataError, (event) => {
	// Called when an error occurs in the parameters passed to the sdk
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.drmError, (event) => {
	// Called when a license error occurs
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.licenseServerError, (event) => {
	// Called when an error comes down from the license server
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.downloadError, (event) => {
	// Called when an error occurs during download
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.networkConnectedError, (event) => {
	// Called in case of network error
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.detectedDeviceTimeModifiedError, (event) => {
	// Called when device time is forcibly manipulated
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.migrationError, (event) => {
	// Called when sdk migration fails
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.licenseCipherError, (event) => {
	// Called when license cipher fails
})

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.unknownError, (event) => {
	// Internally called when an unknown error occurs
})

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

PallyConMultiDrmSdk.addPallyConEvent(PallyConEventType.progress, (event) => {
	// event.url is url
	// event.percent is downloaded percent
})

Get content download status

Get the current download status of the content.

try {
	const state =
			await PallyConMultiDrmSdk.getDownloadState(config);
	switch (state) {
		case PallyConDownloadState.DOWNLOADING:
			break;
		case PallyConDownloadState.PAUSED:
			break;
		case PallyConDownloadState.COMPLETED:
			break;
		default:
			break;
	}
} catch (e) {
	setError(e.message);
}

Download

Describes the API required for the content download process.

// start download
PallyConMultiDrmSdk.addStartDownload(PallyConContentConfiguration);

// cancel downloads
PallyConMultiDrmSdk.cancelDownloads();

// pause downloads
PallyConMultiDrmSdk.pauseDownloads();

// resume downloads
PallyConMultiDrmSdk.resumeDownloads();

Remove License or Contents

Remove the downloaded license and content.

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

// remove license for content
PallyConMultiDrmSdk.removeLicense(PallyConContentConfiguration);

Release

Called when you end using the SDK.

PallyConMultiDrmSdk.release();