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

@takeoffmedia/react-native-penthera

v0.8.2

Published

test

Downloads

345

Readme

@takeoffmedia/react-native-penthera

This document provide information about the Penthera SDK implementation, we built 2 custom react native wrappers for iOS and Android using the Penthera native SDK

Penthera Cloud

Penthera Cloud (backplane), the SDK handles the requests to the Penthera Cloud from the SDK initialization, user login, downloads and so on.

Definition concepts

  • userID: An unique string identifier of user provided by us, Penthera will use this value to identify and associate any interaction of the SDK with the logged user.

  • deviceID: An unique string identifier of the device.

  • asset: Any content downloaded or added to the download quote will be saved as an asset object in Penthera local storage, with an unique string identifier to handle the status of the assets.

  • VirtuosoHTTPClient: a static http client solution to handle the streaming of the local HLS video format.

iOS

requirements

  • iOS 10 +

setup

Add the Penthera repository source to the Podfile:

source 'https://github.com/penthera/Download2Go-specs.git'

Add the framework to the Podfile:

source 'https://cdn.cocoapods.org/'
source 'https://github.com/penthera/Download2Go-specs.git'

pod 'VirtuosoClientDownloadEngine', :git => 'https://github.com/penthera/Download2Go-ios', :branch => 'master'

#ALTERNATIVE - Specify a specific version of Penthera SDK
#pod 'VirtuosoClientDownloadEngine', '~> 4.2' 

Run pod install command.

Then add to the AppDelegate.mm the VirtuosoClientDownloadEngine.

#import <React/RCTAppSetupUtils.h>

#import <VirtuosoClientDownloadEngine/VirtuosoClientDownloadEngine.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

//…

// Initialize engine and fetch a handle to the singleton instance

VirtuosoDownloadEngine* engine = [VirtuosoDownloadEngine instance];

// Global “on switch” for downloading

[engine setEnabled:YES];

}

Info.plist

In your app’s info.plist:

  • Add “Application Uses Wifi” and set it to YES.

  • In “Required Background Modes”, add the option “App downloads content in response to push notifications”.

  • In “Required Background Modes”, add the option “App downloads content from the network”.

Initialization

In our wrapper solution we provided a method to instantiate the SDK, the next parameters are required:

userId: logged user identifier

backplaneUrl: the url of the Penthera Cloud

publicKey: provided by Penthera

privateKey: provided by penthera

externalDeviceID: Optional deviceID provided by us

This method will return a success message in case the initialization is successful otherwise it will return one of the following errors code:

| Fruit | Description | |-------| -------| | PENTHERA_ENGINE_AREADY_STARTED | Virtuoso is already started. | | PENTHERA_ENGINE_NO_BACKPLANE | Virtuoso started up, but couldn’t connect to the Cloud. | | PENTHERA_ENGINE_INVALID_OPTIONS | Wrong parameters | | PENTHERA_ENGINE_METHOD_IS_DEPRECATED | Error changing the user account. | | PENTHERA_ENGINE_INTERNAL_EXCEPTION | Virtuoso exception. | | PENTHERA_ENGINE_DATA_MIGRATION_ERROR | Error in the core data. | | PENTHERA_ENGINE_UNKNOWN_ERROR | Error |

Get download files

This method will return an array object with all the downloaded or pending to download assets with this json format:

[{
"assetID": "",
"isDownloaded": true,
"thumbnail": ""
}]

Get asset

This method will return the basic information of the asset, it requires an assetID to search within the database of the downloaded files, In case of success it will return a json object with this format:

{
"assetID": "",
"isDownloaded": true,
"thumbnail": "",
"streamURL": "",
"thumbnailTrack": "",
"subtitle": ""
}

Download asset

This method will add to the download quote an asset, it required:

assetID: unique content identifier title: title of the content streamURL: thumbnailURL: thumbnailTrackURL: subtitleURL:

It will return an success message or an error code

Play asset

This method will allow you to playback a downloaded content, just need to send the assetId as parameter and it will return a json object with asset information:

Delete asset

Delete a specific asset from the Penthera database, the assetID is required.

Delete all assets

Delete all the downloaded or pending to download assets in the Penthera database.

DRM

In case that the assets required DRM support, Penthera support the FairPlay playback offline, first we have to set the VirtuosoLicenseManager, this class will allow us to:

  • Configure the license and certificate

  • Manually induce the download of an offline license key for an asset,

  • Manually induce the refresh of a license key,

  • manually delete a license key from SDK management,

  • Provide a license key to the SDK for management which you acquired in a custom manner, and

  • Retrieve the managed license key for an asset, in case you need to manually provide it to a player in

  • Some custom manner rather than letting the SDK provide it during playback.

The VirtuosoLicenseManager instance has 2 functions to set the License and the certificate:

  • VirtuosoLicenseManager.downloadClientAppCertificate(fromURL: certificateURL, for: .vlm_FairPlay)

  • VirtuosoLicenseManager.setLicenseServerURL(licenseURL, for: .vlm_FairPlay)