yoheimuta / RxMusicPlayer

A reactive library to make it easy for audio playbacks using RxSwift.
MIT License
58 stars 8 forks source link

"Boost volume" functionality #37

Closed rastaman111 closed 2 years ago

rastaman111 commented 2 years ago

Hey! Please add the "Boost volume" functionality, here is an example of how it should work

var boostVolume: Bool = false { didSet { self.audioPlayer.volume = self.boostVolume ? 2 : 1 } }

yoheimuta commented 2 years ago

@rastaman111 Can you write a single subject on a single issue? "Boost volume" functionality is your main subject on this issue, right? Or, these three are related deeply?

self.audioPlayer.volume = self.boostVolume

The RxMusicPlayer has the public property of its AVPlayer. Isn't it enough to refer to yourRxMusicPlayer.player.volume by yourself to implement this feature?

By the way, I'm curious about volume = 2 because https://developer.apple.com/documentation/avfoundation/avplayer/1390127-volume doesn't mention it.

rastaman111 commented 2 years ago

This solution is not available in the Apple documentation, since this is a custom solution. The correct solution, in my opinion, looks like this: press the switch, save it in UserDefault and check in the volume of the player, if it is on, then the volume will be equal (example: 1.5), if off it will be equal to 0.5

rastaman111 commented 2 years ago

@yoheimuta Hey! How soon will you complete this task?

yoheimuta commented 2 years ago

Isn't it enough to refer to yourRxMusicPlayer.player.volume by yourself to implement this feature?

I suggested a solution here.