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

PoC to deliver metadata with business errors #614

Open
2 tasks
defagos opened this issue Jun 27, 2024 · 2 comments
Open
2 tasks

PoC to deliver metadata with business errors #614

defagos opened this issue Jun 27, 2024 · 2 comments
Labels
question Further information is requested

Comments

@defagos
Copy link
Member

defagos commented Jun 27, 2024

As an SRF app developer I would like to be able to display player metadata for streams that have not started yet. As a Pillarbox Android developer I would like to investigate whether this is possible so that we can have a team discussion about such a feature (readily available for the web and feasible for Apple).

Acceptance criteria

  • A PoC implementation which delivers metadata in case of an error is available on Android platforms.
  • A thumbnail is displayed for URN-based content not yet available.

Hints

See SRGSSR/pillarbox-documentation#80 for more information.

Tasks

  • Implement PoC.
  • Once implemented discuss the matter again with the team.
@defagos defagos added the question Further information is requested label Jun 27, 2024
@StaehliJ
Copy link
Contributor

StaehliJ commented Jul 8, 2024

Current behavior (from version 2.2.1)

  • When an error occurs during fetching the MediaComposition the metadata are lost because we throw an error directly.
  • The only "Metadata" the integrator will have is the error and the input MediaMetadata set to the player before loading the MediaComposition.

So for now, if integrator want to display an image or metadata and they have already that kind of information when passing the urn to the player, they should set them up with the urn.

val mediaItem = SRGMediaItemBuilder(urn = "urn:rts:video:13382911")
    .setMediaMetadata(MediaMetadata.Builder()
        .setTitle("Title of the media")
        .setDescription("Description of the media")
        .setArtworkUri(Uri.parse("https://image.png"))
        .build())
    .build()
player.setMediaItem(mediaItem)
```

@StaehliJ
Copy link
Contributor

StaehliJ commented Jul 8, 2024

Forward date for StartDate and EndDate block reason

A potential solution is to add a date to a BlockReasonException that is send to the ExoPlayerException.

@Serializable
sealed interface Reason {

    @Serializable
    data class StartDate(val date: String) : Reason

    @Serializable
    data class EndDate(val date: String) : Reason

    @Serializable
    data class Other(val blockReason: BlockReason) : Reason

    @Serializable
    data object Unknown : Reason
}

class BlockedReasonException2(val reason: Reason) : IOException(Json.encodeToString(Reason.serializer(), reason)) {
    
}

The issue here is that the exception message will be a ugly json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants