Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions constants.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
project.ext {
releaseVersion = '1.4.1-dr5'
releaseVersionCode = 1_004_001_5_00
releaseVersion = '1.4.1-dr6'
releaseVersionCode = 1_004_001_6_00
minSdkVersion = 19
// See https://developer.android.com/training/cars/media/automotive-os#automotive-module
automotiveMinSdkVersion = 28
Expand Down
23 changes: 23 additions & 0 deletions libraries/ui/src/main/java/androidx/media3/ui/PlayerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ public interface FullscreenButtonClickListener {
private boolean controllerHideOnTouch;
private int textureViewRotation;

/** Indicates if the playback media is currently prepared. */
private boolean isPlaybackPrepared = true;

public PlayerView(Context context) {
this(context, /* attrs= */ null);
}
Expand Down Expand Up @@ -1308,6 +1311,20 @@ public void setLimitedSeekRange(LimitedSeekRange limitedSeekRange) {
}
}

/**
* Sets whether the the playback media is currently prepared.
*
* @param prepared Indicates if the playback media is currently prepared.
*/
public void setPlaybackPrepared(boolean prepared) {
if (prepared && !isPlaybackPrepared) {
mainLooperHandler.postDelayed(() -> isPlaybackPrepared = true, 200L);
componentListener.hideShutterView();
} else if (!prepared && isPlaybackPrepared) {
isPlaybackPrepared = false;
}
}

/**
* Sets the {@link AspectRatioFrameLayout.AspectRatioListener}.
*
Expand Down Expand Up @@ -1904,6 +1921,12 @@ public void onSurfaceSizeChanged(int width, int height) {

@Override
public void onRenderedFirstFrame() {
if (isPlaybackPrepared) {
hideShutterView();
}
}

private void hideShutterView() {
if (shutterView != null) {
shutterView.setVisibility(INVISIBLE);
if (hasSelectedImageTrack()) {
Expand Down