I am new to tvOS/iOS development. I am using swift. I am trying to develop a tvOS app. It plays 3 videos in a loop (which is basically 3 versions of same video at different speeds). It has a background music which can be turned on or off.
I have a pending functionality to implement- which is volume control for the background music. So I am not sure if we can use a Volume Slider in tvOS. But before that is it possible to increase and decrease the volume of the background music within the app alone? I mean, is there any way to not affect the main TV volume and still control the volume of the music alone inside the app?
I saw this apple documentation, but I am not sure how to use that. https://developer.apple.com/reference/avfoundation/avplayer/1390127-volume
I also looked at this thread: iPhone: Implement Volume control using buttons
Can this be used for tvOS too?
Can someone help me with this?
So, the solution was quite simple. I used var volume for performing this. Used two buttons. I gave an initial value and then wrote the logic inside an if block for changing the volumes on the respective button clicks (add volume by 0.1 and subtract volume by 0.1) :)