|
@@ -122,7 +122,7 @@ class TSBandRingTool:NSObject {
|
|
|
|
|
|
func shareRing(fileUrl: URL) {
|
|
|
DispatchQueue.main.async {
|
|
|
-// self.showTutorialVideo()
|
|
|
+ self.showTutorialVideo()
|
|
|
|
|
|
let vc = UIActivityViewController(activityItems: [fileUrl], applicationActivities: nil)
|
|
|
// 排除不需要的活动类型
|
|
@@ -144,10 +144,17 @@ class TSBandRingTool:NSObject {
|
|
|
// .openInIBooks
|
|
|
// ]
|
|
|
self.targetVC?.present(vc, animated: true, completion: {
|
|
|
- self.showTutorialVideo()
|
|
|
self.tryStartPictureInPicture()
|
|
|
})
|
|
|
|
|
|
+ // 延迟检查是否真正弹出
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
|
|
+ if self.targetVC?.presentedViewController != vc {
|
|
|
+ dePrint("⚠️ present 失败:系统未正确响应")
|
|
|
+ // 这里可以触发回调或通知
|
|
|
+ self.playContentView.removeFromSuperview()
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -189,7 +196,7 @@ extension TSBandRingTool : AVPlayerViewControllerDelegate, AVPictureInPictureCon
|
|
|
tutorialPlayer?.replaceCurrentItem(with: playerItem)
|
|
|
}
|
|
|
tutorialPlayer?.allowsExternalPlayback = true
|
|
|
-// playContentView.backgroundColor = .red
|
|
|
+// playContentView.backgroundColor = .black.withAlphaComponent(0.1)
|
|
|
targetVC?.view.addSubview(playContentView)
|
|
|
|
|
|
let layer = AVPlayerLayer(player: tutorialPlayer)
|