Skip to content

Commit

Permalink
Pass a copy of hlsjsConfig to HLS.js
Browse files Browse the repository at this point in the history
  • Loading branch information
andrefilimono committed Feb 17, 2018
1 parent 64afb50 commit f138cf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/base/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import './polyfills'
import Browser from '../components/browser'
import $ from 'clappr-zepto'

function assign(obj, source) {
export function assign(obj, source) {
if (source) {
for (const prop in source) {
const propDescriptor = Object.getOwnPropertyDescriptor(source, prop)
Expand Down
4 changes: 2 additions & 2 deletions src/playbacks/hls/hls.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import HTML5VideoPlayback from '../../playbacks/html5_video'
import HLSJS from 'hls.js'
import Events from '../../base/events'
import Playback from '../../base/playback'
import { now } from '../../base/utils'
import { now, assign } from '../../base/utils'
import Log from '../../plugins/log'

const AUTO = -1
Expand Down Expand Up @@ -149,7 +149,7 @@ export default class HLS extends HTML5VideoPlayback {
_setup() {
this._ccIsSetup = false
this._ccTracksUpdated = false
this._hls = new HLSJS(this.options.playback.hlsjsConfig || {})
this._hls = new HLSJS(assign({}, this.options.playback.hlsjsConfig))
this._hls.on(HLSJS.Events.MEDIA_ATTACHED, () => this._hls.loadSource(this.options.src))
this._hls.on(HLSJS.Events.LEVEL_LOADED, (evt, data) => this._updatePlaybackType(evt, data))
this._hls.on(HLSJS.Events.LEVEL_UPDATED, (evt, data) => this._onLevelUpdated(evt, data))
Expand Down

0 comments on commit f138cf4

Please sign in to comment.