Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
marcbaechinger committed Apr 15, 2024
1 parent 20e98ca commit e1944d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class IntentUtil {
public static final String SUBTITLE_URI_EXTRA = "subtitle_uri";
public static final String SUBTITLE_MIME_TYPE_EXTRA = "subtitle_mime_type";
public static final String SUBTITLE_LANGUAGE_EXTRA = "subtitle_language";
public static final String PLAYER_REPEAT_MODE_EXTRA = "repeat_mode";
public static final String REPEAT_MODE_EXTRA = "repeat_mode";

public static @Player.RepeatMode int parseRepeatModeExtra(String repeatMode) {
switch (repeatMode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ protected void setContentView() {
* @return Whether initialization was successful.
*/
protected boolean initializePlayer() {
Intent intent = getIntent();
if (player == null) {
Intent intent = getIntent();

mediaItems = createMediaItems(intent);
if (mediaItems.isEmpty()) {
Expand Down Expand Up @@ -293,11 +293,9 @@ protected boolean initializePlayer() {
}
player.setMediaItems(mediaItems, /* resetPosition= */ !haveStartPosition);
player.prepare();
String requestedRepeatModeExtra;
if ((requestedRepeatModeExtra =
this.getIntent().getStringExtra(IntentUtil.PLAYER_REPEAT_MODE_EXTRA))
!= null) {
player.setRepeatMode(IntentUtil.parseRepeatModeExtra(requestedRepeatModeExtra));
String repeatModeExtra = intent.getStringExtra(IntentUtil.REPEAT_MODE_EXTRA);
if (repeatModeExtra != null) {
player.setRepeatMode(IntentUtil.parseRepeatModeExtra(repeatModeExtra));
}
updateButtonVisibility();
return true;
Expand Down

0 comments on commit e1944d3

Please sign in to comment.