Skip to content

Commit

Permalink
Remove prev and next track action buttons for now
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Nov 20, 2019
1 parent b048d7f commit b5b8c6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
1 change: 0 additions & 1 deletion components/script/dom/mediasession.rs
Expand Up @@ -18,7 +18,6 @@ use crate::dom::mediametadata::MediaMetadata;
use crate::dom::window::Window;
use dom_struct::dom_struct;
use embedder_traits::MediaSessionEvent;
use msg::constellation_msg::PipelineId;
use script_traits::MediaSessionActionType;
use script_traits::ScriptMsg;
use std::collections::HashMap;
Expand Down
Expand Up @@ -88,8 +88,6 @@ public void showMediaSessionControls() {
IntentFilter filter = new IntentFilter();
filter.addAction(KEY_MEDIA_PAUSE);
filter.addAction(KEY_MEDIA_STOP);
filter.addAction(KEY_MEDIA_PREV);
filter.addAction(KEY_MEDIA_NEXT);

mMediaSessionActionReceiver = new BroadcastReceiver() {
@Override
Expand All @@ -100,12 +98,6 @@ public void onReceive(Context context, Intent intent) {
} else if (intent.getAction().equals(KEY_MEDIA_STOP)) {
mView.mediaSessionAction(ACTION_STOP);
Log.d("SERVOMEDIA", "STOP");
} else if (intent.getAction().equals(KEY_MEDIA_NEXT)) {
mView.mediaSessionAction(ACTION_NEXT_TRACK);
Log.d("SERVOMEDIA", "NEXT");
} else if (intent.getAction().equals(KEY_MEDIA_PREV)) {
mView.mediaSessionAction(ACTION_PREVIOUS_TRACK);
Log.d("SERVOMEDIA", "PREV");
}
}
};
Expand All @@ -117,16 +109,6 @@ public void onReceive(Context context, Intent intent) {
new Notification.Action(R.drawable.media_session_pause, "Pause",
PendingIntent.getBroadcast(mContext, 0, pauseIntent, 0));

Intent nextIntent = new Intent(KEY_MEDIA_NEXT);
Notification.Action nextAction =
new Notification.Action(R.drawable.media_session_next, "Next",
PendingIntent.getBroadcast(mContext, 0, nextIntent, 0));

Intent prevIntent = new Intent(KEY_MEDIA_PREV);
Notification.Action prevAction =
new Notification.Action(R.drawable.media_session_prev, "Previous",
PendingIntent.getBroadcast(mContext, 0, prevIntent, 0));

Intent stopIntent = new Intent(KEY_MEDIA_STOP);
Notification.Action stopAction =
new Notification.Action(R.drawable.media_session_stop, "Stop",
Expand All @@ -137,13 +119,11 @@ public void onReceive(Context context, Intent intent) {
.setSmallIcon(R.drawable.media_session_icon)
.setContentTitle("This is the notification title")
.setVisibility(Notification.VISIBILITY_PUBLIC)
.addAction(prevAction)
.addAction(pauseAction)
.addAction(nextAction)
.addAction(stopAction)
.setStyle(new Notification.MediaStyle()
.setShowActionsInCompactView(1 /* pause button */ )
.setShowActionsInCompactView(3 /* stop button */));
.setShowActionsInCompactView(0 /* pause button */ )
.setShowActionsInCompactView(1 /* stop button */));

NotificationManager notificationManager =
mContext.getSystemService(NotificationManager.class);
Expand Down

0 comments on commit b5b8c6c

Please sign in to comment.