CoreMediaErrorDomain Error -12312

I have been seeing a weird error as shown below in the screenshot. The weirder thing is that the video I was trying to stream plays fine most of the time but only failed a few times due to this error. And from the error message I still couldn't figure out what went wrong with the stream. In the app I am simply using AVPlayer to stream HLS and nothing fancy. Any AVFundation or HLS experts here could shed some lights on this? Much appreciated!


Edit: Not sure why attached image is not showing. The error message says:

"The operation couldn't be completed. (CoreMediaErrorDomain error -12312 - Media Entry URL not match previous playlist for MEDIA-SEQUENCE 0:http://the-stream-segment1.ts vs http://the-stream-segment2.ts)


The same issue happened to me, but I did not find the reason. The approach used to fix it was, get the current video url and reloading the player with it: (playerViewController.player?.currentItem?.asset as? AVURLAsset)?.url

CoreMediaErrorDomain Error -12312
 
 
Q