在AVPlayerview Controller中播放全屏选项时,收藏夹视图的高度会发生变化

时间:2019-05-14 05:18:27

标签: ios swift avplayer avplayerviewcontroller avplayeritem

我放置了两个分段UIButtons,分别说UIButton 1和UIButton2。在UIButton 1中,它显示UICollectionView,没有视频视图。在UIButton 2中,我正在其中显示视频视图。我无法全屏播放视频。

(从全屏选项退出时,我的UICollectionView Y值已更改)

    if self.titleLabel.text == "RECIPES" {
        self.alertView.isHidden = true         
        let layout = orderCollection.collectionViewLayout as? UICollectionViewFlowLayout
        let recipeCell = collectionView.dequeueReusableCell(withReuseIdentifier: "recipeVideoCell", for: indexPath) as! recipeVideoCell
        if videoView.isHidden == true {
            self.recipeSegment.isHidden = false
            self.orderCollection.frame.origin.y = 180.0
            recipeCell.recipeBook.kf.setImage(array[indexPath.row].media_thumb!))
            recipeCell.bookName.text    = videoBookArray[indexPath.row].title     
        } else {
            self.recipeSegment.isHidden = false
            self.orderCollection.frame.origin.y = 390.0
            let url = URL(string: VIDEOURL HERE)
            let player = AVPlayer(url:url!)
            let av = AVPlayerViewController()
            av.player = player
            av.view.frame = self.videoView.bounds
            self.videoView.addSubview(av.view)
            player.play()
            }

        return recipeCell    
        }

    return cellB
    }

0 个答案:

没有答案