Browse Source

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

Chris 5 years ago
parent
commit
359952ec5a

File diff suppressed because it is too large
+ 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 = AVPlayerLayer.init(player: player)
         playerLayer.videoGravity = .resizeAspectFill
         playerLayer.videoGravity = .resizeAspectFill
         self.layer.addSublayer(self.playerLayer)
         self.layer.addSublayer(self.playerLayer)
+        
+        // 静音模式下音频仍有效
+        let avSession = AVAudioSession.sharedInstance()
+        try? avSession.setCategory(AVAudioSession.Category.playback)
+        do {
+            try avSession.setActive(true)
+        } catch {
+        }
     }
     }
     
     
     override func layoutSubviews() {
     override func layoutSubviews() {