com.meta.spatial.SECURE_LAYERS to your application manifest:<application>
...
<meta-data
android:name="com.meta.spatial.SECURE_LAYERS"
android:value="true"
/>
scene.setSecureLayers(true) // Enable secure layers scene.setSecureLayers(false) // Disable secure layers
// During layer configuration LayerConfig(secure = true) // Or at runtime sceneLayer.setSecure(true)
| Panel approach | Requires Spatial SDK | Requires Meta Horizon OS |
|---|---|---|
Activity-based panels | 0.6.0+ | Meta Horizon OS v76+ |
Direct-to-Surface rendering | 0.5.4+ | earlier Meta Horizon OS versions |
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)
}
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)
)
}
)