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

Reduce dependencies #3086

Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a47f247
detect initialization type has to be made by FragmentRequest object
Sep 25, 2019
2d03e6e
StreamProcessor has a dashHandler reference : remove the opposite ref…
Sep 25, 2019
98cf88e
remove unused parameter
nicosang Sep 27, 2019
746c1db
hasInitialization and hasSegments don't need to be static functions
nicosang Sep 27, 2019
7b19b80
remove keepIndex parameter, always equals true
nicosang Sep 27, 2019
7d038fc
remove unused parameter
nicosang Sep 30, 2019
e94ee9f
code simplification
nicosang Sep 30, 2019
c59ec83
liveEdgeFinder is only used in ScheduleController, move the instance …
nicosang Sep 30, 2019
e5f38e1
add setInfo function to FragmentRequest class
Oct 1, 2019
1f81146
call segmentsController.update only if needed case
Oct 1, 2019
5361bfa
add startDataUpdate and endDataUpdate functions
nicosang Oct 3, 2019
da500ef
remove useless parameter
nicosang Oct 3, 2019
0490f36
add missing function in mock class
nicosang Oct 3, 2019
ce6c22a
remove reference of DashHandler in RepresentationController
nicosang Oct 3, 2019
86b3eb7
modify updateData function
nicosang Oct 3, 2019
6cbb881
rmove reference of streamProcessor in RepresentationController.
nicosang Oct 4, 2019
ad9aff6
remove unused reference
nicosang Oct 7, 2019
e5b320f
remove circular dependencies between debug.js and settings.js
nicosang Oct 7, 2019
03142a0
remove circular dependencies between BufferController.js and Throughp…
nicosang Oct 7, 2019
1d5d068
fix rebase conflicts
nicosang Oct 8, 2019
0e19eec
update isEndlessMedia function
nicosang Oct 8, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function DownloadRatioRuleClass() {

let factory = dashjs.FactoryMaker;
let SwitchRequest = factory.getClassFactoryByName('SwitchRequest');
let MetricsModel = factory.getSingletonFactoryByName('MetricsModel');
let DashMetrics = factory.getSingletonFactoryByName('DashMetrics');
let DashManifestModel = factory.getSingletonFactoryByName('DashManifestModel');
let StreamController = factory.getSingletonFactoryByName('StreamController');
Expand Down
53 changes: 5 additions & 48 deletions src/core/Debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import EventBus from './EventBus';
import Events from './events/Events';
import FactoryMaker from './FactoryMaker';
import Settings from './Settings';

const LOG_LEVEL_NONE = 0;
const LOG_LEVEL_FATAL = 1;
Expand All @@ -42,13 +41,15 @@ const LOG_LEVEL_DEBUG = 5;

/**
* @module Debug
* @param {object} config
* @ignore
*/
function Debug() {
function Debug(config) {

config = config || {};
const context = this.context;
const eventBus = EventBus(context).getInstance();
const settings = Settings(context).getInstance();
const settings = config.settings;

const logFn = [];

Expand Down Expand Up @@ -97,48 +98,6 @@ function Debug() {
};
}

/**
* Sets up the log level. The levels are cumulative. For example, if you set the log level
* to dashjs.Debug.LOG_LEVEL_WARNING all warnings, errors and fatals will be logged. Possible values
*
* <ul>
* <li>dashjs.Debug.LOG_LEVEL_NONE<br/>
* No message is written in the browser console.
*
* <li>dashjs.Debug.LOG_LEVEL_FATAL<br/>
* Log fatal errors. An error is considered fatal when it causes playback to fail completely.
*
* <li>dashjs.Debug.LOG_LEVEL_ERROR<br/>
* Log error messages.
*
* <li>dashjs.Debug.LOG_LEVEL_WARNING<br/>
* Log warning messages.
*
* <li>dashjs.Debug.LOG_LEVEL_INFO<br/>
* Log info messages.
*
* <li>dashjs.Debug.LOG_LEVEL_DEBUG<br/>
* Log debug messages.
* </ul>
* @param {number} value Log level
* @default true
* @memberof module:Debug
* @instance
*/
function setLogLevel(value) {
const s = { debug: { logLevel: value }};
settings.update(s);
}

/**
* Use this method to get the current log level.
* @memberof module:Debug
* @instance
*/
function getLogLevel() {
return settings.get().debug.logLevel;
}

/**
* Prepends a timestamp in milliseconds to each log message.
* @param {boolean} value Set to true if you want to see a timestamp in each log message.
Expand Down Expand Up @@ -216,9 +175,7 @@ function Debug() {
instance = {
getLogger: getLogger,
setLogTimestampVisible: setLogTimestampVisible,
setCalleeNameVisible: setCalleeNameVisible,
setLogLevel: setLogLevel,
getLogLevel: getLogLevel
setCalleeNameVisible: setCalleeNameVisible
};

setup();
Expand Down
5 changes: 1 addition & 4 deletions src/core/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ import FactoryMaker from './FactoryMaker';
import Utils from './Utils.js';
import Debug from '../core/Debug';
import Constants from '../streaming/constants/Constants';
import {
HTTPRequest
}
from '../streaming/vo/metrics/HTTPRequest';
import { HTTPRequest } from '../streaming/vo/metrics/HTTPRequest';

/** @module Settings
* @description Define the configuration parameters of Dash.js MediaPlayer.
Expand Down
3 changes: 2 additions & 1 deletion src/core/events/CoreEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class CoreEvents extends EventsBase {
this.MANIFEST_UPDATED = 'manifestUpdated';
this.MEDIA_FRAGMENT_LOADED = 'mediaFragmentLoaded';
this.QUOTA_EXCEEDED = 'quotaExceeded';
this.REPRESENTATION_UPDATED = 'representationUpdated';
this.REPRESENTATION_UPDATE_STARTED = 'representationUpdateStarted';
this.REPRESENTATION_UPDATE_COMPLETED = 'representationUpdateCompleted';
this.SEGMENTS_LOADED = 'segmentsLoaded';
this.SERVICE_LOCATION_BLACKLIST_ADD = 'serviceLocationBlacklistAdd';
this.SERVICE_LOCATION_BLACKLIST_CHANGED = 'serviceLocationBlacklistChanged';
Expand Down
Loading