Set MPVolumeView slider thumb position as device volume
Assign your slider's value
to to AVAudioSession.sharedInstance().outputVolume
on init
or in viewDidLoad
of your view controller. Remember to import AVFoundation
to use AVAudioSession
.
Alternatively, you can programmatically initialize your MPVolumeView
instead of having it as an outlet. I believe that is the source of your issue.
How to keep the slider of MPVolumeView visible when connecting to Apple TV?
The solution was to set allowsExternalPlayback
to NO on the AVPlayer:
self.player = [AVPlayer playerWithURL:self.streamUrl];
self.player.allowsExternalPlayback = NO;
Related Topics
Alert View Is Showing White Rectangle in iOS7
Return Value from Completion Handler - Swift
Playing Back Audio Using Avaudioplayer iOS 7
How to Make an iOS Asset Bundle
Coremotion Updates in Background State
Steps to Create and Edit a Plist File in Xcode
Change Push Notification Sound
Nsinternalinconsistencyexception, Reason: Could Not Load Nib in Bundle
Various Itms Errors When Trying to Submit Archive to App Store
How to Observe Changes in Userdefaults
Why Is This Code Not Recognising the Nsstring as Being Equal
Creating Thumbnail from Local Video in Swift
Why Is My iOS App Not Showing Up in Other Apps' "Open In" Dialog
Difference Between Static Function and Singleton Class in Swift
Push Notifications Not Being Received on iOS 10, But Working on iOS 9 and Before