Skip to content

Commit

Permalink
Fix CMCD key sorting and add filter for "v" attribute again
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed Nov 11, 2020
1 parent 03ed196 commit 89e7527
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/streaming/controllers/BufferController.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,6 @@ function BufferController(config) {
seekClearedBufferingCompleted = false;
isBufferingCompleted = true;
logger.debug('checkIfSufficientBuffer trigger BUFFERING_COMPLETED for type ' + type);
logger.debug('checkIfSufficientBuffer trigger BUFFERING_COMPLETED for type ' + type);
triggerEvent(Events.BUFFERING_COMPLETED);
}

Expand Down
3 changes: 2 additions & 1 deletion src/streaming/models/CmcdModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,11 @@ function CmcdModel() {
if (!cmcdData) {
return null;
}
const keys = Object.keys(cmcdData).sort((a, b) => a > b);
const keys = Object.keys(cmcdData).sort((a, b) =>a.localeCompare(b));
const length = keys.length;

let cmcdString = keys.reduce((acc, key, index) => {
if (key === 'v' && cmcdData[key] === 1) return acc; // Version key should only be reported if it is != 1
if (typeof cmcdData[key] === 'string' && (key !== 'ot' || key !== 'sf' || key !== 'st')) {
let string = cmcdData[key].replace(/"/g, '\"');
acc += `${key}="${string}"`;
Expand Down

0 comments on commit 89e7527

Please sign in to comment.