     
     let channel: FlutterMethodChannel
     let registrar: FlutterPluginRegistrar
-    var didSendDuration = false
     var player: AVPlayer?
     
     var observerStatus: NSKeyValueObservation?

    }
    
    func open(assetPath: String, audioType: String, autoStart: Bool, volume: Double, seek: Int?, result: FlutterResult){
        didSendDuration = false
    
        guard let url = self.getUrlByType(path: assetPath, audioType: audioType) else {
             log("resource not found \(assetPath)")
             result("");

            
            NotificationCenter.default.addObserver(self, selector: #selector(self.playerDidFinishPlaying(note:)), name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: item)
            
            observerStatus?.invalidate()
            observerStatus = item.observe(\.status, changeHandler: { [weak self] (item, value) in
                 switch item.status {
                 case .unknown:
                     debugPrint("status: unknown")
                 case .readyToPlay:
                     debugPrint("status: ready to play")

                     
                     let audioDurationSeconds = CMTimeGetSeconds(item.duration) //CMTimeGetSeconds(asset.duration)
                     self?.channel.invokeMethod(Music.METHOD_CURRENT, arguments: ["totalDuration": audioDurationSeconds])
                     

                     if(autoStart == true){
                        self?.play()
                     }
