Skip to content

Commit 5537d30

Browse files
Remove Map / Update BCP-47 Libraries (#87)
1 parent ba5903d commit 5537d30

File tree

6 files changed

+71
-68
lines changed

6 files changed

+71
-68
lines changed

package-lock.json

+52-52
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
"yargs": "16.0.3"
5959
},
6060
"dependencies": {
61-
"bcp-47-match": "^1.0.3",
62-
"bcp-47-normalize": "^1.1.1",
61+
"bcp-47-match": "^2.0.3",
62+
"bcp-47-normalize": "^2.3.0",
6363
"codem-isoboxer": "0.3.9",
6464
"es6-promise": "^4.2.8",
6565
"fast-deep-equal": "2.0.1",

src/dash/DashAdapter.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import Event from './vo/Event';
3838
import FactoryMaker from '../core/FactoryMaker';
3939
import DashManifestModel from './models/DashManifestModel';
4040
import PatchManifestModel from './models/PatchManifestModel';
41-
import bcp47Normalize from 'bcp-47-normalize';
41+
import {bcp47Normalize} from 'bcp-47-normalize';
4242

4343
/**
4444
* @module DashAdapter
@@ -1045,7 +1045,7 @@ function DashAdapter() {
10451045
viewpoint = dashManifestModel.getViewpointForAdaptation(realAdaptation);
10461046
mediaInfo.viewpoint = viewpoint.length ? viewpoint[0].value : undefined;
10471047
mediaInfo.viewpointsWithSchemeIdUri = viewpoint;
1048-
1048+
10491049
accessibility = dashManifestModel.getAccessibilityForAdaptation(realAdaptation);
10501050
mediaInfo.accessibility = accessibility.map(function (accessibility) {
10511051
let accessibilityValue = accessibility.value;
@@ -1075,13 +1075,13 @@ function DashAdapter() {
10751075
});
10761076
mediaInfo.audioChannelConfigurationsWithSchemeIdUri = acc_rep;
10771077
}
1078-
1078+
10791079
roles = dashManifestModel.getRolesForAdaptation(realAdaptation);
10801080
mediaInfo.roles = roles.map(function (role) {
10811081
return role.value;
10821082
});
10831083
mediaInfo.rolesWithSchemeIdUri = roles;
1084-
1084+
10851085
mediaInfo.codec = dashManifestModel.getCodec(realAdaptation);
10861086
mediaInfo.mimeType = dashManifestModel.getMimeType(realAdaptation);
10871087
mediaInfo.contentProtection = dashManifestModel.getContentProtectionData(realAdaptation);
@@ -1120,7 +1120,7 @@ function DashAdapter() {
11201120
mediaInfo.supplementalPropertiesAsArray = arr[0];
11211121
}
11221122
}
1123-
1123+
11241124
mediaInfo.isFragmented = dashManifestModel.getIsFragmented(realAdaptation);
11251125
mediaInfo.isEmbedded = false;
11261126

src/dash/parser/matchers/LangMatcher.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
import BaseMatcher from './BaseMatcher';
3535
import DashConstants from '../../constants/DashConstants';
36-
import bcp47Normalize from 'bcp-47-normalize';
36+
import {bcp47Normalize} from 'bcp-47-normalize';
3737

3838
class LangMatcher extends BaseMatcher {
3939
constructor() {

src/streaming/controllers/MediaController.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import Events from '../../core/events/Events';
3333
import EventBus from '../../core/EventBus';
3434
import FactoryMaker from '../../core/FactoryMaker';
3535
import Debug from '../../core/Debug';
36-
import bcp47Normalize from 'bcp-47-normalize';
36+
import {bcp47Normalize} from 'bcp-47-normalize';
3737
import {extendedFilter} from 'bcp-47-match';
3838

3939
function MediaController() {

src/streaming/models/VideoModel.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@ import Debug from '../../core/Debug';
3636
import Constants from '../constants/Constants';
3737
import Settings from '../../core/Settings';
3838

39+
const READY_STATES_TO_EVENT_NAMES = function () {
40+
const ret = {};
3941

40-
const READY_STATES_TO_EVENT_NAMES = new Map([
41-
[Constants.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA, 'loadedmetadata'],
42-
[Constants.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA, 'loadeddata'],
43-
[Constants.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA, 'canplay'],
44-
[Constants.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA, 'canplaythrough']
45-
]);
42+
ret[Constants.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA] = 'loadedmetadata';
43+
ret[Constants.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA] = 'loadeddata';
44+
ret[Constants.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA] = 'canplay';
45+
ret[Constants.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA] = 'canplaythrough';
46+
47+
return ret;
48+
}();
4649

4750
function VideoModel() {
4851

@@ -447,7 +450,7 @@ function VideoModel() {
447450
callback();
448451
} else {
449452
// wait for the appropriate callback before checking again
450-
const event = READY_STATES_TO_EVENT_NAMES.get(targetReadyState);
453+
const event = READY_STATES_TO_EVENT_NAMES[targetReadyState];
451454
_listenOnce(event, callback);
452455
}
453456
}

0 commit comments

Comments
 (0)