Protected content and DRM
Updated: Sep 17, 2025
Spatial SDK supports displaying protected content and DRM in panels. Use secure layers to protect content from screen capture or display DRM-protected media.
Secure layers prevent content from appearing in screen recordings and captures.
Application-wide protection
Protect all content from screen capture by adding com.media.spatial.SECURE_LAYERS to your application manifest:
<application>
...
<meta-data
android:name="com.meta.spatial.SECURE_LAYERS"
android:value="true"
/>
Toggle secure layers at runtime:
scene.setSecureLayers(true) // Enable secure layers
scene.setSecureLayers(false) // Disable secure layers
Individual layer protection
When using
Layers, protect individual layers from screen recording:
// During layer configuration
LayerConfig(secure = true)
// Or at runtime
sceneLayer.setSecure(true)
DRM content requires secure layers enabled. Configuration varies by panel type and SDK version.
Requirements: Spatial SDK 0.6.0+ and Meta Horizon OS v76+
Activity-based panels can display DRM content with secure layer configuration:
PanelCreator(R.id.drm_panel) { entity ->
// Start with basic settings to get initial config
val baseSettings = UIPanelSettings(
shape = QuadShapeOptions(width = 2.0f, height = 1.5f),
display = DpDisplayOptions(width = 800f, height = 600f)
)
// Convert to PanelConfigOptions and customize for DRM
val options = baseSettings.toPanelConfigOptions().apply {
// Enable secure layers
layerConfig = LayerConfig(secure = true)
mips = 1
forceSceneTexture = false
}
PanelSceneObject(scene, spatialContext, MyPanelActivity::class.java, entity, options)
}
Direct-to-Surface rendering
Requirements: Spatial SDK 0.5.4+ and earlier Meta Horizon OS versions
Media panels can render DRM content directly to secure surfaces:
VideoSurfacePanelRegistration(
registrationId = R.id.drm_video_panel,
surfaceConsumer = { entity, surface ->
// Your media player setup
exoPlayer.setVideoSurface(surface)
},
settingsCreator = { entity ->
MediaPanelSettings(
shape = QuadShapeOptions(width = 2.0f, height = 1.5f),
// Set isDRM to true to enable the secure layer
rendering = MediaPanelRenderOptions(isDRM = true)
)
}
)
Non-immersive apps running in Quest Home have different DRM requirements. See
general Android DRM support for hybrid app implementation details.