The implementation by markussvensson has some false alarms, since any UIWindowDidBecomeVisibleNotification is considered as a full screen video playback which is not true.
The implementation "AVPlayerItemBecameCurrentNotification" by Selvin can catch movie playback start, but cannot catch movie playback stop.
So I combined both implementations and it works as expected.
Add observer to both AVPlayerItemBecameCurrentNotification & UIWindowDidBecomeHiddenNotification;
When AVPlayerItemBecameCurrentNotification happens, set a flag;
When UIWindowDidBecomeHiddenNotification happens, check the flag to see if it is a "video stop playing event".
BTW, AVPlayerItemBecameCurrentNotification is undocumented and might be broken for the next iOS major release.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…