Высота представления коллекции изменяется при воспроизведении полноэкранного режима в AVPlayerview Controller - PullRequest
0 голосов
/ 14 мая 2019

У меня есть два сегмента UIButtons скажем UIButton 1 и UIButton 2. В 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
    }
...