Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/media/mediasource/test/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  test_Eviction_mp4.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/media/mediasource/test/test_Eviction_mp4.html


<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
  <title>MSE: QuotaExceededError when source buffer is full</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="text/javascript" src="mediasource.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test"><script class="testbody" type="text/javascript">

SimpleTest.waitForExplicitFinish();
// 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)

addMSEPrefs(
  ["media.mediasource.eviction_threshold.audio", 524288],
  ["media.dormant-on-pause-timeout-ms", -1] // FIXME: bug 1319292
);

runWithMSE(async (ms, el) => {
  el.controls = true;
  await once(ms, "sourceopen");
  ok(true, "Receive a sourceopen event");
  const audiosb = ms.addSourceBuffer("audio/mp4");
  audiosb.mode = "sequence";
  await fetchAndLoad(audiosb, "bipbop/bipbop_audio", ["init"], ".mp4");
  const audioBuffer = await fetchWithXHR("bipbop/bipbop_audio1.m4s");

  await must_reject(async () => {
    // We are appending data repeatedly in sequence mode, there should be no gaps.
    while (true) {
      ok(audiosb.buffered.length <= 1, "there should be no gap in buffered ranges.");
      audiosb.appendBuffer(audioBuffer);
      await once(audiosb, "updateend");
    }
  },
  "Fill up SourceBuffer by appending data until an exception is thrown.",
  "QuotaExceededError");

  is(audiosb.buffered.end(0), el.duration, "Duration is end of buffered range");
  const seekTime = audiosb.buffered.end(0) / 2;
  el.currentTime = seekTime;
  await once(el, "seeked");
  dump("dump: seeked to " + seekTime);
  is(el.currentTime, seekTime, "correctly seeked to " + seekTime);
  try {
    audiosb.appendBuffer(audioBuffer);
    await once(audiosb, "update");
    ok(true, "appendBuffer succeeded");
  } catch (ex) {
    ok(false, "Shouldn't throw another time when data can be evicted");
    dump(JSON.stringify(await SpecialPowers.wrap(el).mozRequestDebugInfo()));
  }
  SimpleTest.finish();
});

</script>
</pre>
</body>
</html>

Messung V0.5
C=95 H=91 G=92

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.