Giter Site home page Giter Site logo

Comments (7)

Tolriq avatar Tolriq commented on June 12, 2024 1

Glad I subscribed to this thread and discovered the createMessage API too.

https://developer.android.com/media/media3/exoplayer/listening-to-player-events

@tonihei is there a way to keep a reference to the message to change it's setDeleteAfterDelivery value after sending it?

Usage is the same as OP, I have users who want to be able to repeat A-B section of media, but should also be easily able to remove the repeat at any moment, would be nice to be able to embrace setDeleteAfterDelivery and not manually resend a message when they are on repeat mode all.

from media.

Tolriq avatar Tolriq commented on June 12, 2024 1

This is an old user request, but I think as OP the notification and everything should still show the full media value.

Just when then user select repeat mode A-B he can move 2 bars in the player to select the points.

Anyway yes I can resend the message as needed, thanks, wonder how I missed that API.

from media.

tonihei avatar tonihei commented on June 12, 2024

ClippingConfiguration also works, but it also alters the duration and timebase of the clipped audio such that it starts at 00:00, and has a duration equal to the clipped segment. This isn't desirable when the clipping is done through a UI based on user selection.

Is this a problem because you are using Media3's default PlayerView and can't achieve the desired UI? I assume when you are writing your own UI, you can design it in any way you'd like.

Polling mediaPosition can work but is error-prone and leads to verbose code

I wouldn't recommend it for looping, but if you'd like to trigger something at a certain playback position, you can use timed messages:

exoPlayer.createMessage(yourHandler)
    .setLooper(player.getApplicationLooper()) // needed if you want to do something with your player here
    .setPosition(targetPositionMs)
    .send()

from media.

Digipom avatar Digipom commented on June 12, 2024

@tonihei We're using our own UI, but adding a clip configuration also modifies duration and seeking behavior. Even if we somehow fake that in our own UI, the notification would still behave in this way.

Interesting about the message -- wasn't aware of this API. For now we actually did handle this via polling but will check that out. Thanks!

from media.

tonihei avatar tonihei commented on June 12, 2024

but adding a clip configuration also modifies duration and seeking behavior. Even if we somehow fake that in our own UI,

Yes, you would need to adjust the duration/position yourself in this case.

the notification would still behave in this way

This is interesting, because you can't easily control that even if you wanted to. I can mark it as a feature request to allow this conversion to use the full duration without the clipping. We probably treat it as low priority for now though as you can workaround it yourself it seems. We also need additional metadata about the full item duration which we don't have at the moment.

from media.

Digipom avatar Digipom commented on June 12, 2024

@tonihei Definitely, it could be configurable as there are at least two use cases here -- either clipping to a segment and making that the new media, or looping between A and B without clipping.

I think for our use case, the message handler might actually work well since we don't need looping to exact frame positions (I can see how that might be useful for others though). Depends on how much latency there is vs polling -- will have to test!

from media.

tonihei avatar tonihei commented on June 12, 2024

@Tolriq: Do you also care about how this clipping is displayed in media notifications? If not, I suspect you are looking for a feature to change the clipping positions at run time (tracked by google/ExoPlayer#3163 still).

To your actual question: the message properties can't be changed after sending it as this is a bit unpredictable. I think you could solve this yourself though by just resending a message when receiving the last one if needed (and always using the default deleterAfterDelivery==false.

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.