Facing an issue with audio playback using AVPlayerViewController in iOS application. We are using the native player to play recorded audio files. When the AVPlayerViewController appears, the native user interface is displayed correctly, including the playback controls and the volume slider.
However, when the user interacts with the volume slider The slider UI moves and responds to touch events.
The actual audio output volume does not change. The audio continues playing at the initial volume level regardless of the slider position.
We initialize the player and present it modally using the following code:
AVPlayerViewController *avController = [[AVPlayerViewController alloc] init]; avController.player = [AVPlayer playerWithURL:videoURL];
// Setting initial volume avController.player.volume = 1.0f;
avController.modalPresentationStyle = UIModalPresentationOverFullScreen; avController.allowsPictureInPicturePlayback = NO;
// Present the controller [self presentViewController:avController animated:YES completion:nil];