Merge branch 'hartman-canplaytype'

This commit is contained in:
Kasper Moskwiak 2016-07-09 19:18:59 +02:00
commit d14048dff5

View file

@ -118,6 +118,15 @@
//Return current src if src is not given //Return current src if src is not given
if(!src){ return player.src(); } if(!src){ return player.src(); }
// Only add those sources which we can (maybe) play
src = src.filter( function(source) {
try {
return ( player.canPlayType( source.type ) !== '' );
} catch (e) {
// If a Tech doesn't yet have canPlayType just add it
return true;
}
});
//Sort sources //Sort sources
this.currentSources = src.sort(compareResolutions); this.currentSources = src.sort(compareResolutions);
this.groupedSrc = bucketSources(this.currentSources); this.groupedSrc = bucketSources(this.currentSources);