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

Provide simplified tracks management #495

Merged
merged 20 commits into from
Apr 23, 2024

Conversation

MGaetan89
Copy link
Member

@MGaetan89 MGaetan89 commented Apr 12, 2024

Pull request

Description

This PR provides new APIs to manage audio/text/video tracks. The new APIs are located in the ch.srgssr.pillarbox.player.tracks package in the pillarbox-player module.

Tracks.tracks // Get all the supported tracks
Tracks.audioTracks // Get all the supported audio tracks
Tracks.textTracks // Get all the supported text tracks
Tracks.videoTracks // Get all the supported video tracks

Player.selectTrack(Track) // Select a single track
Player.enable<Audio|Text|Video>Track() // Enable a specific type of track
Player.disable<Audio|Text|Video>Track() // Disable a specific type of track
Player.setAuto<Audio|Text|Video>Track() // Restore the default track of a specific type

Changes made

  • Revert the existing APIs to how they were in Pillarbox 1.0.0, to keep the existing behaviour
  • Introduce new APIs to access/select/enable/disable audio/text/video tracks
  • Deprecated the existing APIs with migration information to the new APIs
  • Update both demo apps to add a Quality settings to allow the user to select the video quality
  • The Player.videoQualities extension returns a modified subset of Tracks.videoTracks:
    • The list contains only one track with a specific Format.height
    • Only one quality is ever selected, independently of the selected video tracks

Behaviour changes

  • The default aspect ratio now uses the first selected video track, instead of the first selected group of video tracks
  • Duplicated tracks are no longer listed

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.

@MGaetan89 MGaetan89 linked an issue Apr 12, 2024 that may be closed by this pull request
1 task
@MGaetan89 MGaetan89 force-pushed the 492-provide-simplified-tracks-management branch from f3041cc to 0b5d72b Compare April 12, 2024 15:14
Copy link

github-actions bot commented Apr 12, 2024

Code Coverage

Overall Project 46.59% -0.59% 🟢
Files changed 32.52% 🟢

Module Coverage
:pillarbox-core-business 85.02% -0.05% 🟢
:pillarbox-player 47.18% -1.2% 🟢
:pillarbox-ui 0% -0.25% 🟢
Files
Module File Coverage
:pillarbox-core-business CommandersActStreaming.kt 96.43% -0.3% 🟢
:pillarbox-player Tracks.kt 100% 🟢
PlayerCallbackFlow.kt 78.03% 🟢
TrackSelectionParameters.kt 1.77% -31.42% 🟢
PlayerTracks.kt 0% -58.14% 🟢
:pillarbox-ui PlayerSurface.kt 0% -1.65% 🟢

@MGaetan89 MGaetan89 force-pushed the 492-provide-simplified-tracks-management branch from 0b5d72b to 048d5bc Compare April 16, 2024 11:43
@MGaetan89 MGaetan89 marked this pull request as ready for review April 16, 2024 12:31
@MGaetan89
Copy link
Member Author

I've updated the PR to:

  • filter out video tracks with a trick-play role (765aad6)
  • filter out video qualities without a size of 0 or negative (bca23e5)

@MGaetan89 MGaetan89 force-pushed the 492-provide-simplified-tracks-management branch 2 times, most recently from e512d01 to 808c9c2 Compare April 18, 2024 19:05
@MGaetan89
Copy link
Member Author

Moved back to in progress:

  • Add a setting to change the video track
  • Remove the quality selector, and create a dedicated story

@MGaetan89 MGaetan89 force-pushed the 492-provide-simplified-tracks-management branch from 8229785 to af047c2 Compare April 22, 2024 14:37
@MGaetan89 MGaetan89 force-pushed the 492-provide-simplified-tracks-management branch from af047c2 to 0210eed Compare April 22, 2024 14:42
@StaehliJ StaehliJ added this pull request to the merge queue Apr 23, 2024
Merged via the queue into main with commit 1c3346e Apr 23, 2024
10 checks passed
@StaehliJ StaehliJ deleted the 492-provide-simplified-tracks-management branch April 23, 2024 09:42
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.

Provide simplified tracks management
2 participants