MPVolumeView route button not showing consistently in IOS 11 update - ios

I created IOS app for live streaming with use of AVPlayer. I add the airplay routes button with help of MPVolumeView.
After update of IOS 11, airplay routes button not coming up properly on screen.
Sometime it show on screen sometimes not showing on screen
Anybody help me with it, is it IOS 11 issues or their some change need to MPVolumeView done in my code.
I am using AVPlayerViewController, in which i added MPVolumeView as subview.
self.airButton.frame = CGRect(x:0,y:0,width:45,height:45)
self.airButton.backgroundColor = UIColor.green
let volumeView = MPVolumeView(frame : self.airButton.frame )
volumeView.showsVolumeSlider = false
volumeView.showsRouteButton = true
volumeView.backgroundColor = UIColor.red
self.airButton.addSubview(volumeView)
self.airButton.translatesAutoresizingMaskIntoConstraints = false
self.controlView.addSubview(airButton)
Thanks

Related

FBSDKAppInviteDialog doesn't load list of friends

UIWebView page that was opened by showing FBSDKAppInviteDialog doesn't load list of friends as usual, but stops either at an empty page state or at the infinite loading indicator state.
let text = "invite text"
content.appLinkURL = URL(string: "valid_url_to_fb_me")!
content.promotionText = text
content.promotionCode = "\(code)"
let dialog = FBSDKAppInviteDialog()
dialog.fromViewController = self.viewController
dialog.content = content
dialog.delegate = self
dialog.show()
And FBSDKAppInviteDialogDelegate methods were not called.
This behaviour was not reproducible a week ago.
iOS Simulator 10.2, same behaviour on the iOS 10.2.1 on real device the iPhone 5S and iPad mini 9.2.
Facebook SDK - 4.15.1
Thanks in advance for any help or sugestions.
the bug is on Facebook's side:
https://developers.facebook.com/bugs/721787828000962/
The Facebook bug mentioned by BoygeniusDexter (https://developers.facebook.com/bugs/721787828000962/) is actually on Android not iOS.
Are you using the deprecated UIActionSheet to open FBSDKAppInviteDialog? If so removing UIActionSheet is your solution: https://developers.facebook.com/bugs/172327909915305/

AirPlay doesn't appear in iOS 10

SOLVED
With iOS 10.2 AirPlay button has reappeared and it still works. Apple poltergeist!
In iOS 9 I used this code to detect Airplay devices. With deployment target 10.00 it doesn't appear. In Control Center I can find my airplay devices, but in my app the uiview doesn't show anything.
In my capabilities I have checked under "background mode", Audio, AirPlay and picture in picture. Maybe I forget some new setting of this blessed sandbox?
Thanks for your patience
#property (weak, nonatomic) IBOutlet UIView *airplay;
MPVolumeView *myVolumeView = [[MPVolumeView alloc] initWithFrame: airplay.bounds];
[myVolumeView setShowsVolumeSlider:NO];
[myVolumeView setShowsRouteButton:YES];
myVolumeView.transform = CGAffineTransformMakeScale(0.3,0.3);
[myVolumeView setRouteButtonImage:[UIImage imageNamed:#"myIconAirPlay"] forState:UIControlStateNormal];
[airplay addSubview: myVolumeView];
From apple doc :
If there is an Apple TV or other AirPlay-enabled device in range, the route button allows the user to choose it. If there is only one audio output route available, the route button is not displayed.
https://developer.apple.com/reference/mediaplayer/mpvolumeview
Have you checked if var areWirelessRoutesAvailable: Bool { get } returns true or false on the MPVolumeView ?
I thinks it's the reason why your button is no longer appearing, It wouldn't be new if iOS10 update broke some Airplay devices until they have been updated too.

MPMoviePlayer view issue when coming out of full screen

I am using MPMoviePlayerController for showing video inside UIView and using the code below:
self.moviePlayerSmall = MPMoviePlayerController(contentURL:self.objUrl )
self.moviePlayerSmall.view.frame = self.videoView.bounds
self.videoView.addSubview(self.moviePlayerSmall.view)
self.moviePlayerSmall.view.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
for subV: UIView in self.moviePlayerSmall.view.subviews {
subV.backgroundColor = UIColor.whiteColor()
}
self.moviePlayerSmall.fullscreen = false
self.moviePlayerSmall.controlStyle = MPMovieControlStyle.Default
self.moviePlayerSmall.scalingMode = .AspectFill
Where videoview is the UIView in which I am adding the MPMoviePlayer view.
The issue I am facing is that whenever the video player comes out of full screen then the player view shows spacing on the left and right sides.
I have tried setting up contentmode, ScaleMode and even AutorezingMask but nothing is working. Have anyone experienced the same issue?

How to show Airplay button in MPMoviePlayerController iOS 8

I have an app in which I am playing a video using MPMoviePlayerController with custom controls. I'm adding a feature so that users can mirror the play back in Apple TV for this i have implemented the following code.
MPVolumeView *volumeButton = [[MPVolumeView alloc] initWithFrame:CGRectMake(80.0, 210.0, 160.0, 40.0)];
volumeButton.showsVolumeSlider = NO;
volumeButton.showsRouteButton = YES;
[self.view addSubview:volumeButton];
But Airplay button is not visible in iOS 8. Is there any way to show Airplay button in MPMoviePlayerController?
Please provide your suggestions and valuable inputs.

How to change ios volume in swift with help UISlider

I wrote the following code, but it doesn't change iOS System Volume, it only changes the sound from within the app.
audioPlayer is subclass of AVAudioPlayer
#IBAction func sliderVol(sender: UISlider) {
audioPlayer.volume = sender.value
}
The UISlider has the sent event of value changed
How can I change iOS system volume with help UISlider?
The MPVolumeView class is designed to let you do exactly this. It's in MediaPlayer framework. So, add that to your app to make things build correctly.
You create it and make it visible the way you instantiate any other subclass of UIView, which you probably know by now.
You can provide your own frame and use this to change the system volume.
var wrapperView = UIView(frame: CGRectMake(30, 200, 260, 20))
self.view.backgroundColor = UIColor.clearColor()
self.view.addSubview(wrapperView)
// 3
var volumeView = MPVolumeView(frame: wrapperView.bounds)
wrapperView.addSubview(volumeView)
For more help you can look here Controlling system volume using swift

Resources