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

Clean up externals global variables so it works with module loaders. #1057

Merged
merged 3 commits into from
Jan 28, 2016
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
4 changes: 0 additions & 4 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
"predef" : [
"it",
"describe",
"ISOBoxer",
"ObjectIron",
"X2JS",
"kendo",
"BASE64",
"utils",
"MediaPlayer",
"Dash",
Expand Down
44 changes: 12 additions & 32 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ module.exports = function (grunt) {
}
},

build_all: {
options: {
sourceMap: false,
},
files: {
'build/temp/dash.all.min.js': ['build/temp/dash.no-externals.debug.js', 'externals/*.js']
}
},
build_core: {
options: {
sourceMapIn: 'build/temp/dash.mediaplayer.debug.js.map'
Expand All @@ -50,11 +42,6 @@ module.exports = function (grunt) {
'build/temp/dash.mediaplayer.min.js': 'build/temp/dash.mediaplayer.debug.js'
}
},
build_external: {
files: {
'build/temp/dash.externals.min.js': 'externals/*.js',
}
},
build_protection: {
options: {
sourceMapIn: 'build/temp/dash.protection.debug.js.map'
Expand All @@ -63,31 +50,24 @@ module.exports = function (grunt) {
'build/temp/dash.protection.min.js': 'build/temp/dash.protection.debug.js'
}
},

debug_external: {
build_all: {
options: {
sourceMap: true,
sourceMapRoot: './externals',
beautify: false,
compress: false,
mangle: false
sourceMapIn: 'build/temp/dash.all.debug.js.map'
},
files: {
'build/temp/dash.externals.debug.js': 'externals/*.js'
'build/temp/dash.all.min.js': 'build/temp/dash.all.debug.js'
}
}
},

},
copy: {
dist: {
expand: true,
cwd: 'build/temp/',
src: [
'dash.all.min.js', 'dash.all.min.js.map',
'dash.externals.min.js', 'dash.externals.min.js.map',
'dash.mediaplayer.min.js', 'dash.mediaplayer.min.js.map',
'dash.protection.min.js', 'dash.protection.min.js.map',
'dash.no-externals.debug.js', 'dash.no-externals.debug.js.map',
'dash.externals.debug.js', 'dash.externals.debug.js.map',
'dash.mediaplayer.debug.js', 'dash.mediaplayer.debug.js.map',
'dash.protection.debug.js', 'dash.protection.debug.js.map'
],
Expand All @@ -96,12 +76,6 @@ module.exports = function (grunt) {
}
},
exorcise: {
no_externals: {
options: {},
files: {
'build/temp/dash.no-externals.debug.js.map': ['build/temp/dash.no-externals.debug.js']
}
},
mediaplayer: {
options: {},
files: {
Expand All @@ -113,6 +87,12 @@ module.exports = function (grunt) {
files: {
'build/temp/dash.protection.debug.js.map': ['build/temp/dash.protection.debug.js']
}
},
all: {
options: {},
files: {
'build/temp/dash.all.debug.js.map': ['build/temp/dash.all.debug.js']
}
}
},
browserify: {
Expand Down Expand Up @@ -148,7 +128,7 @@ module.exports = function (grunt) {
},
all: {
files: {
'build/temp/dash.no-externals.debug.js': ['src/All.js']
'build/temp/dash.all.debug.js': ['src/All.js']
},
options: {
browserifyOptions: {
Expand Down
2 changes: 2 additions & 0 deletions externals/objectiron.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,5 @@ function ObjectIron(map) {
run: performMapping
};
}

export default ObjectIron;
1 change: 1 addition & 0 deletions externals/xml2json.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,4 @@ function X2JS(matchers, attrPrefix, ignoreRoot) {
escapeMode = enabled;
}
}
export default X2JS;
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
"time-grunt": "^1.2.0",
"uglify-js": "^2.4.21"
},
"dependencies": {
"codem-isoboxer": "0.2.1"
},
"repository": {
"type": "git",
"url": "https://github.com/Dash-Industry-Forum/dash.js.git"
Expand Down
2 changes: 2 additions & 0 deletions src/dash/DashParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import ErrorHandler from '../streaming/ErrorHandler.js';
import FactoryMaker from '../core/FactoryMaker.js';
import Debug from '../core/Debug.js';
import ObjectIron from '../../externals/objectiron.js';
import X2JS from '../../externals/xml2json.js';

function DashParser(/*config*/) {

Expand Down
1 change: 1 addition & 0 deletions src/streaming/TTMLParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
import FactoryMaker from '../core/FactoryMaker.js';
import X2JS from '../../externals/xml2json.js';

const SECONDS_IN_HOUR = 60 * 60; // Expression of an hour in seconds
const SECONDS_IN_MIN = 60; // Expression of a minute in seconds
Expand Down
1 change: 1 addition & 0 deletions src/streaming/controllers/XlinkController.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import EventBus from '../../core/EventBus.js';
import Events from '../../core/events/Events.js';
import FactoryMaker from '../../core/FactoryMaker.js';
import X2JS from '../../../externals/xml2json.js';

const RESOLVE_TYPE_ONLOAD = 'onLoad';
const RESOLVE_TYPE_ONACTUATE = 'onActuate';
Expand Down
2 changes: 2 additions & 0 deletions src/streaming/protection/CommonEncryption.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

import BASE64 from '../../../externals/base64.js';

class CommonEncryption {
/**
* Find and return the ContentProtection element in the given array
Expand Down
1 change: 1 addition & 0 deletions src/streaming/protection/drm/KeySystemPlayReady.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import CommonEncryption from '../CommonEncryption.js';
import Error from '../../vo/Error.js';

import FactoryMaker from '../../../core/FactoryMaker.js';
import BASE64 from '../../../../externals/base64.js';

const uuid = '9a04f079-9840-4286-ab92-e65be0885f95';
const systemString = 'com.microsoft.playready';
Expand Down
1 change: 1 addition & 0 deletions src/streaming/protection/servers/DRMToday.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* @class
*/
import FactoryMaker from '../../../core/FactoryMaker.js';
import BASE64 from '../../../../externals/base64.js';

function DRMToday() {

Expand Down
1 change: 1 addition & 0 deletions src/streaming/utils/BoxParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import IsoFile from './IsoFile.js';
import FactoryMaker from '../../core/FactoryMaker.js';
import ISOBoxer from 'codem-isoboxer';

function BoxParser(/*config*/) {

Expand Down