ksvc / KSYMediaPlayer_iOS

金山云iOS播放SDK(KSYUN Live Streaming player SDK),支持RTMP HTTP-FLV HLS 协议(supporting RTMP HTTP-FLV HLS protocol),直播延时2-3秒(Living delay 2 or 3 seconds)
http://v.ksyun.com/
Apache License 2.0
561 stars 143 forks source link

多次play stop 直播串流後,觸發failed to setup EAGLContext導致串流無法播放 #103

Open fsx2000 opened 6 years ago

fsx2000 commented 6 years ago

錯誤訊息為failed to setup EAGLContext

正常播放的log 2018-04-16 09:39:31.802460+0800 [1800:922812] OK setup GL 2018-04-16 09:39:31.806145+0800 [1800:922812] ------ Player Configuration ------ 2018-04-16 09:39:31.806192+0800 [1800:922812] sdk version = 2.9.0.1 2018-04-16 09:39:31.806203+0800 [1800:922812] shouldAutoplay = 1 2018-04-16 09:39:31.806212+0800 [1800:922812] shouldLoop = 0 2018-04-16 09:39:31.806220+0800 [1800:922812] shouldMute = 0 2018-04-16 09:39:31.806227+0800 [1800:922812] shouldHideVideo = 0 2018-04-16 09:39:31.806234+0800 [1800:922812] decodeMode = 2 2018-04-16 09:39:31.806257+0800 [1800:922812] bufferTimeMax = 2.000000 2018-04-16 09:39:31.806270+0800 [1800:922812] scalingMode = 3 2018-04-16 09:39:31.806278+0800 [1800:922812] prepareTimeout = 10 2018-04-16 09:39:31.806286+0800 [1800:922812] readTimeout = 30 2018-04-16 09:39:31.806293+0800 [1800:922812] ------ Player Configuration end ------

發生錯誤的log 2018-04-16 09:39:33.787736+0800 [1800:922812] failed to setup EAGLContext 2018-04-16 09:39:33.794615+0800 [1800:922812] ------ Player Configuration ------ 2018-04-16 09:39:33.794708+0800 [1800:922812] sdk version = 2.9.0.1 2018-04-16 09:39:33.794740+0800 [1800:922812] shouldAutoplay = 1 2018-04-16 09:39:33.794764+0800 [1800:922812] shouldLoop = 0 2018-04-16 09:39:33.794786+0800 [1800:922812] shouldMute = 1 2018-04-16 09:39:33.794807+0800 [1800:922812] shouldHideVideo = 0 2018-04-16 09:39:33.794829+0800 [1800:922812] decodeMode = 2 2018-04-16 09:39:33.794850+0800 [1800:922812] bufferTimeMax = 2.000000 2018-04-16 09:39:33.794875+0800 [1800:922812] scalingMode = 3 2018-04-16 09:39:33.794896+0800 [1800:922812] prepareTimeout = 10 2018-04-16 09:39:33.794915+0800 [1800:922812] readTimeout = 30 2018-04-16 09:39:33.794943+0800 [1800:922812] ------ Player Configuration end ------

一但觸發 failed to setup EAGLContext 怎麼播放都是白屏,請問該如何解決

fsx2000 commented 6 years ago

最後改用 reset 取代 stop 功能,app關閉才銷毀播放器避開這問題,failed to setup EAGLContext真的沒人碰到嗎?

mayudong1 commented 6 years ago

不清楚你之前的代码是怎么做的,stop后播放器会销毁,应该把播放器对象设置为nil,再次播放时需要重新初始化播放器,然后再播放 如果是正常使用过程中要切换播放的视频的话,比较推荐使用reset的方式来修改url然后播放的,这样少了一个播放器的重新申请和初始化的步骤

fsx2000 commented 6 years ago

stop后 我有確實的把播放器对象设置为nil 反覆呼叫個約70~80次之後會出現這問題,我後來改的方法就是你所提的到reset的方式