2.0.0
Player
- Improved system integration and background playback through custom
MediaController
andMediaSession
classes. Check the documentation for more information. - Added a new
Player.isAtLiveEdge(Long, Window)
method to know if the media is at live edge. - New way to load a media from a custom source by providing a custom
AssetLoader
implementation:
val player = PillarboxExoPlayer(
context = context,
mediaSourceFactory = PillarboxMediaSourceFactory(context).apply {
addAssetLoader(SRGAssetLoader(context)) // Provided by pillarbox-core-business to handled URNs
addAssetLoader(MyCustomAssetLoader())
},
)
- Added new methods to easily manage tracks:
val player: Player = ...
val currentTracks: Tracks = player.currentTracks
val tracks: List<Track> = currentTracks.tracks // Get all the supported tracks
val audioTracks: List<AudioTrack> = currentTracks.audioTracks // Get all the supported audio tracks
val textTracks: List<TextTrack> = currentTracks.textTracks // Get all the supported text tracks
val videoTracks: List<VideoTrack> = currentTracks.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
- Added support for blocked segments.
- Added support for chapters. You can use the following methods to access the corresponding information:
Player.getCurrentChapters(): List<Chapter> // Get all the chapters for the current media
Player.getChapterAtPosition(Long): Chapter? // Get the chapter at the provided position
Player.getCurrentChapterAsFlow(): Flow<Chapter?> // Observe the chapter currently playing as Flow
Player.getCurrentChapterAsState(): State<Chapter?> // Observe the chapter currently playing as State
- Added support for time intervals (intro/credits). You can use the following methods to access the corresponding information:
Player.getCurrentCredits(): List<Credit> // Get all the credits for the current media (opening credits, closing credits)
Player.getCreditAtPosition(Long): Credit? // Get the credit at the provided position
Player.getCurrentCreditAsFlow(): Flow<Credit?> // Observe the credit currently active as Flow
Player.getCurrentCreditAsState(): State<Credit?> // Observe the credit currently active as State
Core business
- Extract information about blocked segments, chapters and credits.
Demo
- The multi-player showcase has been improved to only have one player playing audio at a given time.
- Added a showcase to toggle repeat mode and to pause the media item when it ends.
- Added a showcase to display chapters.
- Added a showcase with a blocked segment.
Breaking changes
- The
mediaItemSource
anddataSourceFactory
arguments of theDefaultPillarbox
constructor have been removed. Please provide aMediaCompositionService
directly. TheMediaCompositionMediaItemSource
class and its related classes have been removed. PillarboxExoPlayer
is now a concrete class, whilePillarboxPlayer
has become an interface. Simply replace your usages ofPillarboxPlayer
byPillarboxExoPlayer
, andPillarboxExoPlayer
byPillarboxPlayer
:
// Pillarbox 1.0.0
val player: PillarboxExoPlayer = PillarboxPlayer(...)
// Pillarbox 2.0.0
val player: PillarboxPlayer = PillarboxExoPlayer(...)
Note
Following a change in AndroidX Media3 1.3.0, you should setup Java 8 APIs desugaring, by following this guide.
This is new requirement should be reverted in an upcoming version of AndroidX Media3 (see androidx/media#1312 (comment) for more information).
This should be done even if your min SDK version is 24+.
What's Changed
- Update README.md by @StaehliJ in #471
- Use movable content to swap players by @StaehliJ in #472
- Refactor Gradle build logic by @MGaetan89 in #474
- Refactor media loading by @StaehliJ in #475
- Update dependencies by @MGaetan89 in #481
- Update Robolectric to 4.12.1 by @MGaetan89 in #482
- Improve the multi player showcase by @MGaetan89 in #478
- Extract analytics from
CurrentMediaItemTracker
by @MGaetan89 in #483 - Don't filter out unsupported/forced tracks by @MGaetan89 in #487
- Improve media controller service by @StaehliJ in #485
- Add live indicator by @StaehliJ in #489
- Update the "Add to playlist" dialog by @MGaetan89 in #490
- Rework the main
Readme
by @MGaetan89 in #491 - Update dependencies by @MGaetan89 in #494
- Update 12h45 stream in the demo app by @waliid in #498
- Setup Dependabot by @MGaetan89 in #496
- Bump the actions group with 2 updates by @dependabot in #502
- Bump the androidx group with 6 updates by @dependabot in #504
- Improve live edge detection and provide Player extension by @StaehliJ in #505
- 451 handle chapters and blocked segments by @StaehliJ in #501
- Provide simplified tracks management by @MGaetan89 in #495
- Enable desugaring of java 8+ feature for android < 24 by @StaehliJ in #509
- Mitigate missing aspect ratio issue by @MGaetan89 in #507
- Add a showcase to customise playback settings by @MGaetan89 in #510
- 499 add chapters demo by @StaehliJ in #513
- 506 remove audio chapters by @StaehliJ in #514
- Add support for "Skip intro"/"Skip credits" by @MGaetan89 in #516
- Improve controls usability in the TV demo by @MGaetan89 in #520
- 519 simplify TimeRange management by @StaehliJ in #521
- Separate TimeRanges are it is a sealed interface and we don't really … by @StaehliJ in #524
- Make the Dependency Analysis plugin only fails for unused dependencies by @MGaetan89 in #526
- Fix urn name in the demo by @StaehliJ in #527
- Integrate Dokka by @MGaetan89 in #529
New Contributors
- @waliid made their first contribution in #498
- @dependabot made their first contribution in #502
Full Changelog: 1.0.0...2.0.0