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

Player - Fix initial options merge #43

Merged
merged 1 commit into from
Jan 15, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/base/playback/playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default class Playback extends UIObject {
* @param {Object} options all the options to change in form of a javascript object
*/
configure(options) {
this._options = $.extend(this._options, options)
this._options = $.extend(true, this._options, options)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/base/ui_object/ui_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default class UIObject extends BaseObject {
*/
_ensureElement() {
if (!this.el) {
const attrs = $.extend({}, this.attributes)
const attrs = $.extend(true, {}, this.attributes)
if (this.id) attrs.id = this.id
if (this.className) attrs['class'] = this.className
const $el = $(DomRecycler.create(this.tagName)).attr(attrs)
Expand Down
4 changes: 2 additions & 2 deletions src/components/container/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default class Container extends UIObject {
this.volume = 100
this.playback = options.playback
this.playerError = playerError
this.settings = $.extend({}, this.playback.settings)
this.settings = $.extend(true, {}, this.playback.settings)
this.isReady = false
this.mediaControlDisabled = false
this.plugins = [this.playback]
Expand Down Expand Up @@ -510,7 +510,7 @@ export default class Container extends UIObject {
* @param {Object} options all the options to change in form of a javascript object
*/
configure(options) {
this._options = $.extend(this._options, options)
this._options = $.extend(true, this._options, options)
this.updateStyle()
this.playback.configure(this.options)
this.trigger(Events.CONTAINER_OPTIONS_CHANGE)
Expand Down
4 changes: 2 additions & 2 deletions src/components/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export default class Core extends UIObject {
sources = sources && sources.constructor === Array ? sources : [sources]
this.options.sources = sources
this.containers.forEach((container) => container.destroy())
this.containerFactory.options = $.extend(this.options, { sources })
this.containerFactory.options = $.extend(true, this.options, { sources })
this.prepareContainers()
}

Expand Down Expand Up @@ -349,7 +349,7 @@ export default class Core extends UIObject {
* @param {Object} options all the options to change in form of a javascript object
*/
configure(options) {
this._options = $.extend(this._options, options)
this._options = $.extend(true, this._options, options)
this.configureDomRecycler()

const sources = options.source || options.sources
Expand Down
2 changes: 1 addition & 1 deletion src/components/player/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export default class Player extends BaseObject {
includeResetStyle: true,
playback: playbackDefaultOptions
}
this._options = $.extend(defaultOptions, options)
this._options = $.extend(true, defaultOptions, options)
this.options.sources = this._normalizeSources(options)
if (!this.options.chromeless) {
// "allowUserInteraction" cannot be false if not in chromeless mode.
Expand Down
2 changes: 1 addition & 1 deletion src/playbacks/html5_video/html5_video.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default class HTML5Video extends Playback {

}

$.extend(this.el, {
$.extend(true, this.el, {
muted: this.options.mute,
defaultMuted: this.options.mute,
loop: this.options.loop,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export function canAutoPlayMedia(cb, options) {
// Simple element factory with video recycle feature.
export class DomRecycler {
static configure(options) {
this.options = $.extend(this.options, options)
this.options = $.extend(true, this.options, options)
}

static create(name) {
Expand Down