LiteAVSDK / Player_iOS

Super player for iOS...
https://trtc.io/
1.11k stars 225 forks source link

setupVideoWidget 执行多次,可能引起bug #313

Closed GitNiko closed 1 year ago

GitNiko commented 1 year ago

初始化setupVideoWidget后,在开始播放的时候再执行setupVideoWidget会无效,导致无法渲然,只能听到声音。layoutSubviews时候找不到对应的innerView。并且这里逻辑比较奇怪,setupVideoWidget看起来不像是幂等方法,调用多次后是不是不合理。 我注释掉第一次的setupVideoWidget后可以正常渲染。 企业微信截图_566c574d-d76c-478e-bd79-621c5c37d808

image 企业微信截图_874a5d17-2b03-475e-8898-19dfe8a30fd5

tgitpushping commented 1 year ago

这个方法其实是只需要调用一次,确保view设置是在最顶部即可。可以根据业务来进行调整和设置,无需多次设置

GitNiko commented 1 year ago

@tgitpushping 我说的源代码是在腾讯Superplayer内的 https://github.com/LiteAVSDK/Player_iOS/blob/master/Demo/TXLiteAVDemo/SuperPlayerKit/SuperPlayer/SuperPlayerView.m#L680 , 我只有改这个才能避免问题,是要我提个PR给你们吗