From 629a75ed1cf7fa4fb5b140d0dd6010438153b0a9 Mon Sep 17 00:00:00 2001 From: bachinger Date: Fri, 17 Feb 2023 17:55:44 +0000 Subject: [PATCH] Map `PLAYER_STATE_LOADING` to `STATE_BUFFERING` #minor-release Issue: androidx/media#245 PiperOrigin-RevId: 510456793 (cherry picked from commit ba49b6b81b9a6a01aa16381cca70886bc205c5c5) --- RELEASENOTES.md | 3 +++ .../cast/src/main/java/androidx/media3/cast/CastPlayer.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 2b984f4350..b2e3e68927 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -101,6 +101,9 @@ This release corresponds to the * Cast extension: * Bump Cast SDK version to 21.2.0. * IMA extension: + * Map `PLAYER_STATE_LOADING` to `STATE_BUFFERING` + ([#245](\(https://github.com/androidx/media/issues/245\)). +* IMA extension * Remove player listener of the `ImaServerSideAdInsertionMediaSource` on the application thread to avoid threading issues. * Add a property `focusSkipButtonWhenAvailable` to the diff --git a/libraries/cast/src/main/java/androidx/media3/cast/CastPlayer.java b/libraries/cast/src/main/java/androidx/media3/cast/CastPlayer.java index 8d2a0cbde1..dbf61395bd 100644 --- a/libraries/cast/src/main/java/androidx/media3/cast/CastPlayer.java +++ b/libraries/cast/src/main/java/androidx/media3/cast/CastPlayer.java @@ -1237,6 +1237,7 @@ public final class CastPlayer extends BasePlayer { int receiverAppStatus = remoteMediaClient.getPlayerState(); switch (receiverAppStatus) { case MediaStatus.PLAYER_STATE_BUFFERING: + case MediaStatus.PLAYER_STATE_LOADING: return STATE_BUFFERING; case MediaStatus.PLAYER_STATE_PLAYING: case MediaStatus.PLAYER_STATE_PAUSED: @@ -1299,6 +1300,7 @@ public final class CastPlayer extends BasePlayer { return false; } + @SuppressWarnings("VisibleForTests") private static int getCastRepeatMode(@RepeatMode int repeatMode) { switch (repeatMode) { case REPEAT_MODE_ONE: