-
Notifications
You must be signed in to change notification settings - Fork 583
Add SphericalGLSurfaceView
support to PlayerSurface
#2619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add SphericalGLSurfaceView
support to PlayerSurface
#2619
Conversation
a9decfe
to
927c95b
Compare
927c95b
to
5a66407
Compare
1a9035a
to
af01daf
Compare
8eda021
to
8182f30
Compare
val contentScale = CONTENT_SCALES[currentContentScaleIndex].second | ||
|
||
val presentationState = rememberPresentationState(player) | ||
val scaledModifier = Modifier.resizeWithContentScale(contentScale, presentationState.videoSizeDp) | ||
|
||
LaunchedEffect(player) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBD: this will be triggered on all the events, even when they are not relevant to localConfiguration. We are considering adding a player.listen(Player.Events, Player.()->Unit)
overload that will let you specify the relevant events for the actionable-trailing-lambda. I'll update this comment once I push that.
demos/compose/src/main/java/androidx/media3/demo/compose/MainActivity.kt
Show resolved
Hide resolved
"https://storage.googleapis.com/exoplayer-test-media-0/shortform_2.mp4" to SURFACE_TYPE_SURFACE_VIEW, | ||
"https://storage.googleapis.com/exoplayer-test-media-1/gen-3/screens/dash-vod-single-segment/video-vp9-360.webm" to SURFACE_TYPE_SURFACE_VIEW, | ||
"https://storage.googleapis.com/exoplayer-test-media-0/shortform_3.mp4" to SURFACE_TYPE_SURFACE_VIEW, | ||
// https://bitmovin.com/demos/vr-360/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: leftover uri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put this comment to explain where the video comes from.
Should I remove it or clarify it (for example 360 video coming from https://bitmovin.com/demos/vr-360/
)?
libraries/ui_compose/src/main/java/androidx/media3/ui/compose/PlayerSurface.kt
Outdated
Show resolved
Hide resolved
libraries/ui_compose/src/main/java/androidx/media3/ui/compose/PlayerSurface.kt
Show resolved
Hide resolved
This change allows `PlayerSurface` to render video using `SphericalGLSurfaceView` when specifying the `SURFACE_TYPE_SPHERICAL_GL_SURFACE_VIEW` type. The compose demo has also been updated to include a 360 video example that utilizes this new surface type.
8182f30
to
daa4ae5
Compare
This change allows
PlayerSurface
to render video usingSphericalGLSurfaceView
when specifying theSURFACE_TYPE_SPHERICAL_GL_SURFACE_VIEW
type.The Compose demo has also been updated to include a 360 video example that utilizes this new surface type.
Note
The 360° video used in the video comes from Bitmovin. I've added a link to the page in the demo source code. Let me know if you'd rather use a different video or handle attribution differently.