Skip to content

Commit

Permalink
avoid Object.assign
Browse files Browse the repository at this point in the history
  • Loading branch information
thecotne authored and mangui committed Jul 18, 2017
1 parent ccd928b commit 168aa9d
Show file tree
Hide file tree
Showing 2 changed files with 3,849 additions and 21 deletions.
38 changes: 17 additions & 21 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,7 @@ import TimelineController from './controller/timeline-controller';
import SubtitleTrackController from './controller/subtitle-track-controller';
import SubtitleStreamController from './controller/subtitle-stream-controller';

if (typeof __BUILD_VERSION__ === 'undefined' || __BUILD_VERSION__ === 'full') {
var fullConfig = {
audioStreamController: AudioStreamController,
audioTrackController : AudioTrackController,
subtitleStreamController: SubtitleStreamController,
subtitleTrackController: SubtitleTrackController,
timelineController: TimelineController,
cueHandler: Cues,
enableCEA708Captions: true, // used by timeline-controller
enableWebVTT: true, // used by timeline-controller
captionsTextTrack1Label: 'English', // used by timeline-controller
captionsTextTrack1LanguageCode: 'en', // used by timeline-controller
captionsTextTrack2Label: 'Spanish', // used by timeline-controller
captionsTextTrack2LanguageCode: 'es', // used by timeline-controller
};
} else {
var fullConfig = {};
}

export var hlsDefaultConfig = Object.assign({}, fullConfig, {
export var hlsDefaultConfig = {
autoStartLoad: true, // used by stream-controller
startPosition: -1, // used by stream-controller
defaultAudioCodec: undefined, // used by stream-controller
Expand Down Expand Up @@ -102,4 +83,19 @@ export var hlsDefaultConfig = Object.assign({}, fullConfig, {
maxStarvationDelay : 4, // used by abr-controller
maxLoadingDelay : 4, // used by abr-controller
minAutoBitrate: 0 // used by hls
});
};

if (typeof __BUILD_VERSION__ === 'undefined' || __BUILD_VERSION__ === 'full') {
hlsDefaultConfig.audioStreamController = AudioStreamController;
hlsDefaultConfig.audioTrackController = AudioTrackController;
hlsDefaultConfig.subtitleStreamController = SubtitleStreamController;
hlsDefaultConfig.subtitleTrackController = SubtitleTrackController;
hlsDefaultConfig.timelineController = TimelineController;
hlsDefaultConfig.cueHandler = Cues;
hlsDefaultConfig.enableCEA708Captions = true; // used by timeline-controller
hlsDefaultConfig.enableWebVTT = true; // used by timeline-controller
hlsDefaultConfig.captionsTextTrack1Label = 'English'; // used by timeline-controller
hlsDefaultConfig.captionsTextTrack1LanguageCode = 'en'; // used by timeline-controller
hlsDefaultConfig.captionsTextTrack2Label = 'Spanish'; // used by timeline-controller
hlsDefaultConfig.captionsTextTrack2LanguageCode = 'es'; // used by timeline-controller
}
Loading

0 comments on commit 168aa9d

Please sign in to comment.