Demo application¶
Playmaker is a complete demo application, delivered as source code, that uses the SDK to play a list of assets. It’s available on the Castlabs download portal.
Build and run¶
Download the PRESTOplay for React Native bundle from the portal
Extract the newly downloaded bundle and navigate to the newly created directory
Extract the
playmaker.tgzarchive and navigate to theplaymakerdirectoryEnable corepack
corepack enable
Verify environment setup
yarn dlx react-native doctor
Install dependencies
yarn install
Install iOS dependencies
yarn install:ios
Start Metro server
yarn start
Connect your device
Android¶
Warning
A physical device is required because protected content doesn’t play properly in an emulator.
Fix connection to the Metro server
adb reverse tcp:8081 tcp:8081
Open the
<playmaker>/androiddirectory in Android StudioSelect
Run / Select your device... / MY_DEVICEBuild and run the application
iOS¶
Warning
A physical device is required because the demo doesn’t compile for a simulator target.
Open the
<playmaker>/ios/playmaker.xcworkspacein XcodeAdjust properties in
Project / Signing & Capabilities / Signingtab to your needs (one time)Select
Product / Scheme / playmakerSelect
Product / Destination / MY_DEVICEBuild and run the application
Web¶
Run
yarn start:playmaker:webOpen
http://localhost:8081/index.htmlin your browser
Troubleshooting¶
Android Studio may fail with the error message
This version of Android Studio is incompatible with the Gradle Plugin used. To fix this, use Android Studio Meerkat or later.Xcode builds may fail with a
PhaseScriptExecutionerror if:The project workspace path contains spaces. For example, if the archive downloaded from the Download Portal was extracted to
/Users/john/package 2/.Another HTTP server is running on port 8081.
The
EXC_BAD_ACCESSerror occurs when playing Widevine-protected DASH streams on iOS, specifically whenWVCdm.createSessionis called. Since Widevine CDM does not allow debugging, and this error is part of the tamper protection, you can resolve the issue by disabling debugging in Xcode: go toProduct / Scheme / Edit Scheme / Run / Info / Debug executable, and then uncheck the box.