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

Quelle  test_seek_duration.html   Sprache: HTML

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


<!DOCTYPE HTML>
<html>
<head>
  <title>Media test: seek tests</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  <script type="text/javascript" src="manifest.js"></script>
  <script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">

/**
 * This test is used to make sure video's duration won't be changed when it
 * reachs to the end after seeking to position where the time is very close to
 * video's end time.
 */

SimpleTest.waitForExplicitFinish();

async function test(name, videoProperties)
{
  const video = document.createElement('video');
  video.src = "bunny.webm";
  Object.assign(video, videoProperties);
  document.body.appendChild(video);

  const loadedMetadata = once(video"loadedmetadata");
  const canplay = once(video"canplay");
  const end = once(video"ended");

  info(`- wait for ${name} video loading metadata -`);
  await loadedMetadata;
  const originalDuration = video.duration;

  info(`- seek ${name} video to the position which is close to end time -`);
  // video's duration is 2.1 and the last key frame is in 2.0, we want to seek
  // to that keyframe.
  video.currentTime = originalDuration - 0.1;

  info(`- play ${name} video until it ends -`);
  await canplay;
  await video.play();
  await end;

  is(video.duration, originalDuration, `${name} duration shouldn't change`);
  removeNodeAndSource(video);
}

(async function startTest() {
  await Promise.all([
    test("unmuted", {}),
    test("muted", {muted: true}),
  ]);
  SimpleTest.finish();
})();

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

Messung V0.5
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet)  ¤

*© 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.