Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
14
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
4d50e0c4
Commit
4d50e0c4
authored
3 years ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Prevent loading last playlist when history is disabled
Fixes #2254
parent
37d7cf51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1164
Prevent loading last playlist when history is disabled
Pipeline
#161936
passed with stage
in 19 minutes and 52 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
+3
-2
3 additions, 2 deletions
.../vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
with
3 additions
and
2 deletions
application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
+
3
−
2
View file @
4d50e0c4
...
...
@@ -18,6 +18,7 @@ import org.videolan.medialibrary.interfaces.media.MediaWrapper
import
org.videolan.medialibrary.media.MediaLibraryItem
import
org.videolan.resources.*
import
org.videolan.resources.util.getFromMl
import
org.videolan.tools.PLAYBACK_HISTORY
import
org.videolan.tools.Settings
import
org.videolan.tools.removeQuery
import
org.videolan.tools.retrieveParent
...
...
@@ -42,14 +43,14 @@ internal class MediaSessionCallback(private val playbackService: PlaybackService
override
fun
onPlay
()
{
if
(
playbackService
.
hasMedia
())
playbackService
.
play
()
else
if
(!
AndroidDevices
.
isAndroidTv
)
PlaybackService
.
loadLastAudio
(
playbackService
)
else
if
(!
AndroidDevices
.
isAndroidTv
&&
Settings
.
getInstance
(
playbackService
).
getBoolean
(
PLAYBACK_HISTORY
,
true
)
)
PlaybackService
.
loadLastAudio
(
playbackService
)
}
override
fun
onMediaButtonEvent
(
mediaButtonEvent
:
Intent
):
Boolean
{
val
keyEvent
=
mediaButtonEvent
.
getParcelableExtra
(
Intent
.
EXTRA_KEY_EVENT
)
as
KeyEvent
?
?:
return
false
if
(!
playbackService
.
hasMedia
()
&&
(
keyEvent
.
keyCode
==
KeyEvent
.
KEYCODE_MEDIA_PLAY
||
keyEvent
.
keyCode
==
KeyEvent
.
KEYCODE_MEDIA_PLAY_PAUSE
))
{
return
if
(
keyEvent
.
action
==
KeyEvent
.
ACTION_DOWN
)
{
return
if
(
keyEvent
.
action
==
KeyEvent
.
ACTION_DOWN
&&
Settings
.
getInstance
(
playbackService
).
getBoolean
(
PLAYBACK_HISTORY
,
true
)
)
{
PlaybackService
.
loadLastAudio
(
playbackService
)
true
}
else
false
...
...
This diff is collapsed.
Click to expand it.
Nicolas Pomepuy
@Aza
mentioned in merge request
!1509 (merged)
·
2 years ago
mentioned in merge request
!1509 (merged)
mentioned in merge request !1509
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