function checkFailed() {
        var _this3 = this;

        // https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/networkState
        this.failed = this.media.networkState === 3;

        if (this.failed) {
            utils.toggleClass(this.elements.container, this.config.classNames.loading, false);
            utils.toggleClass(this.elements.container, this.config.classNames.error, true);
        }

        // Clear timer
        clearTimeout(this.timers.failed);

        // Timer to prevent flicker when seeking
        this.timers.loading = setTimeout(function () {
            // Toggle container class hook
            utils.toggleClass(_this3.elements.container, _this3.config.classNames.loading, _this3.loading);

            // Show controls if loading, hide if done
            _this3.toggleControls(_this3.loading);
        }, this.loading ? 250 : 0);
    }
// Check if media failed to load
Check if media failed to load
Check if media failed to load
function checkFailed() {
        var _this3 = this;
        this.failed = this.media.networkState === 3;
        if (this.failed) {
            utils.toggleClass(this.elements.container, this.config.classNames.loading, false);
            utils.toggleClass(this.elements.container, this.config.classNames.error, true);
        }
        clearTimeout(this.timers.failed);
        this.timers.loading = setTimeout(function () {
            utils.toggleClass(_this3.elements.container, _this3.config.classNames.loading, _this3.loading);
            _this3.toggleControls(_this3.loading);
        }, this.loading ? 250 : 0);
    }
function checkFailed ( ) { var _this3 = this ; this . failed = this . media . networkState === 3 ; if ( this . failed ) { utils . toggleClass ( this . elements . container , this . config . classNames . loading , false ) ; utils . toggleClass ( this . elements . container , this . config . classNames . error , true ) ; } clearTimeout ( this . timers . failed ) ; this . timers . loading = setTimeout ( function ( ) { utils . toggleClass ( _this3 . elements . container , _this3 . config . classNames . loading , _this3 . loading ) ; _this3 . toggleControls ( _this3 . loading ) ; } , this . loading ? 250 : 0 ) ; }
Check if media failed to load
Check if media failed to load
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/networkState // Clear timer // Timer to prevent flicker when seeking // Toggle container class hook // Show controls if loading, hide if done