Skip to content

Commit

Permalink
testSmoothSwitch : use currentTime instead of readyState as test cond…
Browse files Browse the repository at this point in the history
…ition
  • Loading branch information
mangui committed Mar 15, 2018
1 parent 3d1531f commit 0caf7c5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/functional/auto/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,19 @@ describe('testing hls.js playback in the browser on "' + browserDescription + '"
video.onloadeddata = function () {
window.switchToHighestLevel('next');
};
window.setTimeout(function () {
let readyState = video.readyState;
console.log('[log] > readyState:' + readyState);
callback({ code: readyState, logs: window.logString });
}, 12000);
window.hls.on(window.Hls.Events.LEVEL_SWITCHED, function (event, data) {
var currentTime = video.currentTime;
if (data.level === window.hls.levels.length - 1) {
console.log('[log] > switched on level:' + data.level);
window.setTimeout(function () {
var newCurrentTime = video.currentTime;
console.log('[log] > currentTime delta :' + (newCurrentTime - currentTime));
callback({ code: newCurrentTime > currentTime, logs: window.logString });
}, 2000);
}
});
}, url, config).then(function (result) {
assert.strictEqual(result.code, 4);
assert.strictEqual(result.code, true);
});
};
};
Expand Down

0 comments on commit 0caf7c5

Please sign in to comment.