2-3次后,AVplayer未在ScrollView中显示 [英] AVplayer not showing in ScrollView after 2-3 times
问题描述
我在滚动视图中添加多个AVPlayer对象.第一次可以正常工作,但是当我返回以前的视图并再次返回时,我无法在scrollView中看到AVPlayer对象.
I am adding multiple AVPlayer objects in a scrollview. For the first time this is working fine but as i go back to my previous view and come back again i am not able to see AVPlayer objects in scrollView.
我需要作为多个AVPlayer的矩阵来显示视频的缩略图.
I need as matrix of multiple AVPlayer to show thumbnails of my videos.
请尽快帮助我
谢谢.
推荐答案
我遇到了类似的问题,经过大量搜索发现AVPLayerItem对象导致了此问题.
I had a similar problem and after a lot of searching discovered that the AVPLayerItem object causes this issue.
基本上,当AVPlayer项脱离屏幕显示时,您需要确保所有内容均已正确发布,然后在它们再次显示在屏幕上时重新创建所有内容.
Basically when the AVPlayer items go offscreen you need to make sure everything is released properly, and then recreate everything when they come back on screen.
在发布过程中,请添加以下行:
As part of the release process, include the line:
[AVPlayer replaceCurrentItemWithPlayerItem:nil];
那对我来说是一个非常相似的问题.
That sorted a very similar issue for me.
这篇关于2-3次后,AVplayer未在ScrollView中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!