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,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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue