Skip to content
Draft
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
20 changes: 2 additions & 18 deletions src/streaming/controllers/CmcdController.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Debug from '../../core/Debug.js';
import {encodeCmcd} from '@svta/common-media-library/cmcd/encodeCmcd';
import {toCmcdHeaders} from '@svta/common-media-library/cmcd/toCmcdHeaders';
import {CmcdHeaderField} from '@svta/common-media-library/cmcd/CmcdHeaderField';

import {convertToCmcdV1} from '@svta/common-media-library/cmcd/CmcdV2ToCmcdV1';

import CmcdReportRequest from '../../streaming/vo/CmcdReportRequest.js';
import Utils from '../../core/Utils.js';
Expand Down Expand Up @@ -579,10 +579,7 @@ function CmcdController() {

const cmcdVersion = settings.get().streaming.cmcd.version ?? Constants.CMCD_DEFAULT_VERSION;
if (cmcdVersion === 1) {
// TODO: Re-Add this import once common-media-library pr is merged: https://github.com/qualabs/common-media-library/pull/48
// Also remove the temporaryConvertToCmcdV1 line
// cmcdRequestData = convertToCmcdV1(cmcdRequestData);
cmcdRequestData = temporaryConvertToCmcdV1(cmcdRequestData);
cmcdRequestData = convertToCmcdV1(cmcdRequestData);
}

request.cmcd = cmcdRequestData;
Expand All @@ -600,19 +597,6 @@ function CmcdController() {
return commonMediaRequest;
}

// TODO: delete this once common-media-library pr is merged: https://github.com/qualabs/common-media-library/pull/48
function temporaryConvertToCmcdV1(cmcdData) {
const result = {};

for (const key in cmcdData) {
if (Constants.CMCD_AVAILABLE_KEYS.includes(key)) {
result[key] = cmcdData[key];
}
}

return result;
}

function getCmcdResponseInterceptors(){
return [_cmcdResponseModeInterceptor];
}
Expand Down
Loading