Yes, I had thought that first. But these code doesn't handle the case of restoreTime is undefined of null. With the current code, we don't load any video when the restoreTime is undefined or url, and 0, of course. If we change the code to restoreTime === undefined or restoreTime === null, there is still an extreme case that user presses a video and presses home immediate. At that case, the video may not loaded, so the restoreTime is null. When user opens the video app again, the video is not loaded. So, I move the checking code inside of callback of setVideoUrl. That makes the video app loads the video and makes sure everything is playable. After that, we are trying to restore playing time. If that failed, we fallback to last playing time from metadata.