     /// 播发器的几种状态
     fileprivate var state = BMPlayerState.notSetURL {
         didSet {
-            delegate?.bmPlayer(player: self, playerStateDidChange: state)
+            if state != oldValue {
+                delegate?.bmPlayer(player: self, playerStateDidChange: state)
+            }
         }
     }
     /// 是否为全屏

        }
        
        if keyPath == "rate" {
            if let player = player {
                if player.rate == 0.0 {
                    if player.error != nil {
                        self.state = .error
                        return
                    }
                    if let currentItem = player.currentItem {
                        if player.currentTime() >= currentItem.duration {
                            if self.state != .playedToTheEnd {
                            self.state = .playedToTheEnd    
                            }
                            
                            return
                        }
                        if currentItem.isPlaybackLikelyToKeepUp || currentItem.isPlaybackBufferFull {
                            delegate?.bmPlayer(player: self, playerIsPlaying: false)
                        }
                        
                    }
                } else {
                    delegate?.bmPlayer(player: self, playerIsPlaying: true)
                }
            }
        }
    }
    

                            self.playDidEnd = true
                        }
                    }
                default:
                    break
                }
