// We fill up the source buffer with audio data until the buffer is full.
// We ensure that QuotaExceededError is thrown once the buffer is full.
// We then seek to half the content. By that time, another appendBuffer must succeed
// as the auto-eviction would succeed (removing all data prior currentTime)
// The test then fills the audio buffer and plays until the end.
// Fill up the SourceBuffer by appending data repeatedly via doAppendDataFunc until
// an exception is thrown.
async function fillUpSourceBuffer(sourceBuffer, doAppendDataFunc, onCaughtExceptionCallback) {
try {
// We are appending data repeatedly in sequence mode, there should be no gaps.
while (true) {
ok(sourceBuffer.buffered.length <= 1, "there should be no gap in buffered ranges.");
await doAppendDataFunc();
}
} catch (ex) {
ok(true, "appendBuffer promise got rejected");
onCaughtExceptionCallback(ex);
}
}
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.