How to solve the AVPlayerItem fails

I have a video feeds app like the TikTok app. we have downloaded video from remote URL and converted NSData then stored within the filesystem. All works fine but the player item is failed after three times refreshed app. if anyone has a clue, please let me know. Thank you!!.