Dash for iOS
MPEG-DASH support for iOS is implemented as a plugin, which must be installed and enabled separately. The plugin supports both clear and protected MPEG-DASH streams. For protected streams, the Widevine CDM is used to decrypt the content, employing software-based decryption.
Setup
First, install the @castlabs/react-native-prestoplay-ios-dash
package:
npm install @castlabs/react-native-prestoplay-ios-dash
Once the plugin is installed, enable it when initializing the SDK, by passing the IOSDashPlugin
class. For example:
import {Sdk} from '@castlabs/react-native-prestoplay';
import {IOSDashPlugin} from "@castlabs/react-native-prestoplay-ios-dash";
Sdk.initialize({
licenseKey: { /* Valid license here */},
plugins: [IOSDashPlugin],
});
Widevine
To support MPEG-DASH protected streams on iOS, the Widevine CDM library must be installed manually.
From the example project, copy the following files to your project's ios/vendor
directory:
<example>/ios/vendor/widevine_cdm_secured_ios.xcframework
<example>/ios/vendor/widevine_cdm_secured_ios.podspec
Next, add the local Widevine CDM dependency to your ios/Podfile
:
pod 'widevine_cdm_secured_ios', :path => 'vendor/widevine_cdm_secured_ios.podspec'
Finally, install the newly added dependency:
pod install