I found this requiresFlushToResumeDecoding will become true after iPhone lock for a while, before PiP turns black screen. Then as the doc says, flush the bufferLayer will resume it.
So here is the solution for me:
if bufferLayer.requiresFlushToResumeDecoding {
bufferLayer.flush()
}
if bufferLayer.isReadyForMoreMediaData {
bufferLayer.enqueue(sampleBuffer)
}
Post
Replies
Boosts
Views
Activity
For anyone who encounter this issue and if you are using UICollectionViewCompositionalLayout. It seems you can't set both the collectionView's isPageEnabled = true and the UICollectionViewCompositionalLayout's orthogonalScrollingBehavior = .groupPaging.
I keep only orthogonalScrollingBehavior = .groupPaging (or .paging any scenario you want), and set collectionView's isPageEnabled = false. Then the scroll to item issue will be gone.