mirror of
https://github.com/samsonjs/media.git
synced 2026-04-15 12:55:46 +00:00
call stop(true) when media action stop is received
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=205377624
This commit is contained in:
parent
0721d372a7
commit
1699876aab
2 changed files with 7 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Android Open Source Project
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -127,7 +127,7 @@ public class DefaultPlaybackController implements MediaSessionConnector.Playback
|
|||
|
||||
@Override
|
||||
public void onStop(Player player) {
|
||||
player.stop();
|
||||
player.stop(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -689,13 +689,16 @@ public final class MediaSessionConnector {
|
|||
|
||||
@Override
|
||||
public MediaMetadataCompat getMetadata(Player player) {
|
||||
if (player.getCurrentTimeline().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
MediaMetadataCompat.Builder builder = new MediaMetadataCompat.Builder();
|
||||
if (player != null && player.isPlayingAd()) {
|
||||
if (player.isPlayingAd()) {
|
||||
builder.putLong(MediaMetadataCompat.METADATA_KEY_ADVERTISEMENT, 1);
|
||||
}
|
||||
builder.putLong(
|
||||
MediaMetadataCompat.METADATA_KEY_DURATION,
|
||||
player == null ? 0 : player.getDuration() == C.TIME_UNSET ? -1 : player.getDuration());
|
||||
player.getDuration() == C.TIME_UNSET ? -1 : player.getDuration());
|
||||
long activeQueueItemId = mediaController.getPlaybackState().getActiveQueueItemId();
|
||||
if (activeQueueItemId != MediaSessionCompat.QueueItem.UNKNOWN_ID) {
|
||||
List<MediaSessionCompat.QueueItem> queue = mediaController.getQueue();
|
||||
|
|
|
|||
Loading…
Reference in a new issue