소스 검색

静音播放 && 视频播放内容文本细节Fixed

Chris 5 년 전
부모
커밋
359952ec5a

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 53 - 38
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift


+ 8 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoPlayView.swift

@@ -58,6 +58,14 @@ class CommunityVideoPlayView: UIView {
         playerLayer = AVPlayerLayer.init(player: player)
         playerLayer.videoGravity = .resizeAspectFill
         self.layer.addSublayer(self.playerLayer)
+        
+        // 静音模式下音频仍有效
+        let avSession = AVAudioSession.sharedInstance()
+        try? avSession.setCategory(AVAudioSession.Category.playback)
+        do {
+            try avSession.setActive(true)
+        } catch {
+        }
     }
     
     override func layoutSubviews() {