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

Pass a copy of hlsjsConfig to HLS.js #1575

Merged
merged 1 commit into from
Feb 17, 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/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