             context: &myContext
         )
         self.avPlayerItem!.addObserver(self,
-                                       forKeyPath: KPlaybackBufferEmptyKey,
+                                       forKeyPath: kPlaybackBufferEmptyKey,
                                        options: NSKeyValueObservingOptions.New,
                                        context: &myContext)
         self.avPlayerItem!.addObserver(self,

        self.avPlayerItem?.removeObserver(self, forKeyPath: kStatusKey)
        self.avPlayerItem?.removeObserver(self, forKeyPath: kLoadedTimeRangesKey)
        self.avPlayerItem?.removeObserver(self, forKeyPath: kPlaybackLikelyToKeepUp)
        self.avPlayerItem?.removeObserver(self, forKeyPath: KPlaybackBufferEmptyKey)
        self.avPlayerItem = nil
        self.mediaResourceLoader?.session.invalidateAndCancel()
    }

var myContext  = 0
let kStatusKey              = "status"
let kLoadedTimeRangesKey    = "loadedTimeRanges"
let kPlaybackBufferEmptyKey = "playbackBufferEmpty"
let kPlaybackLikelyToKeepUp = "playbackLikelyToKeepUp"

class MediaItem: NSObject {
