Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
41043f41
Commit
41043f41
authored
Oct 14, 2014
by
Geoffrey Métais
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Widget loads last playlist if service is stopped
parent
0c911397
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
vlc-android/AndroidManifest.xml
vlc-android/AndroidManifest.xml
+1
-0
vlc-android/src/org/videolan/vlc/RemoteControlClientReceiver.java
...oid/src/org/videolan/vlc/RemoteControlClientReceiver.java
+4
-0
vlc-android/src/org/videolan/vlc/audio/AudioService.java
vlc-android/src/org/videolan/vlc/audio/AudioService.java
+5
-1
No files found.
vlc-android/AndroidManifest.xml
View file @
41043f41
...
...
@@ -391,6 +391,7 @@
<receiver
android:name=
".RemoteControlClientReceiver"
>
<intent-filter>
<action
android:name=
"android.intent.action.MEDIA_BUTTON"
/>
<action
android:name=
"org.videolan.vlc.remote.PlayPause"
/>
</intent-filter>
</receiver>
</application>
...
...
vlc-android/src/org/videolan/vlc/RemoteControlClientReceiver.java
View file @
41043f41
...
...
@@ -123,6 +123,10 @@ public class RemoteControlClientReceiver extends BroadcastReceiver {
abortBroadcast
();
if
(
i
!=
null
)
context
.
sendBroadcast
(
i
);
}
else
if
(
action
.
equals
(
AudioService
.
ACTION_REMOTE_PLAYPAUSE
)){
intent
=
new
Intent
(
context
,
AudioService
.
class
);
intent
.
setAction
(
AudioService
.
ACTION_REMOTE_PLAYPAUSE
);
context
.
startService
(
intent
);
}
}
}
vlc-android/src/org/videolan/vlc/audio/AudioService.java
View file @
41043f41
...
...
@@ -205,7 +205,6 @@ public class AudioService extends Service {
}
}
/**
* Set up the remote control and tell the system we want to be the default receiver for the MEDIA buttons
* @see http://android-developers.blogspot.fr/2010/06/allowing-applications-to-play-nicer.html
...
...
@@ -267,6 +266,11 @@ public class AudioService extends Service {
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
if
(
intent
==
null
)
return
START_STICKY
;
if
(
ACTION_REMOTE_PLAYPAUSE
.
equals
(
intent
.
getAction
())){
if
(
hasCurrentMedia
())
return
START_STICKY
;
else
loadLastPlaylist
();
}
updateWidget
(
this
);
return
super
.
onStartCommand
(
intent
,
flags
,
startId
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment