src/js/glightbox.js
function injectVideoApi(url, callback) {
    if (utils.isNil(url)) {
        console.error('Inject videos api error');
        return;
    }
    let found = document.querySelectorAll('script[src="' + url + '"]')
    if (utils.isNil(found) || found.length == 0) {
        let script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = url;
        script.onload = () => {
            if (utils.isFunction(callback)) callback();
        };
        document.body.appendChild(script);
        return false;
    }
    if (utils.isFunction(callback)) callback();
}
function injectVideoApi(url, callback) {
    if (utils.isNil(url)) {
        console.error('Inject videos api error');
        return;
    }
    let found = document.querySelectorAll('script[src="' + url + '"]')
    if (utils.isNil(found) || found.length == 0) {
        let script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = url;
        script.onload = () => {
            if (utils.isFunction(callback)) callback();
        };
        document.body.appendChild(script);
        return false;
    }
    if (utils.isFunction(callback)) callback();
}
function injectVideoApi ( url , callback ) { if ( utils . isNil ( url ) ) { console . error ( 'Inject videos api error' ) ; return ; } let found = document . querySelectorAll ( 'script[src="' + url + '"]' ) if ( utils . isNil ( found ) || found . length == 0 ) { let script = document . createElement ( 'script' ) ; script . type = 'text/javascript' ; script . src = url ; script . onload = ( ) => { if ( utils . isFunction ( callback ) ) callback ( ) ; } ; document . body . appendChild ( script ) ; return false ; } if ( utils . isFunction ( callback ) ) callback ( ) ; }
Inject videos api
used for youtube, vimeo and jwplayer

@param {string} url
@param {function} callback
Inject videos api used for youtube vimeo and jwplayer