demo-src/player/public/build/bundle.js
// copy properties from tracks to media objects
copy properties from tracks to media objects
copy properties from tracks to media objects
function resolveMediaData(node, map) {
        if (isMedia(node.type)) {
            if (node.track) {
                let track = node.track;
                if (track.defaultSrc) {
                    if (node.src) {
                        if (node.src[0] == "#") {
                            node.src = track.defaultSrc + node.src;
                            if (track.containerType) {
                                node.containerType = track.containerType;
                            }
                        }
                    }
                    else {
                        node.src = track.defaultSrc;
                        if (track.containerType) {
                            node.containerType = track.containerType;
                        }
                    }
                }
                if (track.params) {
                    Object.keys(track.params).map(k => {
                        if (!node.params.hasOwnProperty(k)) {
                            node.params[k] = track.params[k];
                        }
                    });
                }
            }
        }
        else {
            if (node.media) {
                node.media.map(m => resolveMediaData(m));
            }
        }
    }
function resolveMediaData ( node , map ) { if ( isMedia ( node . type ) ) { if ( node . track ) { let track = node . track ; if ( track . defaultSrc ) { if ( node . src ) { if ( node . src [ 0 ] == "#" ) { node . src = track . defaultSrc + node . src ; if ( track . containerType ) { node . containerType = track . containerType ; } } } else { node . src = track . defaultSrc ; if ( track . containerType ) { node . containerType = track . containerType ; } } } if ( track . params ) { Object . keys ( track . params ) . map ( k => { if ( ! node . params . hasOwnProperty ( k ) ) { node . params [ k ] = track . params [ k ] ; } } ) ; } } } else { if ( node . media ) { node . media . map ( m => resolveMediaData ( m ) ) ; } } }
copy properties from tracks to media objects
copy properties from tracks to media objects
// node could be a media object or a time container // if this media object has a track mapped to it // go through the track properties and apply them to the media object // if the media object has an src // if it's just a fragment selector, then combine it with the track's default src // else node.src overrides track.defaultSrc // so do nothing // else the media object inherits the track's default src // defer to local params, otherwise inherit track params // else is a time container