diff --git a/public/src/core/media.js b/public/src/core/media.js index 8830d43da..9759cabe7 100644 --- a/public/src/core/media.js +++ b/public/src/core/media.js @@ -597,7 +597,8 @@ if ( importData.url && _duration >= 0 ) { var firstSource; - // If sources is a single array and of type null player, don't bother making a sequence. + // If sources is a single array and of type null player, + // don't bother making a sequence. if ( url.length > 1 || MediaTypes.checkUrl( url[ 0 ] ) !== "null" ) { // grab first source as main source. sources.push( URI.makeUnique( url.shift() ).toString() ); @@ -606,21 +607,24 @@ } firstSource = sources[ 0 ]; - newTrack = new Track(); - _this.addTrack( newTrack ); - newTrack.addTrackEvent({ - type: "sequencer", - popcornOptions: { - start: 0, - end: _duration, - source: sources, - title: URI.stripUnique( firstSource ).path, - fallback: fallbacks, - duration: _duration, - target: "video-container" - } + MediaTypes.getMetaData( firstSource, function( data ) { + + newTrack = new Track(); + _this.addTrack( newTrack ); + newTrack.addTrackEvent({ + type: "sequencer", + popcornOptions: { + start: 0, + end: _duration, + source: sources, + title: data.title, + fallback: fallbacks, + duration: _duration, + target: "video-container" + } + }); + _clipData[ firstSource ] = firstSource; }); - _clipData[ firstSource ] = firstSource; } } } else if ( console ) {