I'm trying to load a video from S3 that may or may not be transcoding at the time. While it's still processing, I get a 403 response. Every other browser I test (Chrome/Firefox/IE) triggers the "error" event so I can display a message to the user like so:
var video = document.createElement('video');
video.onerror = function (e) {
// Show the user a message...
};
video.src = videoURL;
But Safari (on OSX) just logs to the console without triggering the event.
Failed to load resource: the server responded with a status of 403 (Forbidden)
It will trigger if I make the video.src a garbage URL that leads to nothing but it doesn't for a 403.
Is there some other event I can listen for or another way to warn the user? I know I could probably make a separate ajax request for the video and check the response but I'd like to avoid the overhead.