Check to see if a video loads in iPad with JavaScript
===

I am having a bit of an issue with checking to see if a video is being loaded in iPad. I need to check and see if loads because I am looping through to load all videos with an increment like video_1.mp4, video_2.mp4, video_3.mp4. However, it seems like it ignores the "readyState" and goes straight to the else statement.

Here is the code:

    function loadMedia() {
    var media = document.getElementsByTagName("video")[0];
    
    if (media.readyState === 4) {
        alert("Video has been loaded!");
    } else {
        alert("Video hasn't been loaded!")
    }
    }

Is readyState supported by iPad?