Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

451 handle chapters and blocked segments #501

Merged
merged 38 commits into from
Apr 22, 2024
Merged

451 handle chapters and blocked segments #501

merged 38 commits into from
Apr 22, 2024

Conversation

StaehliJ
Copy link
Contributor

@StaehliJ StaehliJ commented Apr 17, 2024

Pull request

Description

The goal of this PR is to introduce chapters and blocked intervals to Pillarbox. Every MediaItem have a PillarboxData with all the metadata needed.

PillarboxPlayer will seek immediately when it's playback position reach a BlockedInterval. Users can be notified when it happens through PillarboxPlayer.Listener.onBlockIntervalReached.

Changes made

  • Add PillarboxPlayer.Listener.onBlockIntervalReached to be notified when PillarboxPlayer has seeked because of a BlockInterval.
  • Add PillarboxPlayer.Listener.onCurrentChapterChanged to listen current Chapter changes during playback.
  • Add an extension to fetch chapters Player.getCurrentChapters and Player.getChapterAtPosition
  • Add extension to fetch blocked intervals Player.getCurrentBlockedIntervals and Player.getBlockedIntervalAtPosition.
  • Update the demo to display the current chapter when the controls are visible.
  • Update the demo to display any chapters changes when controls are not visible.
  • Update the demo to display when a blocked interval has been reached.

Checklist

  • Your branch has been rebased onto the main branch.
  • 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).
  • All pull request status checks pass.

@StaehliJ StaehliJ changed the title 451 handle segment 451 handle chapters and blocked segments Apr 17, 2024
@StaehliJ StaehliJ force-pushed the 451-handle-segment branch from 5b4ce98 to 68d74be Compare April 17, 2024 14:07
@StaehliJ StaehliJ marked this pull request as ready for review April 17, 2024 14:22
@StaehliJ StaehliJ force-pushed the 451-handle-segment branch from 68d74be to cd30157 Compare April 18, 2024 08:52
@MGaetan89 MGaetan89 linked an issue Apr 19, 2024 that may be closed by this pull request
1 task
@StaehliJ StaehliJ force-pushed the 451-handle-segment branch from a25687f to 1021024 Compare April 19, 2024 08:30
Copy link

Code Coverage

Overall Project 46.59% -1.1% 🟢
Files changed 57.56% 🟢

Module Coverage
:pillarbox-core-business 85.02% -0.76% 🟢
:pillarbox-player 47.18% -1.73% 🟢
:pillarbox-ui 0% -0.69% 🟢
Files
Module File Coverage
:pillarbox-core-business SRGAssetLoader.kt 87.04% 🟢
Chapter.kt 54.42% 🟢
Segment.kt 49.23% -50.77% 🟢
:pillarbox-player Asset.kt 100% 🟢
PillarboxSessionCommands.kt 100% 🟢
MediaItem.kt 100% 🟢
AnalyticsMediaItemTracker.kt 96.52% 🟢
UrlAssetLoader.kt 92.41% 🟢
PillarboxMediaSource.kt 90.94% -2.01% 🟢
Player.kt 90.74% 🟢
PlayerCallbackFlow.kt 78.03% 🟢
PillarboxExoPlayer.kt 77.16% -0.56% 🟢
PillarboxMediaController.kt 0% -4.95% 🟢
PillarboxMediaSession.kt 0% -9.46% 🟢
PillarboxPlayer.kt 0% 🟢
:pillarbox-ui ComposablePlayer.kt 0% -3.82% 🟢

@MGaetan89 MGaetan89 added this pull request to the merge queue Apr 22, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 22, 2024
@MGaetan89 MGaetan89 added this pull request to the merge queue Apr 22, 2024
Merged via the queue into main with commit c2a4330 Apr 22, 2024
10 checks passed
@MGaetan89 MGaetan89 deleted the 451-handle-segment branch April 22, 2024 13:43
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.

Handle Blocked segment with MediaItemTracker
2 participants