mpvolumeview

How to change volume programmatically on iOS 11.4

我的未来我决定 提交于 2019-12-01 15:50:36
Before, I was setting sound volume programmatically using this approach: MPVolumeView *volumeView = [[MPVolumeView alloc] init]; UISlider *volumeViewSlider = nil; for (UIView *view in [volumeView subviews]) { if ([view.class.description isEqualToString:@"MPVolumeSlider"]) { volumeViewSlider = (UISlider *)view; break; } } [volumeViewSlider setValue:0.5 animated:YES]; [volumeViewSlider sendActionsForControlEvents:UIControlEventTouchUpInside]; Till iOS 11.4 it was working well (even on iOS 11.3), but on iOS 11.4 it doesn't. Volume value remains unchanged. Can someone help with this issue? Thanks.

How to change volume programmatically on iOS 11.4

孤者浪人 提交于 2019-12-01 14:50:33
问题 Before, I was setting sound volume programmatically using this approach: MPVolumeView *volumeView = [[MPVolumeView alloc] init]; UISlider *volumeViewSlider = nil; for (UIView *view in [volumeView subviews]) { if ([view.class.description isEqualToString:@"MPVolumeSlider"]) { volumeViewSlider = (UISlider *)view; break; } } [volumeViewSlider setValue:0.5 animated:YES]; [volumeViewSlider sendActionsForControlEvents:UIControlEventTouchUpInside]; Till iOS 11.4 it was working well (even on iOS 11.3)

How to do screen mirroring using AirPlay from the application (not from control panel) in iOS?

穿精又带淫゛_ 提交于 2019-11-30 16:41:10
问题 I am using MPVolumeView to show AirPlay button. I need to show a custom wallpaper to Apple TV through mirroring with audio. Audio is playing properly on Apple TV but wallpaper image is not showing. I am using AVAudioController for playing audio. I have checked YouTube application in which screen mirroring is working from application for video playing. Is it possible to screen mirroring within the app using AVAudioController ? Help me to solve this issue. Thanks in advance. 回答1: Unfortunately,

How do you implement an MPVolumeView?

丶灬走出姿态 提交于 2019-11-30 03:01:45
问题 I want the user to be able to change the system volume with a slider, and I realized the only way to do this is with an MPVolumeView. But I can't find any example code for it, and every method I try to implement won't show up. So what is the easiest and correct, working way of implementing a MPVolumeView? 回答1: Place it as a regular slider, then use the inspector to set the class to MPVolumeView . It'll still be shown as a regular slider in IB, but at runtime, it will be an instance of

Swift: how to set the iphone volume programmatically [duplicate]

徘徊边缘 提交于 2019-11-29 04:21:26
This question already has an answer here: How to change device Volume on iOS - not music volume 8 answers How to change an iOS device volume programmatically? 4 answers I am trying to create an alarm app and I have noticed that apps like Sleep Cycle will set your volume to max right before the alarm goes off, even if you had the volume at very low. I have tried using AVAudioPlayer and all I have seen with MPVolumeView is that the user must do it. Is there any way I can turn it up without the user having to do it? Thank you for your help. If I could please get the code in swift You just need to

AirPlay support, MPMoviePlayerController and MPVolumeView relation

大兔子大兔子 提交于 2019-11-28 20:42:54
I am developing an iPhone application that has support for video play. I am using MPMoviePlayerController with custom controls for playing the video. For this purpose I have set control style of MPMoviePlayerController to MPMovieControlStyleNone. I would like to support AirPlay feature for the video being played. As per the documentation, we have to set the 'allowsAirPlay' property of MPMoviePlayerController to YES to enable AirPlay feature. How can I display the AirPlay button on my player UI if I am using MPMoviePlayerController with custom controls? I have tried the following: Instantiated

MPVolumeView does not show route button on launch

我的梦境 提交于 2019-11-28 12:57:31
iOS 9.1 - iPhone 6S MPVolumeView's route button (airplay) is not showing when app launches even when there are wireless routes available. I have tried querying my MPVolumeView after it has been created to check for wireless routes and I get 0. I'm only able to get 1 (and have the route button appear) by disabling and enabling WiFi to trigger a notification. The MPVolumeView in my app is to control the volume of videos played from UIWebView. Also, whenever I activate a wireless route for streaming the MPVolumeView slider disappears - is there a way to prevent this behaviour when using UIWebView

Hide device Volume HUD view while adjusitng volume with MPVolumeView slider

大城市里の小女人 提交于 2019-11-27 14:03:41
I was implementing a video player with MPMoviePlayer in my iPad Application, used MPVolumeView for the volume control. My problem is that when i scroll the volume view to adjust the volume is showing the device's volume hud overlay as in the screenshot below. How can i disable this system volume indicator hud? My code is : @property (weak, nonatomic) IBOutlet MPVolumeView *playbackMPVolumeView; //Customizing controller - (void)customizeVolumeController { _playbackMPVolumeView.showsRouteButton = YES; _playbackMPVolumeView.showsVolumeSlider = YES; [_playbackMPVolumeView setVolumeThumbImage:

iOS 9: How to change volume programmatically without showing system sound bar popup?

[亡魂溺海] 提交于 2019-11-26 17:45:39
I have to change the volume on iPad and using this code: [[MPMusicPlayerController applicationMusicPlayer] setVolume:0]; But this changing volume and showing system volume bar on iPad. How to change the sound without showing the volume bar? I know, setVolume: is deprecated, and everybody says to use MPVolumeView . If this is the only way to solve my problem, then how to change the volume using MPVolumeView ? I don't see any method in MPVolumeView that changes the sound. Should I use some another class together with MPVolumeView ? But it's preferable to use MPMusicPlayerController . Thank you