iOS media playback controls notification
From a comment:
i don't have a real device, i am using the IPhone 11 pro max simulator
That’s the problem. You cannot test this feature except on a device. The simulator is not a reliable guide for many iOS features / behaviors, and this is one of them. Without a device, you have no evidence of whether your code works as desired.
Custom audio player controls on notification ios
It is simple, and no third party library required for it
import MediaPleyer
And add observer on remote control Like
MPRemoteCommandCenter.shared().pauseCommand.addTarget(self, action: #selector(self.onPauseRemoteCommand(_:)))
MPRemoteCommandCenter.shared().playCommand.addTarget(self, action: #selector(self.onPlayRemoteCommand(_:)))
Audio playback lock screen controls not displaying on iPhone
The issue turned out to be this line...
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, with: AVAudioSessionCategoryOptions.duckOthers)
Once I changed it to
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, with: [])
everything worked fine. So it seems that passing in any argument for AVAudioSessionCategoryPlaybackOptions causes the lock screen controls to not display. I also tried passing in .mixWithOthers
an that too caused the lock screen controls to not be displayed
Is there any way to hide the video controls from Notification Center on iOS 11.0?
WebView core functions are handled by the OS, so i think its not possible but you should implement the video/audio handling natively using these classes:
MPNowPlayingInfoCenter (currenlty playing items)
MPRemoteCommandCenter (observe different events, play/pause/next.. )
Related Topics
App Crashes When User Starts Typing in Uisearchbar
Present Specific View Controller in Didreceiveremotenotification with Swift
Firebase Dynamic Link Doesnt Work in Safari Swift
Xcode 12.5 Missing Entitlement Com.Apple.Developer.Associated-Appclip-App-Identifiers
Giving Properties of a Uibutton to a Skspritenode in Spritekit
Timer Label Not Updated After Switching Views (Swift)
How to Create a Ntlm Authentication Header to Use with Alamofire
Swift 2 Unused Constant Warning
Incorrect Position of Cashapelayer
Swiftui - Navigationview Title and Back Button Clipped Under Status Bar After Orientation Change
How to Update a Swiftui View That Was Embedded into Uikit
Objective-C Call Swift Function
Nsubiquityidentitydidchangenotification and Sigkill
Skvideonode Only on a Small Part of Scnsphere
Hls Metadata Id3 Tag Not Working
Why Sending Message from Watchkit Extension to iOS and Getting Back a Reply Is So Slow