Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Josiah Carlson
VLC-Android
Commits
5d20002f
Commit
5d20002f
authored
1 month ago
by
Nicolas Pomepuy
Committed by
Duncan McNamara
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
PlaybackSpeedDialog: get the media from the ML if it has no id
parent
30c54eac
Branches
master
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.kt
+10
-2
10 additions, 2 deletions
...d/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.kt
with
10 additions
and
2 deletions
application/vlc-android/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.kt
+
10
−
2
View file @
5d20002f
...
...
@@ -152,7 +152,7 @@ class PlaybackSpeedDialog : VLCBottomSheetDialogFragment(), PlaybackService.Call
settings
.
edit
(
commit
=
true
)
{
putBoolean
(
if
(
forVideo
)
KEY_PLAYBACK_SPEED_VIDEO_GLOBAL
else
KEY_PLAYBACK_SPEED_AUDIO_GLOBAL
,
false
)
}
val
newValue
=
PlaylistManager
.
currentPlayedMedia
.
value
?.
getMetaString
(
MediaWrapper
.
META_SPEED
)
?.
toFloat
()
?:
1F
val
newValue
=
getCurrentMedia
()
?.
getMetaString
(
MediaWrapper
.
META_SPEED
)
?.
toFloat
()
?:
1F
changeSpeedTo
(
newValue
)
}
R
.
id
.
all_media
->
{
...
...
@@ -222,7 +222,7 @@ class PlaybackSpeedDialog : VLCBottomSheetDialogFragment(), PlaybackService.Call
return
if
(
newValue
>
8.0F
||
newValue
<
0.25F
)
return
if
(
binding
.
toggleButton
.
checkedButtonId
==
R
.
id
.
this_media
)
{
PlaylistManager
.
currentPlayedMedia
.
value
?.
setStringMeta
(
MediaWrapper
.
META_SPEED
,
newValue
.
toString
())
getCurrentMedia
()
?.
setStringMeta
(
MediaWrapper
.
META_SPEED
,
newValue
.
toString
())
}
else
{
settings
.
edit
{
putFloat
(
if
(
forVideo
)
KEY_PLAYBACK_SPEED_VIDEO_GLOBAL_VALUE
else
KEY_PLAYBACK_SPEED_AUDIO_GLOBAL_VALUE
,
newValue
)
...
...
@@ -235,6 +235,14 @@ class PlaybackSpeedDialog : VLCBottomSheetDialogFragment(), PlaybackService.Call
updateInterface
()
}
private
fun
getCurrentMedia
():
MediaWrapper
?
{
PlaylistManager
.
currentPlayedMedia
.
value
?.
let
{
if
(
it
.
id
>
0
)
return
it
return
playbackService
?.
medialibrary
?.
getMedia
(
it
.
uri
)
}
return
null
}
private
fun
updateInterface
()
{
val
rate
=
playbackService
!!
.
rate
binding
.
playbackSpeedValue
.
text
=
rate
.
formatRateString
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment