mirror of
https://github.com/iv-org/videojs-quality-selector.git
synced 2024-10-01 06:35:49 -04: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
@ -19,7 +19,11 @@ module.exports = function(videojs) {
|
|||||||
isPaused = player.paused(),
|
isPaused = player.paused(),
|
||||||
selectedSource;
|
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 });
|
selectedSource = _.findWhere(sources, { src: newSource.src });
|
||||||
// Note: `_.findWhere` returns a reference to an object. Thus the
|
// Note: `_.findWhere` returns a reference to an object. Thus the
|
||||||
// following updates the original object in `sources`.
|
// following updates the original object in `sources`.
|
||||||
|
Loading…
Reference in New Issue
Block a user