Привет. Я пытаюсь воспроизвести видео в ячейках представления коллекции, используя: Ссылка
Когда я запускаю приложение, видео воспроизводится успешно.
После повторного завершения видео мы снова нажимаем на кнопку «Пуск», он вылетает и показывает следующие ошибки.
WF: _WebFilterIsActive returning: NO
ВНИМАНИЕ: контекст AVF недоступен для + [MRAVOutputContext
sharedAudioPresentationContext] _block_invoke
Я пишу следующий код.
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
if collectionView == self.video_collectionview
{
// For videoCollectionView
let videocell = collectionView.dequeueReusableCell(withReuseIdentifier: "VideoCollectionViewCell", for: indexPath)as! VideoCollectionViewCell
videocell.videotitle.text = videotitle[indexPath.row]
videocell.videotime.text = videotime[indexPath.row]
let myVideoURL = videourls[indexPath.row]
videocell.videoview.loadVideoURL(myVideoURL as URL)
// videocell.videoview.layer.cornerRadius = 15
return videocell
}
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if collectionView == video_collectionview
{
let videocell = collectionView.dequeueReusableCell(withReuseIdentifier: "VideoCollectionViewCell", for: indexPath)as! VideoCollectionViewCell
let myVideoURL = videourls[indexPath.row]
videocell.videoview.loadVideoURL(myVideoURL as URL)
}
}