         return result
     }
 }
+
+// MARK: - SystemVolumeMonitor
+
+public extension NSNotification.Name {
+    static let SystemVolumeMonitor: NSNotification.Name = NSNotification.Name("com.cyberdev.SystemVolumeMonitor")
+}
+
+//KVO appears to be only way to do this, so here we are.
+public class SystemVolumeMonitor: NSObject {
+    public class func sharedInstance() -> SystemVolumeMonitor {
+        return _sharedInstance
+    }
+
+    private static let _sharedInstance = {
+        SystemVolumeMonitor()
+    }()
+
+    private struct Observation {
+        static let VolumeKey = "outputVolume"
+        static var Context = 0
+    }
+
+    public override init() {
+        super.init()
+        
+        AVAudioSession.sharedInstance().addObserver(self,
+                                                    forKeyPath: Observation.VolumeKey,
+                                                    options: [.initial, .new],
+                                                    context: &Observation.Context)
+    }
+    
+    deinit {
+        AVAudioSession.sharedInstance().removeObserver(self,
+                                                       forKeyPath: Observation.VolumeKey,
+                                                       context: &Observation.Context)
+    }
+    
+    public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
+        if context == &Observation.Context {
+            if keyPath == Observation.VolumeKey,
+               let volume = (change?[NSKeyValueChangeKey.newKey] as? NSNumber)?.floatValue {
+                NotificationCenter.default.post(name: .SystemVolumeMonitor, userInfo: ["volume":volume])
+            }
+        } else {
+            super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
+        }
+    }
+}

            }
        }
        
        player.beginGeneratingPlaybackNotifications()
    }


    }
}

extension MPMusicPlayerController {
    class var cleanApplicationMusicPlayer: MPMusicPlayerController {
        let result = applicationMusicPlayer
