The Inkrypt Videos Flutter SDK is a bridge around the native iOS and Android SDKs. All security protections are provided by the underlying native layer. This guide summarises what those protections are and what your Flutter app must handle correctly.
For full detail on any topic, refer to the native guides:
Overview
| Area | Who Is Responsible |
|---|---|
| FairPlay license enforcement (iOS) | SDK - automatic |
| Screen recording / capture prevention (iOS) | SDK via FairPlay - automatic |
Screen capture blocking via FLAG_SECURE (Android) | SDK - automatic in release builds |
| Developer mode detection (Android) | SDK - automatic; bypass in dev with tolerateDeveloperMode |
| OTP generation and delivery | Your backend |
| Keeping OTPs out of source code and logs | Your app |
OTP Handling
An OTP authorises playback of a specific video. It must come from your backend, not your app binary.
Generate OTPs on Your Backend
// Correct: fetch a fresh OTP from your backend at playback time
Future<void> loadVideo(String videoId) async {
final otp = await MyBackend.fetchOtp(videoId);
await _controller?.setParams(
InkPlayerParams(videoId: videoId, otp: otp),
);
}
// Incorrect: OTP hardcoded in source
controller.setParams(
InkPlayerParams(
videoId: 'abc123',
otp: 'HARDCODED_OTP', // never do this
),
);
Keep OTPs Short-Lived
Request the OTP immediately before presenting the player. Do not cache it across sessions or store it in shared preferences.
Never Log OTPs
// Incorrect: OTP appears in logs
debugPrint('Starting playback: videoId=${params.videoId} otp=${params.otp}');
// Correct: log only non-sensitive identifiers
debugPrint('Starting playback: videoId=${params.videoId}');
Apply the same caution to crash reporters (e.g. Firebase Crashlytics, Sentry). Redact OTPs before they are attached to any report.
Android-Specific Protections
Screen Capture Blocking
The Android SDK applies FLAG_SECURE automatically in release builds. No code changes are needed in your Flutter app. Debug builds leave the flag off so you can freely screenshot during development.
Developer Mode Detection
The SDK blocks playback when Android Developer Options or USB Debugging is enabled. During development, suppress this check with tolerateDeveloperMode:
InkryptVideoPlayer(
onPlayerCreated: (InkryptVideoPlayerController controller) {
controller.setParams(
InkPlayerParams(
videoId: _videoId,
otp: _otp,
tolerateDeveloperMode: true, // dev/debug builds only — never ship this
),
);
},
)
Never set
tolerateDeveloperMode: truein production. It disables a security gate that protects your content.
iOS-Specific Protections
FairPlay DRM
The iOS SDK uses FairPlay DRM. Protection is hardware-bound and does not function in the iOS Simulator or in Android emulators. Always test DRM-protected playback on a physical device.
FairPlay enforces the following automatically, no code is required from your app:
| Protection | Enforced By |
|---|---|
| Screen recording prevention | iOS / FairPlay |
| AirPlay mirroring restrictions | iOS / FairPlay |
| Screenshot blocking during playback | iOS / FairPlay |
| HDMI output restrictions | iOS / FairPlay |
Related Guides
- iOS Security Guide: FairPlay, OTP hygiene, and credential storage on iOS
- Android Security Guide:
FLAG_SECURE, screen capture detection, and developer mode on Android