Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cell复用时视频封面图显示错乱 #3

Open
BackWorld opened this issue Jul 7, 2016 · 0 comments
Open

cell复用时视频封面图显示错乱 #3

BackWorld opened this issue Jul 7, 2016 · 0 comments

Comments

@BackWorld
Copy link

BackWorld commented Jul 7, 2016

解决:

var moviePath : String?{
        didSet{
            if let iPath = moviePath {
                moviePlayer.contentURL = NSURL(fileURLWithPath: iPath, isDirectory: false)
                moviePlayer.prepareToPlay()
                // 移除上次复用的cell的image,防止显示错乱
                imageView.removeFromSuperview()
                // 再重新add上更换完图片的当前cell对应的image
                moviePlayer.view.addSubview(imageView)
            }
        }
    }

func playerDisplayChange()
    {
        // 准备播放时[预览图加载出来时] 移除封面image
        if moviePlayer.readyForDisplay {
            imageView.removeFromSuperview()
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant