Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 1.22 KB

README.md

File metadata and controls

28 lines (18 loc) · 1.22 KB

This problem fixed above iOS16.4 :)

PiP Battery Drain

Sample project to reproduce PiP batery drain.

Detail

Problem that Picture-in-Picture incredibly use cpu resource on device above iOS16.1 is widely known.

I found PiP use huge cpu resource only when return specific value in a function related with AVPictureInPictureSampleBufferPlaybackDelegate.

func pictureInPictureControllerIsPlaybackPaused(_ pictureInPictureController: AVPictureInPictureController) -> Bool {
  // CPU usage become over 100% when return `false` here.
  return false
}

PiP will calm down if developers return true in above function, but developers control Play and Pause mark on video contents in PiP through that delegate method.

This is only the short term solution and there is tradeoff between user-control of contents and problem of battery.