mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2026-04-19 05:11:22 +00:00
-[#919] Fixed custom notification does not trigger unlocking on lockscreen. -[#947] Fixes player crashing on internet outage, issue partially addressed. -Fixed main player losing state after destroy while in background. -Fixed main player controls not hiding automatically after orientation change. -Fixed dialog uploader not marqueeing when too long. -Fixed popup permission throwing NPE on BaseList. -Refactored popup permissions to start in NavigationHelper. -Extracted hardcoded string for player menus. -Bump Java version to 1.8. -Some lambda conversions.
64 lines
1.7 KiB
Java
64 lines
1.7 KiB
Java
package org.schabi.newpipe.player;
|
|
|
|
import android.content.Intent;
|
|
import android.view.MenuItem;
|
|
|
|
import org.schabi.newpipe.R;
|
|
|
|
import static org.schabi.newpipe.player.PopupVideoPlayer.ACTION_CLOSE;
|
|
|
|
public final class PopupVideoPlayerActivity extends ServicePlayerActivity {
|
|
|
|
private static final String TAG = "PopupVideoPlayerActivity";
|
|
|
|
@Override
|
|
public String getTag() {
|
|
return TAG;
|
|
}
|
|
|
|
@Override
|
|
public String getSupportActionTitle() {
|
|
return getResources().getString(R.string.title_activity_popup_player);
|
|
}
|
|
|
|
@Override
|
|
public Intent getBindIntent() {
|
|
return new Intent(this, PopupVideoPlayer.class);
|
|
}
|
|
|
|
@Override
|
|
public void startPlayerListener() {
|
|
if (player != null && player instanceof PopupVideoPlayer.VideoPlayerImpl) {
|
|
((PopupVideoPlayer.VideoPlayerImpl) player).setActivityListener(this);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void stopPlayerListener() {
|
|
if (player != null && player instanceof PopupVideoPlayer.VideoPlayerImpl) {
|
|
((PopupVideoPlayer.VideoPlayerImpl) player).removeActivityListener(this);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public int getPlayerOptionMenuResource() {
|
|
return R.menu.menu_play_queue_popup;
|
|
}
|
|
|
|
@Override
|
|
public boolean onPlayerOptionSelected(MenuItem item) {
|
|
if (item.getItemId() == R.id.action_switch_background) {
|
|
this.player.setRecovery();
|
|
getApplicationContext().sendBroadcast(getPlayerShutdownIntent());
|
|
getApplicationContext().startService(getSwitchIntent(BackgroundPlayer.class));
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public Intent getPlayerShutdownIntent() {
|
|
return new Intent(ACTION_CLOSE);
|
|
}
|
|
}
|