File tree Expand file tree Collapse file tree
demos/main/src/main/java/androidx/media3/demo/main Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public class IntentUtil {
6767 public static final String SUBTITLE_URI_EXTRA = "subtitle_uri" ;
6868 public static final String SUBTITLE_MIME_TYPE_EXTRA = "subtitle_mime_type" ;
6969 public static final String SUBTITLE_LANGUAGE_EXTRA = "subtitle_language" ;
70- public static final String PLAYER_REPEAT_MODE_EXTRA = "repeat_mode" ;
70+ public static final String REPEAT_MODE_EXTRA = "repeat_mode" ;
7171
7272 public static @ Player .RepeatMode int parseRepeatModeExtra (String repeatMode ) {
7373 switch (repeatMode ) {
Original file line number Diff line number Diff line change @@ -262,8 +262,8 @@ protected void setContentView() {
262262 * @return Whether initialization was successful.
263263 */
264264 protected boolean initializePlayer () {
265+ Intent intent = getIntent ();
265266 if (player == null ) {
266- Intent intent = getIntent ();
267267
268268 mediaItems = createMediaItems (intent );
269269 if (mediaItems .isEmpty ()) {
@@ -293,11 +293,9 @@ protected boolean initializePlayer() {
293293 }
294294 player .setMediaItems (mediaItems , /* resetPosition= */ !haveStartPosition );
295295 player .prepare ();
296- String requestedRepeatModeExtra ;
297- if ((requestedRepeatModeExtra =
298- this .getIntent ().getStringExtra (IntentUtil .PLAYER_REPEAT_MODE_EXTRA ))
299- != null ) {
300- player .setRepeatMode (IntentUtil .parseRepeatModeExtra (requestedRepeatModeExtra ));
296+ String repeatModeExtra = intent .getStringExtra (IntentUtil .REPEAT_MODE_EXTRA );
297+ if (repeatModeExtra != null ) {
298+ player .setRepeatMode (IntentUtil .parseRepeatModeExtra (repeatModeExtra ));
301299 }
302300 updateButtonVisibility ();
303301 return true ;
You can’t perform that action at this time.
0 commit comments