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],
});
iOS
The Widevine CDM library must be installed manually.
From the playmaker project, copy the following files into a vendor directory
next to your ios directory:
<playmaker>/vendor/widevine_cdm_secured_ios.xcframework<playmaker>/vendor/widevine_cdm_secured_ios.podspec
Keep the vendor directory outside of ios. React Native 0.81 scans every
Info.plist under the Xcode project directory during pod install, and it
cannot read the binary Info.plist that ships inside the Widevine
.xcframework; the install fails with invalid byte sequence in UTF-8.
Next, add the local Widevine CDM dependency to your ios/Podfile:
pod 'widevine_cdm_secured_ios', :path => '../vendor'
Finally, install the newly added dependency:
pod install
Please note that a physical device is required to run when the Widevine CDM library is in use.