src/index.js
/**
     * Set config to Dom
     *
     * @param {Object} config Set config to dom
     */
Set config to Dom
@param {Object} config Set config to dom
Set config to Dom @param { Object } config Set config to dom
initDom(config) {
        const EXTEA = ['extra', 'https'];
        let self = this;
        var checkResult = self.checkParams(config);
        if (!checkResult) {
            return;
        }
        let container = document.querySelector('#' + config.id);
        container.innerHTML = '<video>Sorry, your browser does not support embedded videos.</video>';
        let videoDom = container.querySelector('video');
        let srcList = [];
        for (let k in config) {
            if (config.hasOwnProperty(k) && !EXTEA.includes(k)) {
                if (typeof config[k] === 'boolean') {
                    if (k === 'playsinline' && config[k] === true) {
                        videoDom.setAttribute('playsinline', 'playsinline');
                        videoDom.setAttribute('webkit-playsinline', 'webkit-playsinline');
                    }
                    else {
                        videoDom[k] = config[k];
                    }
                }
                else if (k === 'src') {
                    srcList = config[k];
                    videoDom.setAttribute(k, config[k][0]);
                    if (srcList.length > 1) {
                        self.playList(videoDom, srcList);
                    }
                }
                else {
                    videoDom.setAttribute(k, config[k]);
                }
            }
        }
        log.bind(videoDom, config.extra.refer);
    }
initDom ( config ) { const EXTEA = [ 'extra' , 'https' ] ; let self = this ; var checkResult = self . checkParams ( config ) ; if ( ! checkResult ) { return ; } let container = document . querySelector ( '#' + config . id ) ; container . innerHTML = '<video>Sorry, your browser does not support embedded videos.</video>' ; let videoDom = container . querySelector ( 'video' ) ; let srcList = [ ] ; for ( let k in config ) { if ( config . hasOwnProperty ( k ) && ! EXTEA . includes ( k ) ) { if ( typeof config [ k ] === 'boolean' ) { if ( k === 'playsinline' && config [ k ] === true ) { videoDom . setAttribute ( 'playsinline' , 'playsinline' ) ; videoDom . setAttribute ( 'webkit-playsinline' , 'webkit-playsinline' ) ; } else { videoDom [ k ] = config [ k ] ; } } else if ( k === 'src' ) { srcList = config [ k ] ; videoDom . setAttribute ( k , config [ k ] [ 0 ] ) ; if ( srcList . length > 1 ) { self . playList ( videoDom , srcList ) ; } } else { videoDom . setAttribute ( k , config [ k ] ) ; } } } log . bind ( videoDom , config . extra . refer ) ; }
Set config to Dom
 @param {Object} config Set config to dom
Set config to Dom @param { Object } config Set config to dom
// Not video element attribute // If src is a list, play list