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

891 add dsl for pillarboxcastplayer #894

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

StaehliJ
Copy link
Contributor

@StaehliJ StaehliJ commented Feb 12, 2025

Pull request

Description

Introduce same dsl pattern as it has been done with PillarboxExoPlayer that can configure each aspect of a PillarboxCastPlayer.

Samples

import ch.srgssr.pillarbox.cast.PillarboxCastPlayer

val castPlayer = PillarboxCastPlayer(context, Default) {
      mediaItemConverter(MyMediaItemConverter())
      seekBackIncrement(10.seconds)
      seekForwardIncrement(10.seconds)
      ....
}
import ch.srgssr.pillarbox.core.business.cast.PillarboxCastPlayer

val castPlayer = PillarboxCastPlayer(context) // SRG Configured.

Changes made

  • Add a SRG PillarboxCastPlayer builder that configure everything for SRG SSR content and Letterbox receiver.

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).

@StaehliJ StaehliJ linked an issue Feb 12, 2025 that may be closed by this pull request
1 task
Copy link

github-actions bot commented Feb 12, 2025

Code Coverage

Overall Project 50.98% -0.62% 🟢
Files changed 0% 🟢

Module Coverage
:pillarbox-core-business-cast 85.31% -3.27% 🟢
:pillarbox-cast 0% -17.14% 🟢
Files
Module File Coverage
:pillarbox-core-business-cast PillarboxSRG.kt 0% 🟢
:pillarbox-cast PillarboxCastPlayer.kt 0% -3.16% 🟢
DefaultCastTrackSelector.kt 0% 🟢
PillarboxCastPlayerBuilder.kt 0% 🟢

@StaehliJ StaehliJ marked this pull request as ready for review February 19, 2025 08:53
@StaehliJ StaehliJ force-pushed the 891-add-dsl-for-pillarboxcastplayer branch from fbfe0b3 to 77d4268 Compare February 21, 2025 08:47
@StaehliJ StaehliJ requested a review from MGaetan89 February 26, 2025 08:19
Comment on lines 79 to 80
context: Context? = null,
mediaItemConverter: MediaItemConverter = DefaultMediaItemConverter(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not remove all default values?

*
* @param Builder The type of [PillarboxCastPlayerBuilder] that this factory creates.
*/
interface CastPlayerConfig<Builder : PillarboxCastPlayerBuilder> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use PlayerConfig<PillarboxCastPlayerBuilder>?

@@ -15,8 +15,7 @@ The main goal of this module is to be able to connect to a SRG SSR receiver with
## Getting started

```kotlin
val castContext = context.getCastContext()
val player = PillarboxCastPlayer(castContext = castContext, mediaItemConverter = SRGMediaItemConverter())
val player = PillarboxCastPlayer(context) // ch.srgssr.pillarbox.core.business.cast.PillarboxCastPlayer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment necessary, since we are in pillarbox-core-business-cast?

Suggested change
val player = PillarboxCastPlayer(context) // ch.srgssr.pillarbox.core.business.cast.PillarboxCastPlayer
val player = PillarboxCastPlayer(context)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✏️ Draft
Development

Successfully merging this pull request may close these issues.

Add DSL for PillarboxCastPlayer
2 participants