Giter Site home page Giter Site logo

Comments (3)

OxygenCobalt avatar OxygenCobalt commented on June 12, 2024 1

I guess you are right about this. I'm already overriding ForwardingPlayer, so I'll just add more overrides that handle these cases. Will come back if I have more issues.

from media.

marcbaechinger avatar marcbaechinger commented on June 12, 2024

I think there are multiple APIs available that may be helpful for your case below the Callback API of the session.

In cases when the media structure of an app differs considerably to the media structure of what a standard ExoPlayer it can be useful to implement SimpleBasePlayer that is backed by an ExoPlayer instance. You would kind of wrap an ExoPlayer instance inside the SimpleBasePlayer instance. This way you get in between the session and the player and you can for instance handle the setMediaItems(List<MediaItem>) after it went through the onAddMediaItems/onSetMediaItems callback. In this case you would just not override these and received the params in SimpleBasePlayer. ForwardingPlayer is a similar approach, but for your complex case SimpleBasePlayer is probably a better choice. With both approaches ytou get in between the session and the actual player instance.

If you want to create your MediaSource in a complex way before it is added to the player as a consequence of for instance setMediaItems(List<MediaItem>) being called, you can inject your own MediaSource.Factory into the player when you build it with ExoPlayer.Builder..

from media.

OxygenCobalt avatar OxygenCobalt commented on June 12, 2024

Okay, this worked for me. Thanks.

from media.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.