Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  test_eme_autoplay.html   Sprache: HTML

 

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


<!DOCTYPE HTML>
<html>
<head>
  <title>Test Encrypted Media Extensions</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="https://example.com:443/tests/dom/media/test/eme.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
/* import-globals-from eme.js */
var manager = new MediaTestManager;

var EMEmanifest = [
  {
    name:"bipbop 10s",
    tracks: [
      {
          name:"video",
          type:"video/mp4; codecs=\"avc1.4d4015\"",
          fragments:[ "bipbop-cenc-video-10s.mp4",
                    ]
      }
    ],
    keys: {
      "7e571d037e571d037e571d037e571d11" : "7e5733337e5733337e5733337e573311",
    },
    sessionType:"temporary",
    sessionCount:1,
    duration:10.01
  },
];

function startTest(test, token)
{
  manager.started(token);

  let v = document.createElement("video");
  v.controls = true;
  v.autoplay = true;

  document.body.appendChild(v);

  var eventCounts = { play: 0, playing: 0};
  function ForbiddenEvents(e) {
    var video = e.target;
    ok(video.readyState >= video.HAVE_FUTURE_DATA, "Must not have received event too early");
    is(eventCounts[e.type], 0, "event should have only be fired once");
    eventCounts[e.type]++;
  }
  // Log events for debugging.
  var events = ["suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata",
                "loadeddata", "playing", "ended", "error", "stalled", "emptied", "abort",
                "waiting", "pause", "durationchange", "seeking", "seeked"];
  function logEvent(e) {
    info("got " + e.type + " event");
  }
  events.forEach(function(e) {
    v.addEventListener(e, logEvent);
  });
  v.addEventListener("play", ForbiddenEvents);
  v.addEventListener("playing", ForbiddenEvents);

  var gotWaitingForKey = 0;

  let waitForKey = new EMEPromise;
  v.addEventListener("waitingforkey", function() {
    gotWaitingForKey += 1;
    waitForKey.resolve();
  });

  v.addEventListener("loadedmetadata", function() {
    ok(SpecialPowers.do_lookupGetter(v, "isEncrypted").apply(v),
       TimeStamp(token) + " isEncrypted should be true");
    is(v.isEncrypted, undefined, "isEncrypted should not be accessible from content");
  });

  let finish = new EMEPromise;
  v.addEventListener("playing", function() {
    ok(true, TimeStamp(token) + " got playing event");
    // We expect only one waitingForKey as we delay until all sessions are ready.
    // I.e. one waitingForKey should be fired, after which, we process all sessions,
    // so it should not be possible to be blocked by a key after that point.
    ok(gotWaitingForKey == 1,  "Expected number 1 wait, got: " + gotWaitingForKey);

    finish.resolve();
  });

  Promise.all([
    LoadInitData(v, test, token),
    CreateAndSetMediaKeys(v, test, token),
    LoadTest(test, v, token, false /* do not call endOfStream */),
    waitForKey.promise])
  .then(values => {
    let initData = values[0];
    return ProcessInitData(v, test, token, initData);
  })
  .then(sessions => {
    Log(token, "Updated all sessions, loading complete");
    finish.promise.then(() => CloseSessions(v, sessions));
    return finish.promise;
  })
  .catch(reason => ok(false, reason))
  .then(() => manager.finished(token));
}

SimpleTest.waitForExplicitFinish();
manager.runTests(EMEmanifest, startTest);

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

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

¤ Dauer der Verarbeitung: 0.27 Sekunden  (vorverarbeitet am  2026-09-28) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126864
#Domains=1897691