@@ -32,7 +32,6 @@ private fun ComponentActivity.surfaceEntityCreate(xrSession: Session) {
32
32
val stereoSurfaceEntity = SurfaceEntity .create(
33
33
xrSession,
34
34
SurfaceEntity .StereoMode .SIDE_BY_SIDE ,
35
- // Position 1.5 meters in front of user
36
35
Pose (Vector3 (0.0f , 0.0f , - 1.5f )),
37
36
SurfaceEntity .CanvasShape .Quad (1.0f , 1.0f )
38
37
)
@@ -83,3 +82,26 @@ private fun ComponentActivity.surfaceEntityCreateTb(xrSession: Session) {
83
82
// ... and use the surface for playing the media.
84
83
// [END androidxr_scenecore_surfaceEntityCreateTb]
85
84
}
85
+
86
+ private fun ComponentActivity.surfaceEntityCreateMVHEVC (xrSession : Session ) {
87
+ // [START androidxr_scenecore_surfaceEntityCreateMVHEVC]
88
+ // Create the SurfaceEntity with the StereoMode corresponding to the MV-HEVC content
89
+ val stereoSurfaceEntity = SurfaceEntity .create(
90
+ xrSession,
91
+ SurfaceEntity .StereoMode .MULTIVIEW_LEFT_PRIMARY ,
92
+ Pose (Vector3 (0.0f , 0.0f , - 1.5f )),
93
+ SurfaceEntity .CanvasShape .Quad (1.0f , 1.0f )
94
+ )
95
+ val videoUri = Uri .Builder ()
96
+ .scheme(ContentResolver .SCHEME_ANDROID_RESOURCE )
97
+ .path(" mvhevc_video.mp4" )
98
+ .build()
99
+ val mediaItem = MediaItem .fromUri(videoUri)
100
+
101
+ val exoPlayer = ExoPlayer .Builder (this ).build()
102
+ exoPlayer.setVideoSurface(stereoSurfaceEntity.getSurface())
103
+ exoPlayer.setMediaItem(mediaItem)
104
+ exoPlayer.prepare()
105
+ exoPlayer.play()
106
+ // [END androidxr_scenecore_surfaceEntityCreateMVHEVC]
107
+ }
0 commit comments