<h2 id="spatialexternalsurface-stereomode-modifier-featheringeffect-surfaceprotection-dragpolicy-resizepolicy-interactionpolicy-supersamplingpattern-content">SpatialExternalSurface</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
@Composable
@SubspaceComposable
public fun SpatialExternalSurface(
    stereoMode: StereoMode,
    modifier: SubspaceModifier = SubspaceModifier,
    featheringEffect: SpatialFeatheringEffect? = null,
    surfaceProtection: SurfaceProtection = SurfaceProtection.None,
    dragPolicy: DragPolicy? = null,
    resizePolicy: ResizePolicy? = null,
    interactionPolicy: InteractionPolicy? = null,
    superSamplingPattern: SuperSamplingPattern = SuperSamplingPattern.Pentagon,
    content: @Composable @SubspaceComposable SpatialExternalSurfaceScope.() -> Unit,
)
```

A Composable that creates and owns an Android Surface into which the application can render
stereo image content. This can be thought of as the spatial equivalent of AndroidExternalSurface.
This Surface is texture mapped to the canvas, and if a stereoscopic StereoMode is specified, then
the User will see left and right eye content mapped to the appropriate display. Width and height
will default to 400 pixels if it is not specified using size modifiers.

It is not currently possible to synchronize StereoMode changes with application rendering or
video decoding. This composable currently cannot render in front of other panels, so [dragPolicy](/jetpack-compose/androidx.xr.compose/compose/classes/DragPolicy)
usage is not recommended if there are other panels in the layout, aside from the content block of
this Composable.

Playing certain content will require the proper [SurfaceProtection](/jetpack-compose/androidx.xr.compose/compose/classes/SurfaceProtection). This is mainly used to
protect DRM video content.

#### Parameters

| | |
| --- | --- |
| modifier | SubspaceModifiers to apply to the SpatialSurfacePanel. |
| stereoMode | The [StereoMode](/jetpack-compose/androidx.xr.compose/compose/classes/StereoMode) which describes how parts of the surface are displayed to the user's eyes. This will affect how the content is interpreted and displayed on the surface. |
| featheringEffect | A [SpatialFeatheringEffect](/jetpack-compose/androidx.xr.compose/compose/classes/SpatialFeatheringEffect) to apply to to canvas of the surface exposed from [SpatialExternalSurfaceScope.onSurfaceCreated](/jetpack-compose/androidx.xr.compose/compose/interfaces/SpatialExternalSurfaceScope). |
| surfaceProtection | Sets the Surface's content protection. Use this to redact content in screen recordings. Setting this to `SurfaceProtection.Protected` is required if decoding DRM media content. |
| dragPolicy | An optional [DragPolicy](/jetpack-compose/androidx.xr.compose/compose/classes/DragPolicy) that defines the motion behavior of the [SpatialPanel](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialPanel). This can be either a [MovePolicy](/jetpack-compose/androidx.xr.compose/compose/classes/MovePolicy) for free movement or an [AnchorPolicy](/jetpack-compose/androidx.xr.compose/compose/classes/AnchorPolicy) for anchoring to real-world surfaces. If a policy is provided, draggable UI controls will be shown, allowing the user to manipulate the panel in 3D space. If null, no motion behavior is applied. |
| resizePolicy | An optional [ResizePolicy](/jetpack-compose/androidx.xr.compose/compose/classes/ResizePolicy) configuration object that resizing behavior of this [SpatialPanel](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialPanel). The draggable UI controls will be shown that allow the user to resize the element in 3D space. If null, there is no resize behavior applied to the element. |
| interactionPolicy | An optional [InteractionPolicy](/jetpack-compose/androidx.xr.compose/compose/classes/InteractionPolicy) that can be set to detect input events. |
| superSamplingPattern | The pattern to use to super sample this surface, or `SuperSamplingPattern.None` to disable super sampling. |
| content | Content block where the surface can be accessed using [SpatialExternalSurfaceScope.onSurfaceCreated](/jetpack-compose/androidx.xr.compose/compose/interfaces/SpatialExternalSurfaceScope). Composable content will be rendered over the Surface canvas. If using `StereoMode.SideBySide` or `StereoMode.TopBottom`, it is recommended to offset Composable content far enough to avoid depth perception issues. |