mirror of
https://github.com/iv-org/videojs-quality-selector.git
synced 2025-04-25 09:49:11 -04:00
Merge pull request #41 from gauda/patch-1
Accept 'selected' as value for source.selected
This commit is contained in:
commit
12bd19a69e
@ -24,10 +24,10 @@ module.exports = function(videojs) {
|
|||||||
// videojs using `src()`.
|
// videojs using `src()`.
|
||||||
|
|
||||||
userSelectedSource = _.find(sources, function(source) {
|
userSelectedSource = _.find(sources, function(source) {
|
||||||
// Must check for both boolean and string 'true' as sources set
|
// Must check for boolean values as well as either the string 'true' or
|
||||||
// programmatically should use a boolean, but those coming from
|
// 'selected'. When sources are set programmatically, the value will be a
|
||||||
// a `<source>` tag will use a string.
|
// boolean, but those coming from a `<source>` tag will be a string.
|
||||||
return source.selected === true || source.selected === 'true';
|
return source.selected === true || source.selected === 'true' || source.selected === 'selected';
|
||||||
});
|
});
|
||||||
|
|
||||||
chosenSource = userSelectedSource || playerSelectedSource;
|
chosenSource = userSelectedSource || playerSelectedSource;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user