Skip to content
Open
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
51 changes: 41 additions & 10 deletions lib/dpctf-testharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function DpctfTest(config) {
});

video.addEventListener("canplay", function () {
log("video can play")
log("video can play");
updateQrCodePosition();
});

Expand Down Expand Up @@ -291,8 +291,15 @@ function DpctfTest(config) {
}
calculateMissingParameters();

if (usePlayout && parameters.playout) {
applyPlayout(parameters.playout);
if (usePlayout) {
if (parameters.playout) {
applyVideoPlayout(parameters.playout);
}
if (parameters.audioPlayout) {
applyAudioPlayout(parameters.audioPlayout);
} else {
applyAudioPlayout(parameters.playout);
}
}

if (parameters.gapDuration && parameters.gapLocationFragment) {
Expand Down Expand Up @@ -534,8 +541,8 @@ function DpctfTest(config) {
});
}

function applyPlayout(playout) {
player.clearVideoSegments();
function applyPlayout(playout, clearSegments, setSegments) {
clearSegments();
var ranges = Object.keys(playout);
var promises = [];
for (var range of ranges) {
Expand All @@ -551,14 +558,31 @@ function DpctfTest(config) {
startSegment: rangeParts[0],
endSegment: rangeParts[1],
};
var videoPromise = player.setVideoSegments(segmentConfig);
var videoPromise = setSegments(segmentConfig);
promises.push(videoPromise);

var audioPromise = player.setAudioSegments(segmentConfig);
promises.push(audioPromise);
}

Promise.all(promises).then(function () {
return Promise.all(promises);
}

function applyVideoPlayout(playout) {
applyPlayout(
playout,
player.clearVideoSegments,
player.setVideoSegments
).then(function () {
if (parameters.playbackDuration) {
player.setDuration(parameters.playbackDuration);
}
});
}

function applyAudioPlayout(playout) {
applyPlayout(
playout,
player.clearAudioSegments,
player.setAudioSegments
).then(function () {
if (parameters.playbackDuration) {
player.setDuration(parameters.playbackDuration);
}
Expand Down Expand Up @@ -776,6 +800,7 @@ function DpctfTest(config) {
contentKey: determineValue("content_key"),
loading: determineValue("loading"),
playout: determineValue("playout"),
audioPlayout: determineValue("audio_playout"),
gapLocationFragment: determineValue("gap_location_fragment"),
gapDuration: determineValue("gap_duration"),
randomAccessTo: determineValue("random_access_to"),
Expand Down Expand Up @@ -842,6 +867,12 @@ function DpctfTest(config) {
}
parameters.secondPlayout = secondPlayout;

var audioPlayout = determineValue("playout");
if (audioPlayout) {
audioPlayout = calcPlayout(audioPlayout);
}
parameters.audioPlayout = audioPlayout;

resolve(parameters);
});
xhr.open("GET", "/test-config.json");
Expand Down
5 changes: 5 additions & 0 deletions test-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,11 @@
[1, 1, 1], [1, 1, 2], [1, 1, 3],
[2, 1, 1], [2, 1, 2], [2, 1, 3],
[1, 1, 4], [1, 1, 5], [1, 1, 6]
],
"audio_playout": [
[1, 1, 1], [1, 1, 2], [1, 1, 3],
[2, 1, 1], [2, 1, 2], [2, 1, 3],
[1, 1, 4], [1, 1, 5]
]
},
"ceac-online/playback-over-wave-baseline-splice-constraints__at3_at4.html": {
Expand Down