ZFPlayer
ZFPlayer copied to clipboard
抖音样式(Douyin style) 播放闪烁
3.3.1版本Demo, TableView 抖音样式, 滑动播放视频会 闪烁一下, 我有看到#567有人提问这个问题, 但是没有解决方案. 所有请问下如何才能解决这个问题, 或者是什么原因导致的? . 请望回复, 谢谢
是的,闪烁一下,怎么修复
不知道, 有个 ZFPlayerPresentView 颜色为黑色, 就会有个闪烁效果. 如果设置为透明, 就会导致背景图暴露出来.
同问, 闪烁一下, 怎么修复.
找到个方法临时解决下, 把 ZFPlayerControlView 对象 的属性 effectView 置为空视图
这个问题了两年了 还没有大佬有解决方案吗....
我也遇到这个问题了
同问
同问,抖音tableview 闪一下的问题@作者大大
这个问题我今天研究出来了,在ZFDouYinControlView.m里
作者是在这里判断coverimage显示隐藏的
/// 加载状态改变
-
(void)videoPlayer:(ZFPlayerController *)videoPlayer loadStateChanged:(ZFPlayerLoadState)state { // if (state == ZFPlayerLoadStatePrepare) { // self.coverImageView.hidden = NO; // } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) { // self.coverImageView.hidden = YES; // self.effectView.hidden = NO; // } if ((state == ZFPlayerLoadStateStalled || state == ZFPlayerLoadStatePrepare) && videoPlayer.currentPlayerManager.isPlaying) { [self.sliderView startAnimating]; } else { [self.sliderView stopAnimating]; } } 改到播放状态显示隐藏 //播放状态改变
-
(void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state{
if (state == ZFPlayerLoadStatePrepare) { self.coverImageView.hidden = NO; } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) { self.coverImageView.hidden = YES; self.effectView.hidden = NO; } }
这个问题我今天研究出来了,在ZFDouYinControlView.m里
作者是在这里判断coverimage显示隐藏的 /// 加载状态改变
- (void)videoPlayer:(ZFPlayerController *)videoPlayer loadStateChanged:(ZFPlayerLoadState)state { // if (state == ZFPlayerLoadStatePrepare) { // self.coverImageView.hidden = NO; // } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) { // self.coverImageView.hidden = YES; // self.effectView.hidden = NO; // } if ((state == ZFPlayerLoadStateStalled || state == ZFPlayerLoadStatePrepare) && videoPlayer.currentPlayerManager.isPlaying) { [self.sliderView startAnimating]; } else { [self.sliderView stopAnimating]; } } 改到播放状态显示隐藏 //播放状态改变
- (void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state{ if (state == ZFPlayerLoadStatePrepare) { self.coverImageView.hidden = NO; } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) { self.coverImageView.hidden = YES; self.effectView.hidden = NO; } }
这个解决方案有效。
@PZXforXcode @qzytcl (void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state{ if (state == ZFPlayerLoadStatePrepare) { self.coverImageView.hidden = NO; } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) { self.coverImageView.hidden = YES; self.effectView.hidden = NO; } } ZFPlayerPlaybackState不能和ZFPlayerLoadStatePrepare比较啊
@PZXforXcode @qzytcl (void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state{ if (state == ZFPlayerLoadStatePrepare) { self.coverImageView.hidden = NO; } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) { self.coverImageView.hidden = YES; self.effectView.hidden = NO; } } ZFPlayerPlaybackState不能和ZFPlayerLoadStatePrepare比较啊 按这样写完,又出现更严重的新Bug,背景图会暴露出来
@PZXforXcode @qzytcl (void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state{ if (state == ZFPlayerLoadStatePrepare) { self.coverImageView.hidden = NO; } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) { self.coverImageView.hidden = YES; self.effectView.hidden = NO; } } ZFPlayerPlaybackState不能和ZFPlayerLoadStatePrepare比较啊

谢谢 大兄弟
------------------ 原始邮件 ------------------ 发件人: "中文名字"<[email protected]>; 发送时间: 2020年7月20日(星期一) 中午11:23 收件人: "renzifeng/ZFPlayer"<[email protected]>; 抄送: "方子龙丶"<[email protected]>; "Comment"<[email protected]>; 主题: Re: [renzifeng/ZFPlayer] 抖音样式(Douyin style) 播放闪烁 (#970)
@PZXforXcode @qzytcl (void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state{ if (state == ZFPlayerLoadStatePrepare) { self.coverImageView.hidden = NO; } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) { self.coverImageView.hidden = YES; self.effectView.hidden = NO; } } ZFPlayerPlaybackState不能和ZFPlayerLoadStatePrepare比较啊
我感觉最主要的原因是这里 蒙版 和 背景图 隐藏的问题, 我只把这里的代码屏蔽了就能解决问题。 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
@PZXforXcode @qzytcl (void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state{ if (state == ZFPlayerLoadStatePrepare) { self.coverImageView.hidden = NO; } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) { self.coverImageView.hidden = YES; self.effectView.hidden = NO; } } ZFPlayerPlaybackState不能和ZFPlayerLoadStatePrepare比较啊
大哥找到好的解决方法了吗?
func videoPlayer(_ videoPlayer: ZFPlayerController, currentTime: TimeInterval, totalTime: TimeInterval) { coverImageView.isHidden = currentTime > 0 } 这样似乎可以
ZFAVPlayerManager -> initializePlayer() -> 加一句 presentView.backgroundColor = [UIColor clearColor]; 效果更佳
Version 4.0.3
我遇到的问题是封面图切换到视频之间会闪烁一下黑屏,目前找到的解决方法:
ZFAVPlayerManager *playerManager = [[ZFAVPlayerManager alloc] init];
playerManager.view.backgroundColor = [UIColor clearColor];
希望能帮助到各位大佬。