Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make sure source options are passed through #5240

Merged
merged 1 commit into from Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/player.js
Expand Up @@ -1258,7 +1258,7 @@ class Player extends Component {
}

// update `currentSource` cache always
this.cache_.source = {src, type};
this.cache_.source = mergeOptions({}, srcObj, {src, type});

const matchingSources = this.cache_.sources.filter((s) => s.src && s.src === src);
const sourceElSources = [];
Expand Down
14 changes: 14 additions & 0 deletions test/unit/player.test.js
Expand Up @@ -1907,3 +1907,17 @@ QUnit.test('disposing a tech that dit NOT set a poster, should keep the poster',

player.dispose();
});

QUnit.test('source options are retained', function(assert) {
const player = TestHelpers.makePlayer();

const source = {
src: 'https://some.url',
type: 'someType',
sourceOption: 'someOption'
};

player.src(source);

assert.equal(player.currentSource().sourceOption, 'someOption', 'source option retained');
});