androidx / androidx/media

Issues setting configuration live playback parameters through setLiveConfiguration on MediaItem

Open
#819 8 comments 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Nov 17, 2023.

question
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Hey there,
I'm having issues configuring live playback parameteres for a live stream. I've scanned through this issue tracker and the exoPlayer so I really hope this hasn't been mentioned before.
I've been trying to reduce the offsets for live content in particular in our app. I've previously messed around with setting customloadControl but this introduced complexity when working with the variety of content types the app needs to support.
So then came across setLiveConfiguration which I beleive could be the correct approach to reducing the size of the live window.
Been following this doco here:
https://developer.android.com/guide/topics/media/exoplayer/live-streaming#configuring-live-playback-parameters

I've tried doing this at both the global level and per MediaItem. For the purpose of this post I'll focus on mediaitem as that seems to take highest priority of all places to set these parameters.

As an example, given the following code:

MediaItem.Builder()
        .setUri(/*cannot provide uri*/)
        .setLiveConfiguration(MediaItem.LiveConfiguration.Builder()
                .setTargetOffsetMs(500L)
                .setMinOffsetMs(100L)
                .setMaxOffsetMs(2000L)
                .setMinPlaybackSpeed(0.9f)
                .setMaxPlaybackSpeed(1.1f)
                .build()
        )
        .build()

The stream type itself is AAC.

I can see through having breakpoints in MediaItem.java setMinOffsetMs and setMaxOffsetMs builder functions, that these values are initially set correctly.
Hower just before playback begins, both setMinOffsetMs and setMaxOffsetMs are called again, and their respective values are set back to their default values (C.TIME_UNSET).

I can't pinpoint where this is being done from, I suspect theres some underlying logic deep in the player somewhere I'm not aware of thats calling the liveconfiguration builder again?
What else could be overriding these values, and for what reason would this happen? Triggered by particular metadata perhaps?
Also seems min and max playbackspeeds and targetoffset remain set correctly so this seems to only be effecting min and max offsets

See watch on MediaItems LiveConfiguration after initial setting
image

And a short time after this, but just before playback:
image

Any tips or resources to point me in the right direction are appreciated! I can't find much doco on this so I'm not even sure if my parameters are valid. Apologies for not being able to share URI for testing, let me know if you need more info.
And thankyou for your time in advance

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.