Giter Site home page Giter Site logo

Comments (10)

pal-tcook avatar pal-tcook commented on June 12, 2024

FYI - I am setting up my bucket with strategy = Strategy.MULTI_PLAYER

And I notice this from the documentation:

"NOTE: Multiple playbacks comes with a caveat. In Video playback, audio focus is an important aspect. The client needs to not only respect the audio focus given by system, but also to respect the audio focuses among a Video with the others in the same Application. Therefore, when the client enable MULTI_PLAYER Strategy, the library will forcefully mute the audio of all available Playbacks, regardless the number of Playbacks selected by the Selector. Changing to SINGLE_PLAYER or NO_PLAYER Strategy will switch everything back to normal."

Does this imply that you can not have audio playing if using strategy MULTI_PLAYER? Because to me, this implies that by default all videos will be muted, but doesn't indicate that I can't override this default behaviour via calls to playback.manager.applyVolumeInfo(..)

from kohii.

pal-tcook avatar pal-tcook commented on June 12, 2024

Hmmm, can confirm, if I set the strategy to Strategy.SINGLE_PLAYER then my code works (i.e. audio toggles on/off via calls to playback.manager.applyVolumeInfo(..))

This is... unfortunate, as the requirement for our feature is that we should allow multiple videos to play at once, but only one of the videos should be able to have it's audio active at any given moment. I.e. if there are 2 videos on screen, both start muted. User unmutes video 1, video 1 audio starts playing. User unmutes video 2, video 1 audio stops (ideally "automagically" via this library) and video 2 audio starts.

Could you be open to implementing such functionality? Would you consider reviewing a PR if I was to figure out how to make this work and open one? (I'd like to know this before I actually attempt this).

from kohii.

eneim avatar eneim commented on June 12, 2024

@pal-tcook Regarding volume control, you can take a look here: https://github.com/eneim/kohii/tree/dev-v1/kohii-sample/src/main/java/kohii/v1/sample/ui/echo

This example demos how you can control the volume for each Playback individually, and store that info across config change.

To control the volume of the whole screen, you can take a look at Facebook example:

timelineVolume.observe(viewLifecycleOwner) {

I understand your concern about the lack document. I wish I have better time management to improve that.

--

Regarding the volume control in multiple player mode, you are correct that all the videos will be muted once you use the multiple player mode. I understand that you may want to have more Videos to play, and only one of them has Volume available. The challenge is to design a mechanism to support that from the library point of view. I can think about how it can be done (maybe adding some flags so that the client can switch to gain the control, but then it is your responsibility to manage the audio/audio focus effectively).

from kohii.

pal-tcook avatar pal-tcook commented on June 12, 2024

Hey @eneim - the lack of documentation (or rather, the lack of it being easily findable) on this specific feature is understandable given the complexity of the library and the fact it's a 1 man dev team, so don't take my comments as disparaging.

I will be running this "issue" past our product owner/designers to see if they can live with not having audio for videos on the parts of the app where we need MULTI_PLAYER functionality. It'd be a shame if this is a concrete requirement on our end, because it will mean we probably can not move forward with using this library (which then leaves us with the problem of "how to properly manage ExoPlayer instances for our videos which appear in a recycler view").

from kohii.

eneim avatar eneim commented on June 12, 2024

@pal-tcook I see. Let me see how I can handle this. But it might be in a beta build so please consider the trade-off. Although it is understandable if you go with another solution, but I will try to give the user more choices.

from kohii.

eneim avatar eneim commented on June 12, 2024

@pal-tcook Anyway, can you tell me ther version that you are using? It might be better to start investigating from there.

from kohii.

pal-tcook avatar pal-tcook commented on June 12, 2024

Hey @eneim - sorry for the slow reply!

I'm using version "1.2.0.2011008"

from kohii.

Nurtaz440 avatar Nurtaz440 commented on June 12, 2024

Hello, I want to mute my video with kohii how can do ? . Please help me to doing it. Without any buttons.

from kohii.

eneim avatar eneim commented on June 12, 2024

Sorry for the lack of document, and also a late reply.

You can use

Manager.applyVolumeInfo API to change the volume of the whole list or of a single Playback. You can check this example: Facebook timeline

from kohii.

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.