Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
15
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
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
VideoLAN
VLC-Android
Commits
29f9d9fc
Commit
29f9d9fc
authored
5 years ago
by
Nicolas Pomepuy
Committed by
Geoffrey Métais
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Save and restore playback rate for individual media
parent
b2c96ea3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!73
Save and restore playback rate for individual media
Pipeline
#6228
passed with stage
Stage:
in 3 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+6
-0
6 additions, 0 deletions
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
with
6 additions
and
0 deletions
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+
6
−
0
View file @
29f9d9fc
...
...
@@ -401,6 +401,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
val
time
=
player
.
getCurrentTime
()
val
length
=
player
.
getLength
()
val
canSwitchToVideo
=
player
.
canSwitchToVideo
()
val
rate
=
player
.
getRate
()
launch
{
val
media
=
withContext
(
Dispatchers
.
IO
)
{
medialibrary
.
findMedia
(
currentMedia
)
}
if
(
media
===
null
||
media
.
id
==
0L
)
return
@launch
...
...
@@ -415,6 +416,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
media
.
time
=
if
(
progress
==
0f
)
0L
else
time
launch
(
Dispatchers
.
IO
)
{
media
.
setLongMeta
(
MediaWrapper
.
META_PROGRESS
,
media
.
time
)
}
}
launch
(
Dispatchers
.
IO
)
{
media
.
setStringMeta
(
MediaWrapper
.
META_SPEED
,
rate
.
toString
())
}
}
}
...
...
@@ -445,6 +447,10 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
player
.
setAudioDelay
(
media
.
getMetaLong
(
MediaWrapper
.
META_AUDIODELAY
))
player
.
setSpuTrack
(
media
.
getMetaLong
(
MediaWrapper
.
META_SUBTITLE_TRACK
).
toInt
())
player
.
setSpuDelay
(
media
.
getMetaLong
(
MediaWrapper
.
META_SUBTITLE_DELAY
))
val
rateString
=
media
.
getMetaString
(
MediaWrapper
.
META_SPEED
)
if
(!
rateString
.
isNullOrEmpty
())
{
player
.
setRate
(
rateString
.
toFloat
(),
false
)
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Geoffrey Métais
@Dekans
mentioned in commit
7d0f3d49
·
5 years ago
mentioned in commit
7d0f3d49
mentioned in commit 7d0f3d490cd453f333e7a6952e41142c9ff2d165
Toggle commit list
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