-
Notifications
You must be signed in to change notification settings - Fork 162
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
Video player controller #3959
Video player controller #3959
Conversation
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.
Note: light mode should not be used for now...
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3959 +/- ##
===========================================
- Coverage 83.07% 83.01% -0.06%
===========================================
Files 1791 1795 +4
Lines 45335 45533 +198
Branches 5348 5365 +17
===========================================
+ Hits 37661 37800 +139
- Misses 5799 5854 +55
- Partials 1875 1879 +4 ☔ View full report in Codecov by Sentry. |
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.
It LGTM overall, just a couple of questions about the colors used and a suggestion for the 'legacy' slider component.
val minutes = (inSeconds % 3_600) / 60 | ||
val seconds = inSeconds % 60 | ||
return if (hours > 0) { | ||
String.format(Locale.US, "%d:%02d:%02d", hours, minutes, seconds) |
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 was going to suggest only calculating the hours
if inSeconds > 3600
but it seems like an overkill to just avoid a single allocation and a division 😅 .
@@ -32,8 +45,20 @@ fun Slider( | |||
steps: Int = 0, | |||
onValueChangeFinish: (() -> Unit)? = null, | |||
colors: SliderColors = SliderDefaults.colors(), | |||
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() } | |||
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, | |||
useCustomLayout: Boolean = false, |
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.
This feels a bit weird, to be honest. I think we should either split this component into two (one for the new M3 look and feel and another for the old one) or rename/clarify a bit what useCustomLayout
does. Maybe rename it to something like useLegacyMaterialStyle
?
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.
Yes, it's not ideal. I'll confirm with Aaron that the design is up to date for Android first.
activeTrackColor = Color(0x66E0EDFF), | ||
inactiveTrackColor = Color(0x66E0EDFF), |
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.
Don't we have either semantic or core token colors for these?
) { | ||
Box( | ||
modifier = Modifier | ||
.background(color = Color(0x99101317)) |
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 guess we also don't have any tokens for this?
@@ -30,7 +30,10 @@ sealed interface PlayableState { | |||
data object NotPlayable : PlayableState | |||
data class Playable( | |||
val isPlaying: Boolean, | |||
val isShowingControls: Boolean | |||
val progressInMillis: Long, |
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.
This is what we want to expose to the outer world, so I'm not sure this is the right place to add here
I'd have added all those values to the MediaPlayerControllerState
instead and let the Playable
derive some values from that
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.
Quality Gate passedIssues Measures |
Content
Implement a new video player controller, instead of using the one provided by exoplayer.
Note that the module would need some cleanup, in particular some code is in the
api
module and should be moved to theimpl
module.I prefer to merge this PR first and do the rework after, in a dedicated PR.
Motivation and context
Be able to render caption, see https://www.figma.com/design/Ni6Ii8YKtmXCKYNE90cC67/Timeline-(new)?node-id=1727-5255&node-type=instance&m=dev.
Screenshots / GIFs
Tests
Tested devices
Checklist