diff --git a/js/controllers/slidecontent.js b/js/controllers/slidecontent.js index 3a726b76e22..5333c7fe499 100644 --- a/js/controllers/slidecontent.js +++ b/js/controllers/slidecontent.js @@ -142,13 +142,15 @@ export default class SlideContent { // Support comma separated lists of video sources backgroundVideo.split( ',' ).forEach( source => { + const sourceElement = document.createElement( 'source' ); + sourceElement.setAttribute( 'src', source ); + let type = getMimeTypeFromFile( source ); if( type ) { - video.innerHTML += ``; - } - else { - video.innerHTML += ``; + sourceElement.setAttribute( 'type', type ); } + + video.appendChild( sourceElement ); } ); backgroundContent.appendChild( video );