// Called before runWithMSE() to set the prefs before running MSE tests. function addMSEPrefs(...prefs) {
gMSETestPrefs = gMSETestPrefs.concat(prefs);
}
function fetchAndLoadAsync(sb, prefix, chunks, suffix) { // Fetch the buffers in parallel. const buffers = {}; const fetches = []; for (const chunk of chunks) {
fetches.push(
fetchWithXHR(prefix + chunk + suffix).then(
((c, x) => (buffers[c] = x)).bind(null, chunk)
)
);
}
// Load them in series, as required per spec. return Promise.all(fetches).then(function () {
let rv = Promise.resolve(); for (const chunk of chunks) {
rv = rv.then(loadSegmentAsync.bind(null, sb, buffers[chunk]));
} return rv;
});
}
// Register timeout function to dump debugging logs.
SimpleTest.registerTimeoutFunction(async function () { for (const v of document.getElementsByTagName("video")) {
console.log(await SpecialPowers.wrap(v).mozRequestDebugInfo());
} for (const a of document.getElementsByTagName("audio")) {
console.log(await SpecialPowers.wrap(a).mozRequestDebugInfo());
}
});
async function waitUntilTime(target, targetTime) {
await new Promise(resolve => {
target.addEventListener("waiting", function onwaiting() {
info("Got a waiting event at " + target.currentTime); if (target.currentTime >= targetTime) {
target.removeEventListener("waiting", onwaiting);
resolve();
}
});
});
ok(true, "Reached target time of: " + targetTime);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.