mirror of
https://gitea.invidious.io/iv-org/videojs-quality-selector.git
synced 2024-08-15 00:43:13 +00:00
Merge pull request #11 from silvermine/adjust_unselected_source_state
Use 'selected = false', over '_.omit' to deselect a source
This commit is contained in:
commit
cdea57c3a2
1 changed files with 5 additions and 1 deletions
|
@ -19,7 +19,11 @@ module.exports = function(videojs) {
|
|||
isPaused = player.paused(),
|
||||
selectedSource;
|
||||
|
||||
sources = _.map(sources, _.partial(_.omit, _, 'selected'));
|
||||
// Clear out any previously selected sources (see: #11)
|
||||
_.each(sources, function(source) {
|
||||
source.selected = false;
|
||||
});
|
||||
|
||||
selectedSource = _.findWhere(sources, { src: newSource.src });
|
||||
// Note: `_.findWhere` returns a reference to an object. Thus the
|
||||
// following updates the original object in `sources`.
|
||||
|
|
Loading…
Reference in a new issue