Only show enqueue option if play queue is not empty in RouterActivity
Make enqueue option avilable for playlists as well
This commit is contained in:
parent
54bdb66624
commit
a05ff38ffa
1 changed files with 21 additions and 13 deletions
|
|
@ -531,7 +531,7 @@ public class RouterActivity extends AppCompatActivity {
|
||||||
final List<StreamingService.ServiceInfo.MediaCapability> capabilities =
|
final List<StreamingService.ServiceInfo.MediaCapability> capabilities =
|
||||||
service.getServiceInfo().getMediaCapabilities();
|
service.getServiceInfo().getMediaCapabilities();
|
||||||
|
|
||||||
if (linkType == LinkType.STREAM) {
|
if (linkType == LinkType.STREAM || linkType == LinkType.PLAYLIST) {
|
||||||
if (capabilities.contains(VIDEO)) {
|
if (capabilities.contains(VIDEO)) {
|
||||||
returnedItems.add(videoPlayer);
|
returnedItems.add(videoPlayer);
|
||||||
returnedItems.add(popupPlayer);
|
returnedItems.add(popupPlayer);
|
||||||
|
|
@ -539,20 +539,28 @@ public class RouterActivity extends AppCompatActivity {
|
||||||
if (capabilities.contains(AUDIO)) {
|
if (capabilities.contains(AUDIO)) {
|
||||||
returnedItems.add(backgroundPlayer);
|
returnedItems.add(backgroundPlayer);
|
||||||
}
|
}
|
||||||
// download is redundant for linkType CHANNEL AND PLAYLIST (till playlist downloading is
|
|
||||||
// not supported )
|
|
||||||
returnedItems.add(new AdapterChoiceItem(getString(R.string.download_key),
|
|
||||||
getString(R.string.download),
|
|
||||||
R.drawable.ic_file_download));
|
|
||||||
|
|
||||||
// Add to playlist is not necessary for CHANNEL and PLAYLIST linkType since those can
|
// Enqueue is only shown if the current queue is not empty.
|
||||||
// not be added to a playlist
|
// However, if the playqueue or the player is cleared after this item was chosen and
|
||||||
returnedItems.add(new AdapterChoiceItem(getString(R.string.add_to_playlist_key),
|
// while the item is extracted, it will automatically fall back to background player.
|
||||||
getString(R.string.add_to_playlist),
|
if (PlayerHolder.INSTANCE.getQueueSize() > 0) {
|
||||||
R.drawable.ic_playlist_add));
|
returnedItems.add(new AdapterChoiceItem(getString(R.string.enqueue_key),
|
||||||
|
getString(R.string.enqueue_stream), R.drawable.ic_add));
|
||||||
|
}
|
||||||
|
|
||||||
returnedItems.add(new AdapterChoiceItem(getString(R.string.enqueue_key),
|
if (linkType == LinkType.STREAM) {
|
||||||
getString(R.string.enqueue_stream), R.drawable.ic_add));
|
// download is redundant for linkType CHANNEL AND PLAYLIST
|
||||||
|
// (till playlist downloading is not supported )
|
||||||
|
returnedItems.add(new AdapterChoiceItem(getString(R.string.download_key),
|
||||||
|
getString(R.string.download),
|
||||||
|
R.drawable.ic_file_download));
|
||||||
|
|
||||||
|
// Add to playlist is not necessary for CHANNEL and PLAYLIST linkType
|
||||||
|
// since those can not be added to a playlist
|
||||||
|
returnedItems.add(new AdapterChoiceItem(getString(R.string.add_to_playlist_key),
|
||||||
|
getString(R.string.add_to_playlist),
|
||||||
|
R.drawable.ic_playlist_add));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// LinkType.NONE is never present because it's filtered out before
|
// LinkType.NONE is never present because it's filtered out before
|
||||||
// channels and playlist can be played as they contain a list of videos
|
// channels and playlist can be played as they contain a list of videos
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue