Skip to content

Update to AndroidX Media3 1.8.0#1116

Merged
MGaetan89 merged 3 commits intomainfrom
media3_1.8.0
Aug 11, 2025
Merged

Update to AndroidX Media3 1.8.0#1116
MGaetan89 merged 3 commits intomainfrom
media3_1.8.0

Conversation

@MGaetan89
Copy link
Contributor

@MGaetan89 MGaetan89 commented Jul 22, 2025

Pull request

Description

This PR updates the project to AndroidX Media3 1.8.0.

Changes made

  • Update usages of TargetPreloadStatusControl to match its new API.
  • Remove deprecated methods from AndroidX Media3.
  • Fix deprecation warning in CommandersActStreamingTest.
  • Fix a crash in SpriteSheetMediaPeriod (see Update to AndroidX Media3 1.8.0 #1116 (comment)).

Checklist

  • APIs have been properly documented (if relevant).
  • The documentation has been updated (if relevant).
  • New unit tests have been written (if relevant).
  • The demo has been updated (if relevant).

@MGaetan89 MGaetan89 self-assigned this Jul 22, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Pillarbox Jul 22, 2025
@github-actions
Copy link

github-actions bot commented Jul 22, 2025

Code Coverage

Overall Project 48.91% -0.03% 🟢
Files changed 50% 🟢

Module Coverage
:pillarbox-core-business 78.25% -0.03% 🟢
:pillarbox-player 54.44% -0.05% 🟢
Files
Module File Coverage
:pillarbox-core-business SpriteSheetMediaPeriod.kt 48.87% -0.45% 🟢
:pillarbox-player PillarboxPreloadManager.kt 87.65% -4.71% 🟢
PillarboxMediaController.kt 0% 🟢

@MGaetan89 MGaetan89 force-pushed the media3_1.8.0 branch 2 times, most recently from f451836 to 1da8430 Compare July 25, 2025 13:34
@MGaetan89 MGaetan89 force-pushed the media3_1.8.0 branch 2 times, most recently from 169899e to 18bec23 Compare July 31, 2025 08:09
@MGaetan89
Copy link
Contributor Author

MGaetan89 commented Jul 31, 2025

The thumbnail showcase crashes while seeking with:

java.lang.IllegalArgumentException: Out of range: 699609517647
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:204)
    at com.google.common.primitives.Ints.checkedCast(Ints.java:88)
    at androidx.media3.common.util.Util.percentInt(Util.java:1239)
    at androidx.media3.session.MediaUtils.calculateBufferedPercentage(MediaUtils.java:172)
    at androidx.media3.session.MediaControllerImplBase.maskPositionInfo(MediaControllerImplBase.java:3236)
    at androidx.media3.session.MediaControllerImplBase.seekToInternal(MediaControllerImplBase.java:2301)
    at androidx.media3.session.MediaControllerImplBase.seekTo(MediaControllerImplBase.java:509)
    at androidx.media3.session.MediaController.seekTo(MediaController.java:799)
    at ch.srgssr.pillarbox.player.session.PillarboxMediaController.seekTo(PillarboxMediaController.kt:602)
    at ch.srgssr.pillarbox.ui.SmoothProgressTrackerState.onChanged-LRDsOJo(SmoothProgressTrackerState.kt:65)
    at ch.srgssr.pillarbox.demo.ui.player.controls.PlayerTimeSliderKt.PlayerTimeSlider$lambda$12$lambda$10$lambda$9(PlayerTimeSlider.kt:138)
    at ch.srgssr.pillarbox.demo.ui.player.controls.PlayerTimeSliderKt.$r8$lambda$-gPo8ByNnkBRdzCjq4q9DvI1hks(Unknown Source:0)
    at ch.srgssr.pillarbox.demo.ui.player.controls.PlayerTimeSliderKt$$ExternalSyntheticLambda0.invoke(D8$$SyntheticClass:0)
    at ch.srgssr.pillarbox.demo.shared.ui.components.PillarboxSliderKt.PillarboxSlider_dr0wlkM$lambda$26$lambda$25(PillarboxSlider.kt:198)
    at ch.srgssr.pillarbox.demo.shared.ui.components.PillarboxSliderKt.$r8$lambda$teO684OxZjMlu8yNhx1VcQPFWww(Unknown Source:0)
    at ch.srgssr.pillarbox.demo.shared.ui.components.PillarboxSliderKt$$ExternalSyntheticLambda9.invoke(D8$$SyntheticClass:0)
    at ch.srgssr.pillarbox.demo.shared.ui.components.PillarboxSliderKt$dragThumb$1.invoke$notifySliderValueChange(PillarboxSlider.kt:365)
    at ch.srgssr.pillarbox.demo.shared.ui.components.PillarboxSliderKt$dragThumb$1.invoke$lambda$4(PillarboxSlider.kt:382)
    at ch.srgssr.pillarbox.demo.shared.ui.components.PillarboxSliderKt$dragThumb$1.$r8$lambda$1iIqaguNTki0cKqwlBg1cRuFfik(Unknown Source:0)
    at ch.srgssr.pillarbox.demo.shared.ui.components.PillarboxSliderKt$dragThumb$1$$ExternalSyntheticLambda3.invoke(D8$$SyntheticClass:0)
    at androidx.compose.foundation.gestures.DragGestureDetectorKt$detectHorizontalDragGestures$5$1.invoke(DragGestureDetector.kt:673)

This doesn't happen on main. I'll investigate to see if this is an issue on our side or Media3.

@MGaetan89
Copy link
Contributor Author

It looks like a non-SRG media works fine. So the issue may be coming from one of our SRG wrapper class.

As explained in the documentation of the `MediaPeriod#getBufferedPositionUs()` and `MediaPeriod#getNextLoadPositionUs()`, we should return `C.TIME_END_OF_SOURCE` instead of `C.TIME_UNSET` as a default value.
@MGaetan89
Copy link
Contributor Author

The crash has been fixed in 080340d

@MGaetan89 MGaetan89 requested a review from StaehliJ August 6, 2025 14:36
@MGaetan89 MGaetan89 moved this from 🚧 In Progress to 🍿 Code Review in Pillarbox Aug 6, 2025
@MGaetan89 MGaetan89 marked this pull request as ready for review August 6, 2025 14:36
@MGaetan89 MGaetan89 added this pull request to the merge queue Aug 11, 2025
Merged via the queue into main with commit 5b8f7b6 Aug 11, 2025
12 checks passed
@MGaetan89 MGaetan89 deleted the media3_1.8.0 branch August 11, 2025 08:19
@github-project-automation github-project-automation bot moved this from 🍿 Code Review to ✅ Done in Pillarbox Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants