mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-25 12:32:31 +01:00
Merge pull request #596 from marcobiscaro2112/master
Adds support for adjustable playback speed
This commit is contained in:
commit
0c1d773134
@ -57,5 +57,5 @@ dependencies {
|
|||||||
compile 'de.hdodenhof:circleimageview:2.0.0'
|
compile 'de.hdodenhof:circleimageview:2.0.0'
|
||||||
compile 'com.github.nirhart:parallaxscroll:1.0'
|
compile 'com.github.nirhart:parallaxscroll:1.0'
|
||||||
compile 'com.nononsenseapps:filepicker:3.0.0'
|
compile 'com.nononsenseapps:filepicker:3.0.0'
|
||||||
compile 'com.google.android.exoplayer:exoplayer:r2.3.1'
|
compile 'com.google.android.exoplayer:exoplayer:r2.4.2'
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ import com.google.android.exoplayer2.DefaultLoadControl;
|
|||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||||
import com.google.android.exoplayer2.ExoPlayer;
|
import com.google.android.exoplayer2.ExoPlayer;
|
||||||
import com.google.android.exoplayer2.ExoPlayerFactory;
|
import com.google.android.exoplayer2.ExoPlayerFactory;
|
||||||
|
import com.google.android.exoplayer2.PlaybackParameters;
|
||||||
import com.google.android.exoplayer2.SimpleExoPlayer;
|
import com.google.android.exoplayer2.SimpleExoPlayer;
|
||||||
import com.google.android.exoplayer2.Timeline;
|
import com.google.android.exoplayer2.Timeline;
|
||||||
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
|
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
|
||||||
@ -47,6 +48,8 @@ import com.nostra13.universalimageloader.core.ImageLoader;
|
|||||||
import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener;
|
import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.text.NumberFormat;
|
||||||
import java.util.Formatter;
|
import java.util.Formatter;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
@ -77,6 +80,7 @@ public abstract class BasePlayer implements ExoPlayer.EventListener, AudioManage
|
|||||||
public static final String VIDEO_THUMBNAIL_URL = "video_thumbnail_url";
|
public static final String VIDEO_THUMBNAIL_URL = "video_thumbnail_url";
|
||||||
public static final String START_POSITION = "start_position";
|
public static final String START_POSITION = "start_position";
|
||||||
public static final String CHANNEL_NAME = "channel_name";
|
public static final String CHANNEL_NAME = "channel_name";
|
||||||
|
public static final String PLAYBACK_SPEED = "playback_speed";
|
||||||
|
|
||||||
protected Bitmap videoThumbnail = null;
|
protected Bitmap videoThumbnail = null;
|
||||||
protected String videoUrl = "";
|
protected String videoUrl = "";
|
||||||
@ -176,6 +180,7 @@ public abstract class BasePlayer implements ExoPlayer.EventListener, AudioManage
|
|||||||
videoThumbnailUrl = intent.getStringExtra(VIDEO_THUMBNAIL_URL);
|
videoThumbnailUrl = intent.getStringExtra(VIDEO_THUMBNAIL_URL);
|
||||||
videoStartPos = intent.getIntExtra(START_POSITION, -1);
|
videoStartPos = intent.getIntExtra(START_POSITION, -1);
|
||||||
channelName = intent.getStringExtra(CHANNEL_NAME);
|
channelName = intent.getStringExtra(CHANNEL_NAME);
|
||||||
|
setPlaybackSpeed(intent.getFloatExtra(PLAYBACK_SPEED, getPlaybackSpeed()));
|
||||||
|
|
||||||
initThumbnail();
|
initThumbnail();
|
||||||
//play(getSelectedVideoStream(), true);
|
//play(getSelectedVideoStream(), true);
|
||||||
@ -438,6 +443,10 @@ public abstract class BasePlayer implements ExoPlayer.EventListener, AudioManage
|
|||||||
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
|
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadingChanged(boolean isLoading) {
|
public void onLoadingChanged(boolean isLoading) {
|
||||||
if (DEBUG) Log.d(TAG, "onLoadingChanged() called with: isLoading = [" + isLoading + "]");
|
if (DEBUG) Log.d(TAG, "onLoadingChanged() called with: isLoading = [" + isLoading + "]");
|
||||||
@ -556,6 +565,7 @@ public abstract class BasePlayer implements ExoPlayer.EventListener, AudioManage
|
|||||||
|
|
||||||
private final StringBuilder stringBuilder = new StringBuilder();
|
private final StringBuilder stringBuilder = new StringBuilder();
|
||||||
private final Formatter formatter = new Formatter(stringBuilder, Locale.getDefault());
|
private final Formatter formatter = new Formatter(stringBuilder, Locale.getDefault());
|
||||||
|
private final NumberFormat speedFormatter = new DecimalFormat("0.##x");
|
||||||
|
|
||||||
public String getTimeString(int milliSeconds) {
|
public String getTimeString(int milliSeconds) {
|
||||||
long seconds = (milliSeconds % 60000L) / 1000L;
|
long seconds = (milliSeconds % 60000L) / 1000L;
|
||||||
@ -569,6 +579,10 @@ public abstract class BasePlayer implements ExoPlayer.EventListener, AudioManage
|
|||||||
: formatter.format("%02d:%02d", minutes, seconds).toString();
|
: formatter.format("%02d:%02d", minutes, seconds).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String formatSpeed(float speed) {
|
||||||
|
return speedFormatter.format(speed);
|
||||||
|
}
|
||||||
|
|
||||||
protected void startProgressLoop() {
|
protected void startProgressLoop() {
|
||||||
progressLoop.removeCallbacksAndMessages(null);
|
progressLoop.removeCallbacksAndMessages(null);
|
||||||
isProgressLoopRunning.set(true);
|
isProgressLoopRunning.set(true);
|
||||||
@ -714,4 +728,12 @@ public abstract class BasePlayer implements ExoPlayer.EventListener, AudioManage
|
|||||||
public void setVideoThumbnailUrl(String videoThumbnailUrl) {
|
public void setVideoThumbnailUrl(String videoThumbnailUrl) {
|
||||||
this.videoThumbnailUrl = videoThumbnailUrl;
|
this.videoThumbnailUrl = videoThumbnailUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float getPlaybackSpeed() {
|
||||||
|
return simpleExoPlayer.getPlaybackParameters().speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlaybackSpeed(float speed) {
|
||||||
|
simpleExoPlayer.setPlaybackParameters(new PlaybackParameters(speed, 1f));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ public class MainVideoPlayer extends Activity {
|
|||||||
animateView(playerImpl.getControlsRoot(), true, 300, 0, new Runnable() {
|
animateView(playerImpl.getControlsRoot(), true, 300, 0, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (getCurrentState() == STATE_PLAYING && !playerImpl.isQualityMenuVisible()) {
|
if (getCurrentState() == STATE_PLAYING && !playerImpl.isSomePopupMenuVisible()) {
|
||||||
hideControls(300, DEFAULT_CONTROLS_HIDE_TIME);
|
hideControls(300, DEFAULT_CONTROLS_HIDE_TIME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
//////////////////////////////////////////////////////////////////////////*/
|
//////////////////////////////////////////////////////////////////////////*/
|
||||||
|
|
||||||
public static final int DEFAULT_CONTROLS_HIDE_TIME = 3000; // 3 Seconds
|
public static final int DEFAULT_CONTROLS_HIDE_TIME = 3000; // 3 Seconds
|
||||||
|
private static final float[] PLAYBACK_SPEEDS = {0.5f, 0.75f, 1f, 1.25f, 1.5f, 1.75f, 2f};
|
||||||
|
|
||||||
private boolean startedFromNewPipe = true;
|
private boolean startedFromNewPipe = true;
|
||||||
private boolean wasPlaying = false;
|
private boolean wasPlaying = false;
|
||||||
@ -99,6 +100,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
private SeekBar playbackSeekBar;
|
private SeekBar playbackSeekBar;
|
||||||
private TextView playbackCurrentTime;
|
private TextView playbackCurrentTime;
|
||||||
private TextView playbackEndTime;
|
private TextView playbackEndTime;
|
||||||
|
private TextView playbackSpeed;
|
||||||
|
|
||||||
private View topControlsRoot;
|
private View topControlsRoot;
|
||||||
private TextView qualityTextView;
|
private TextView qualityTextView;
|
||||||
@ -107,11 +109,14 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
private ValueAnimator controlViewAnimator;
|
private ValueAnimator controlViewAnimator;
|
||||||
private Handler controlsVisibilityHandler = new Handler();
|
private Handler controlsVisibilityHandler = new Handler();
|
||||||
|
|
||||||
private boolean isQualityPopupMenuVisible = false;
|
private boolean isSomePopupMenuVisible = false;
|
||||||
private boolean qualityChanged = false;
|
private boolean qualityChanged = false;
|
||||||
private int qualityPopupMenuGroupId = 69;
|
private int qualityPopupMenuGroupId = 69;
|
||||||
private PopupMenu qualityPopupMenu;
|
private PopupMenu qualityPopupMenu;
|
||||||
|
|
||||||
|
private int playbackSpeedPopupMenuGroupId = 79;
|
||||||
|
private PopupMenu playbackSpeedPopupMenu;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public VideoPlayer(String debugTag, Context context) {
|
public VideoPlayer(String debugTag, Context context) {
|
||||||
@ -138,6 +143,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
this.playbackSeekBar = (SeekBar) rootView.findViewById(R.id.playbackSeekBar);
|
this.playbackSeekBar = (SeekBar) rootView.findViewById(R.id.playbackSeekBar);
|
||||||
this.playbackCurrentTime = (TextView) rootView.findViewById(R.id.playbackCurrentTime);
|
this.playbackCurrentTime = (TextView) rootView.findViewById(R.id.playbackCurrentTime);
|
||||||
this.playbackEndTime = (TextView) rootView.findViewById(R.id.playbackEndTime);
|
this.playbackEndTime = (TextView) rootView.findViewById(R.id.playbackEndTime);
|
||||||
|
this.playbackSpeed = (TextView) rootView.findViewById(R.id.playbackSpeed);
|
||||||
this.bottomControlsRoot = rootView.findViewById(R.id.bottomControls);
|
this.bottomControlsRoot = rootView.findViewById(R.id.bottomControls);
|
||||||
this.topControlsRoot = rootView.findViewById(R.id.topControls);
|
this.topControlsRoot = rootView.findViewById(R.id.topControls);
|
||||||
this.qualityTextView = (TextView) rootView.findViewById(R.id.qualityTextView);
|
this.qualityTextView = (TextView) rootView.findViewById(R.id.qualityTextView);
|
||||||
@ -149,6 +155,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
this.playbackSeekBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.MULTIPLY);
|
this.playbackSeekBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.MULTIPLY);
|
||||||
|
|
||||||
this.qualityPopupMenu = new PopupMenu(context, qualityTextView);
|
this.qualityPopupMenu = new PopupMenu(context, qualityTextView);
|
||||||
|
this.playbackSpeedPopupMenu = new PopupMenu(context, playbackSpeed);
|
||||||
|
|
||||||
((ProgressBar) this.loadingPanel.findViewById(R.id.progressBarLoadingPanel)).getIndeterminateDrawable().setColorFilter(Color.WHITE, PorterDuff.Mode.MULTIPLY);
|
((ProgressBar) this.loadingPanel.findViewById(R.id.progressBarLoadingPanel)).getIndeterminateDrawable().setColorFilter(Color.WHITE, PorterDuff.Mode.MULTIPLY);
|
||||||
|
|
||||||
@ -158,6 +165,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
public void initListeners() {
|
public void initListeners() {
|
||||||
super.initListeners();
|
super.initListeners();
|
||||||
playbackSeekBar.setOnSeekBarChangeListener(this);
|
playbackSeekBar.setOnSeekBarChangeListener(this);
|
||||||
|
playbackSpeed.setOnClickListener(this);
|
||||||
fullScreenButton.setOnClickListener(this);
|
fullScreenButton.setOnClickListener(this);
|
||||||
qualityTextView.setOnClickListener(this);
|
qualityTextView.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
@ -208,6 +216,9 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
qualityPopupMenu.getMenu().removeGroup(qualityPopupMenuGroupId);
|
qualityPopupMenu.getMenu().removeGroup(qualityPopupMenuGroupId);
|
||||||
buildQualityMenu(qualityPopupMenu);
|
buildQualityMenu(qualityPopupMenu);
|
||||||
|
|
||||||
|
playbackSpeedPopupMenu.getMenu().removeGroup(playbackSpeedPopupMenuGroupId);
|
||||||
|
buildPlaybackSpeedMenu(playbackSpeedPopupMenu);
|
||||||
|
|
||||||
super.playUrl(url, format, autoPlay);
|
super.playUrl(url, format, autoPlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,6 +241,15 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
popupMenu.setOnDismissListener(this);
|
popupMenu.setOnDismissListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void buildPlaybackSpeedMenu(PopupMenu popupMenu) {
|
||||||
|
for (int i = 0; i < PLAYBACK_SPEEDS.length; i++) {
|
||||||
|
popupMenu.getMenu().add(playbackSpeedPopupMenuGroupId, i, Menu.NONE, formatSpeed(PLAYBACK_SPEEDS[i]));
|
||||||
|
}
|
||||||
|
playbackSpeed.setText(formatSpeed(getPlaybackSpeed()));
|
||||||
|
popupMenu.setOnMenuItemClickListener(this);
|
||||||
|
popupMenu.setOnDismissListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
/*//////////////////////////////////////////////////////////////////////////
|
/*//////////////////////////////////////////////////////////////////////////
|
||||||
// States Implementation
|
// States Implementation
|
||||||
//////////////////////////////////////////////////////////////////////////*/
|
//////////////////////////////////////////////////////////////////////////*/
|
||||||
@ -346,6 +366,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
|
|
||||||
playbackSeekBar.setMax((int) simpleExoPlayer.getDuration());
|
playbackSeekBar.setMax((int) simpleExoPlayer.getDuration());
|
||||||
playbackEndTime.setText(getTimeString((int) simpleExoPlayer.getDuration()));
|
playbackEndTime.setText(getTimeString((int) simpleExoPlayer.getDuration()));
|
||||||
|
playbackSpeed.setText(formatSpeed(getPlaybackSpeed()));
|
||||||
|
|
||||||
super.onPrepared(playWhenReady);
|
super.onPrepared(playWhenReady);
|
||||||
}
|
}
|
||||||
@ -412,40 +433,53 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
onFullScreenButtonClicked();
|
onFullScreenButtonClicked();
|
||||||
} else if (v.getId() == qualityTextView.getId()) {
|
} else if (v.getId() == qualityTextView.getId()) {
|
||||||
onQualitySelectorClicked();
|
onQualitySelectorClicked();
|
||||||
|
} else if (v.getId() == playbackSpeed.getId()) {
|
||||||
|
onPlaybackSpeedClicked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when an item of the quality selector is selected
|
* Called when an item of the quality selector or the playback speed selector is selected
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onMenuItemClick(MenuItem menuItem) {
|
public boolean onMenuItemClick(MenuItem menuItem) {
|
||||||
if (DEBUG) Log.d(TAG, "onMenuItemClick() called with: menuItem = [" + menuItem + "], menuItem.getItemId = [" + menuItem.getItemId() + "]");
|
if (DEBUG) Log.d(TAG, "onMenuItemClick() called with: menuItem = [" + menuItem + "], menuItem.getItemId = [" + menuItem.getItemId() + "]");
|
||||||
if (selectedIndexStream == menuItem.getItemId()) return true;
|
|
||||||
setVideoStartPos((int) simpleExoPlayer.getCurrentPosition());
|
|
||||||
|
|
||||||
selectedIndexStream = menuItem.getItemId();
|
if (qualityPopupMenuGroupId == menuItem.getGroupId()) {
|
||||||
if (!(getCurrentState() == STATE_COMPLETED)) play(wasPlaying);
|
if (selectedIndexStream == menuItem.getItemId()) return true;
|
||||||
else qualityChanged = true;
|
setVideoStartPos((int) simpleExoPlayer.getCurrentPosition());
|
||||||
|
|
||||||
qualityTextView.setText(menuItem.getTitle());
|
selectedIndexStream = menuItem.getItemId();
|
||||||
return true;
|
if (!(getCurrentState() == STATE_COMPLETED)) play(wasPlaying);
|
||||||
|
else qualityChanged = true;
|
||||||
|
|
||||||
|
qualityTextView.setText(menuItem.getTitle());
|
||||||
|
return true;
|
||||||
|
} else if (playbackSpeedPopupMenuGroupId == menuItem.getGroupId()) {
|
||||||
|
int speedIndex = menuItem.getItemId();
|
||||||
|
float speed = PLAYBACK_SPEEDS[speedIndex];
|
||||||
|
|
||||||
|
setPlaybackSpeed(speed);
|
||||||
|
playbackSpeed.setText(formatSpeed(speed));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the quality selector is dismissed
|
* Called when some popup menu is dismissed
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onDismiss(PopupMenu menu) {
|
public void onDismiss(PopupMenu menu) {
|
||||||
if (DEBUG) Log.d(TAG, "onDismiss() called with: menu = [" + menu + "]");
|
if (DEBUG) Log.d(TAG, "onDismiss() called with: menu = [" + menu + "]");
|
||||||
isQualityPopupMenuVisible = false;
|
isSomePopupMenuVisible = false;
|
||||||
qualityTextView.setText(getSelectedVideoStream().resolution);
|
qualityTextView.setText(getSelectedVideoStream().resolution);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onQualitySelectorClicked() {
|
public void onQualitySelectorClicked() {
|
||||||
if (DEBUG) Log.d(TAG, "onQualitySelectorClicked() called");
|
if (DEBUG) Log.d(TAG, "onQualitySelectorClicked() called");
|
||||||
qualityPopupMenu.show();
|
qualityPopupMenu.show();
|
||||||
isQualityPopupMenuVisible = true;
|
isSomePopupMenuVisible = true;
|
||||||
showControls(300);
|
showControls(300);
|
||||||
|
|
||||||
VideoStream videoStream = getSelectedVideoStream();
|
VideoStream videoStream = getSelectedVideoStream();
|
||||||
@ -453,6 +487,13 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
wasPlaying = isPlaying();
|
wasPlaying = isPlaying();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onPlaybackSpeedClicked() {
|
||||||
|
if (DEBUG) Log.d(TAG, "onPlaybackSpeedClicked() called");
|
||||||
|
playbackSpeedPopupMenu.show();
|
||||||
|
isSomePopupMenuVisible = true;
|
||||||
|
showControls(300);
|
||||||
|
}
|
||||||
|
|
||||||
/*//////////////////////////////////////////////////////////////////////////
|
/*//////////////////////////////////////////////////////////////////////////
|
||||||
// SeekBar Listener
|
// SeekBar Listener
|
||||||
//////////////////////////////////////////////////////////////////////////*/
|
//////////////////////////////////////////////////////////////////////////*/
|
||||||
@ -553,8 +594,8 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
|
|||||||
controlViewAnimator.start();
|
controlViewAnimator.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isQualityMenuVisible() {
|
public boolean isSomePopupMenuVisible() {
|
||||||
return isQualityPopupMenuVisible;
|
return isSomePopupMenuVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showControlsThenHide() {
|
public void showControlsThenHide() {
|
||||||
|
@ -51,7 +51,8 @@ public class NavigationHelper {
|
|||||||
.putExtra(VideoPlayer.INDEX_SEL_VIDEO_STREAM, instance.getSelectedStreamIndex())
|
.putExtra(VideoPlayer.INDEX_SEL_VIDEO_STREAM, instance.getSelectedStreamIndex())
|
||||||
.putExtra(VideoPlayer.VIDEO_STREAMS_LIST, instance.getVideoStreamsList())
|
.putExtra(VideoPlayer.VIDEO_STREAMS_LIST, instance.getVideoStreamsList())
|
||||||
.putExtra(VideoPlayer.VIDEO_ONLY_AUDIO_STREAM, instance.getAudioStream())
|
.putExtra(VideoPlayer.VIDEO_ONLY_AUDIO_STREAM, instance.getAudioStream())
|
||||||
.putExtra(BasePlayer.START_POSITION, ((int) instance.getPlayer().getCurrentPosition()));
|
.putExtra(BasePlayer.START_POSITION, ((int) instance.getPlayer().getCurrentPosition()))
|
||||||
|
.putExtra(BasePlayer.PLAYBACK_SPEED, instance.getPlaybackSpeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Intent getOpenBackgroundPlayerIntent(Context context, StreamInfo info) {
|
public static Intent getOpenBackgroundPlayerIntent(Context context, StreamInfo info) {
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
android:layout_height="35dp"
|
android:layout_height="35dp"
|
||||||
android:layout_marginLeft="2dp"
|
android:layout_marginLeft="2dp"
|
||||||
android:layout_marginRight="2dp"
|
android:layout_marginRight="2dp"
|
||||||
android:layout_toLeftOf="@+id/screenRotationButton"
|
android:layout_toLeftOf="@+id/playbackSpeed"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:minWidth="50dp"
|
android:minWidth="50dp"
|
||||||
android:text="720p"
|
android:text="720p"
|
||||||
@ -115,6 +115,20 @@
|
|||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:ignore="HardcodedText,RtlHardcoded"/>
|
tools:ignore="HardcodedText,RtlHardcoded"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/playbackSpeed"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:layout_toLeftOf="@+id/screenRotationButton"
|
||||||
|
android:gravity="center"
|
||||||
|
android:minHeight="35dp"
|
||||||
|
android:minWidth="40dp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry"
|
||||||
|
tools:text="1x" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/screenRotationButton"
|
android:id="@+id/screenRotationButton"
|
||||||
android:layout_width="35dp"
|
android:layout_width="35dp"
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/black"
|
android:background="@android:color/black"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
tools:layout_width="@dimen/popup_default_width"
|
tools:layout_height="84dp"
|
||||||
tools:layout_height="101.25dp">
|
tools:layout_width="@dimen/popup_minimum_width">
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout
|
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout
|
||||||
@ -56,21 +56,34 @@
|
|||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:background="@drawable/player_top_controls_bg"
|
android:background="@drawable/player_top_controls_bg"
|
||||||
android:paddingBottom="20dp"
|
android:paddingBottom="20dp"
|
||||||
android:paddingLeft="6dp"
|
android:paddingLeft="2dp"
|
||||||
android:paddingRight="6dp"
|
android:paddingRight="6dp"
|
||||||
android:paddingTop="4dp">
|
android:paddingTop="4dp"
|
||||||
|
tools:ignore="RtlHardcoded">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/qualityTextView"
|
android:id="@+id/qualityTextView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:padding="5dp"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="720p"
|
android:padding="5dp"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:ignore="HardcodedText,RtlHardcoded,RtlSymmetry"/>
|
tools:ignore="RtlHardcoded,RtlSymmetry"
|
||||||
|
tools:text="1080p60"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/playbackSpeed"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_toRightOf="@+id/qualityTextView"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="6dp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:ignore="RelativeOverlap,RtlHardcoded,RtlSymmetry"
|
||||||
|
tools:text="1.75x"/>
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/fullScreenButton"
|
android:id="@+id/fullScreenButton"
|
||||||
@ -142,7 +155,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:weightSum="5">
|
android:weightSum="5.5">
|
||||||
<!--tools:visibility="gone">-->
|
<!--tools:visibility="gone">-->
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -207,5 +220,5 @@
|
|||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:ignore="RtlHardcoded"
|
tools:ignore="RtlHardcoded"
|
||||||
tools:visibility="visible"/>
|
tools:visibility="gone"/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<dimen name="popup_default_width">230dp</dimen>
|
<dimen name="popup_default_width">230dp</dimen>
|
||||||
<dimen name="popup_minimum_width">140dp</dimen>
|
<dimen name="popup_minimum_width">160dp</dimen>
|
||||||
<!-- Video Item Detail View Dimensions-->
|
<!-- Video Item Detail View Dimensions-->
|
||||||
<!-- Text Size -->
|
<!-- Text Size -->
|
||||||
<dimen name="channel_item_detail_title_text_size">18sp</dimen>
|
<dimen name="channel_item_detail_title_text_size">18sp</dimen>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<dimen name="video_item_detail_description_to_details_margin">4dp</dimen>
|
<dimen name="video_item_detail_description_to_details_margin">4dp</dimen>
|
||||||
<!-- Miscellaneous -->
|
<!-- Miscellaneous -->
|
||||||
<dimen name="popup_default_width">180dp</dimen>
|
<dimen name="popup_default_width">180dp</dimen>
|
||||||
<dimen name="popup_minimum_width">120dp</dimen>
|
<dimen name="popup_minimum_width">150dp</dimen>
|
||||||
<!-- Video Item Detail View Dimensions-->
|
<!-- Video Item Detail View Dimensions-->
|
||||||
<!-- Text Size -->
|
<!-- Text Size -->
|
||||||
<dimen name="video_item_detail_title_text_size">16sp</dimen>
|
<dimen name="video_item_detail_title_text_size">16sp</dimen>
|
||||||
|
Loading…
Reference in New Issue
Block a user