1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-10-25 20:37:40 +00:00

added preference to switch between external and internal audio players

This commit is contained in:
Adam Howard
2015-12-20 00:31:31 +00:00
parent 25c5f95ad9
commit 69903ba889
4 changed files with 20 additions and 11 deletions

View File

@@ -139,7 +139,7 @@ class ActionBarHandler {
MenuItem castItem = menu.findItem(R.id.action_play_with_kodi);
castItem.setVisible(defaultPreferences
.getBoolean(activity.getString(R.string.showPlayWidthKodiPreference), false));
.getBoolean(activity.getString(R.string.showPlayWithKodiPreference), false));
}
public boolean onItemSelected(MenuItem item) {
@@ -187,7 +187,7 @@ class ActionBarHandler {
// ----------- THE MAGIC MOMENT ---------------
if(!videoTitle.isEmpty()) {
if (PreferenceManager.getDefaultSharedPreferences(activity)
.getBoolean(activity.getString(R.string.useExternalPlayer), false)) {
.getBoolean(activity.getString(R.string.useExternalVideoPlayer), false)) {
// External Player
Intent intent = new Intent();
@@ -297,9 +297,11 @@ class ActionBarHandler {
}
public void playAudio() {
boolean b = true;//todo: replace with preference
boolean externalAudioPlayer = PreferenceManager.getDefaultSharedPreferences(activity)
.getBoolean(activity.getString(R.string.useExternalAudioPlayer), false);
Intent intent;
if (b)//internal (background) music player: explicit intent
if (!externalAudioPlayer)//internal (background) music player: explicit intent
{
intent = new Intent(activity, BackgroundPlayer.class);