|
@@ -126,7 +126,11 @@ public class PQSingletoVideoPlayer: NSObject {
|
|
|
}
|
|
|
playId = getUniqueId(desc: "playId")
|
|
|
// 开始播放
|
|
|
- startPlayr()
|
|
|
+ if let vc = bf_getCurrentViewController(), let playview = self.playControllerView{
|
|
|
+ if playview.isDescendant(of: vc.view){
|
|
|
+ startPlayr()
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -222,9 +226,12 @@ public class PQSingletoVideoPlayer: NSObject {
|
|
|
NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: nil) { _ in
|
|
|
|
|
|
if self.autoResumePlayWhenEnterForeground, self.shouldResumePlayWhenEnterForeground {
|
|
|
- self.shouldResumePlayWhenEnterForeground = false
|
|
|
-
|
|
|
- self.resumePlayer()
|
|
|
+ if let vc = bf_getCurrentViewController(), let playview = self.playControllerView{
|
|
|
+ if playview.isDescendant(of: vc.view){
|
|
|
+ self.shouldResumePlayWhenEnterForeground = false
|
|
|
+ self.resumePlayer()
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|