Merge branch 'hartman-canplaytype'

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

View file

@ -118,7 +118,16 @@
//Return current src if src is not given
if(!src){ return player.src(); }
// Sort sources
// 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
this.currentSources = src.sort(compareResolutions);
this.groupedSrc = bucketSources(this.currentSources);
// Pick one by default