반응형

AVPlayer로 동영상 재생 중 간헐적으로 (특히 plus 기기에서) 동영상 소리만 들리고 화면은 나오지 않는 현상이 재현되었다.


이 현상을 수정하기 위해 기존 개발자가 개발한 코드에서 동영상 로딩 하는 부분을 50% 이상 뜯어 고쳐 아주 기본적인 로직으로만 동영상 재생이 되도록 수정하였으나 마찬가지로 동영상 화면이 간헐적으로 나오지 않는 현상은 고쳐지지 않았다.


그렇게 2주 가까이 다른 버그 수정과 기능 구현을 하는 틈틈히 구글링을 한 결과 다음과 같은 질답을 발견하였고, 답변에 있는데로 구현 후 현재까지 아주 잘 되고 있다.


2주 가까이 해결하지 못하고 있던것을 해결하니 기분이 참 좋다 ㅎㅎㅎ




출처: https://forums.developer.apple.com/thread/27589



Hello all.

 

I got the same problem with my implementation. After trying the solutions proposed here, I think I finally found the relable way to do things

 

The AVPlayerItemVideoOutput must be created AFTER the AVPlayerItem status is ready to play.

So

  1. Create player & player item, dispatch queue and display link
  2. Register observer for AVPlayerItem status key
  3. On status AVPlayerStatusReadyToPlay, create AVPlayerItemVideoOutput and start display link

 

Thanks to all for the inspiration

Renaud


+ Recent posts