-
Notifications
You must be signed in to change notification settings - Fork 1
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
802 player time api #814
base: main
Are you sure you want to change the base?
802 player time api #814
Conversation
Code Coverage
Files
|
/** | ||
* Local time formatter that format [LocalTime] to HH:mm:ss. | ||
*/ | ||
val localTimeFormatter by lazy { |
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.
Update CountdownView
to use this formatter, since it defined its own with the same configuration?
@@ -306,9 +312,15 @@ private fun PlayerTimeRow( | |||
var compactMode by remember { | |||
mutableStateOf(true) | |||
} | |||
val isLive by player.isCurrentMediaItemLiveAsState() | |||
val positionTime = if (isLive) player.getUnixTimeMs(positionMs) else C.TIME_UNSET |
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.
Shouldn't we pass a Window
to getUnixTimeMs()
?
LaunchedEffect(player) { | ||
player.play() | ||
} |
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.
Why not use a LifecycleEffect
here?
Pull request
Description
The goal of this PR is to provide API and helper to better handle timestamp based stream. Streams may have timestamps information inside their playlist. Media3 is able to extract those informations inside the
Timeline.Window
.Pillarbox provide helper to manipulate time based on that information. Those API work only and only if there are timestamp information. Pillarbox doesn't make magic with live streams that haven't timestamp inside the stream.
Changes made
Player. getUnixTimeMs
.Player. seekToUnixTimeMs
.Checklist