mirror of
https://github.com/kmoskwiak/videojs-resolution-switcher.git
synced 2025-10-03 09:49:21 +02:00
Merge branch 'hartman-canplaytype'
This commit is contained in:
commit
d14048dff5
1 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue