SRGSSR / pillarbox-android

The modern SRG SSR Pillarbox player targeting Android platforms
https://android.pillarbox.ch/api
MIT License
13 stars 1 forks source link

748 simplify player creation #760

Closed StaehliJ closed 1 week ago

StaehliJ commented 1 week ago

Pull request

Description

This PR improve some Pillarbox component creation with DSL.

PillarboxExoPlayer

PillarboxExoPlayer can be configured easily

val player = PillarboxExoPlayer(context) {
      monitoring() {
            monitoring(LogCat)
            seekForwardIncrement(10.seconds)
      }
}

SRGMediaItem

val mediaItem = SRGMediaItem(urn) {
      host(IlHost.Prod)
      mediaMetadata {
          setTitle("Title)
          setDescription("Description")
      }
}

SRGAssetLoader

val assetLoader = SRGAssetLoader(context) {
      mediaCompositionService(MyService)
}

Changes made

Checklist

github-actions[bot] commented 1 week ago

Code Coverage

Overall Project 48.45% -0.94% 🟢
Files changed 72.47% 🟢


Module Coverage
:pillarbox-core-business 82.42% -0.86% 🟢
:pillarbox-player 56.7% -1.54% 🟢
Files |Module|File|Coverage|| |:-|:-|:-|:-:| |:pillarbox-core-business|[SRGMediaItem.kt](https://github.com/SRGSSR/pillarbox-android/blob/4f05481d3a4990ce7fe86a83171806aacac6d1b9/pillarbox-core-business%2Fsrc%2Fmain%2Fjava%2Fch%2Fsrgssr%2Fpillarbox%2Fcore%2Fbusiness%2FSRGMediaItem.kt)|98.71%|🟢| ||[DefaultMediaMetaDataProvider.kt](https://github.com/SRGSSR/pillarbox-android/blob/4f05481d3a4990ce7fe86a83171806aacac6d1b9/pillarbox-core-business%2Fsrc%2Fmain%2Fjava%2Fch%2Fsrgssr%2Fpillarbox%2Fcore%2Fbusiness%2Fsource%2FDefaultMediaMetaDataProvider.kt)|97.78% **`-1.48%`**|🟢| ||[SRGAssetLoader.kt](https://github.com/SRGSSR/pillarbox-android/blob/4f05481d3a4990ce7fe86a83171806aacac6d1b9/pillarbox-core-business%2Fsrc%2Fmain%2Fjava%2Fch%2Fsrgssr%2Fpillarbox%2Fcore%2Fbusiness%2Fsource%2FSRGAssetLoader.kt)|88.78% **`-1.7%`**|🟢| ||[SRGAssetLoaderConfig.kt](https://github.com/SRGSSR/pillarbox-android/blob/4f05481d3a4990ce7fe86a83171806aacac6d1b9/pillarbox-core-business%2Fsrc%2Fmain%2Fjava%2Fch%2Fsrgssr%2Fpillarbox%2Fcore%2Fbusiness%2Fsource%2FSRGAssetLoaderConfig.kt)|82.57% **`-17.43%`**|🟢| ||[PillarboxSRG.kt](https://github.com/SRGSSR/pillarbox-android/blob/4f05481d3a4990ce7fe86a83171806aacac6d1b9/pillarbox-core-business%2Fsrc%2Fmain%2Fjava%2Fch%2Fsrgssr%2Fpillarbox%2Fcore%2Fbusiness%2FPillarboxSRG.kt)|80.68% **`-19.32%`**|🟢| |:pillarbox-player|[PillarboxBuilder.kt](https://github.com/SRGSSR/pillarbox-android/blob/4f05481d3a4990ce7fe86a83171806aacac6d1b9/pillarbox-player%2Fsrc%2Fmain%2Fjava%2Fch%2Fsrgssr%2Fpillarbox%2Fplayer%2FPillarboxBuilder.kt)|81.41% **`-18.59%`**|🟢| ||[PillarboxExoPlayer.kt](https://github.com/SRGSSR/pillarbox-android/blob/4f05481d3a4990ce7fe86a83171806aacac6d1b9/pillarbox-player%2Fsrc%2Fmain%2Fjava%2Fch%2Fsrgssr%2Fpillarbox%2Fplayer%2FPillarboxExoPlayer.kt)|73.12%|🟢| ||[MetricsCollector.kt](https://github.com/SRGSSR/pillarbox-android/blob/4f05481d3a4990ce7fe86a83171806aacac6d1b9/pillarbox-player%2Fsrc%2Fmain%2Fjava%2Fch%2Fsrgssr%2Fpillarbox%2Fplayer%2Fanalytics%2Fmetrics%2FMetricsCollector.kt)|66.25%|🟢| ||[MonitoringMessageHandler.kt](https://github.com/SRGSSR/pillarbox-android/blob/4f05481d3a4990ce7fe86a83171806aacac6d1b9/pillarbox-player%2Fsrc%2Fmain%2Fjava%2Fch%2Fsrgssr%2Fpillarbox%2Fplayer%2Fmonitoring%2FMonitoringMessageHandler.kt)|3.55% **`-96.45%`**|🟢|