<!DOCTYPEHTML>
<html>
<head>
<title>Test media tracks if replay after playback has ended</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>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
const manager = new MediaTestManager;
function startTest(test, token) {
// Scenario to test:
// 1. Audio tracks and video tracks should be added to the track list when
// metadata has loaded, and all tracks should remain even after we seek to
// the end.
// 2. No tracks should be added back to the list if we replay from the end,
// and no tracks should be removed from the list after we seek to the end.
// 3. After seek to the middle from end of playback, all tracks should remain
// in the list if we play from here, and no tracks should be removed from
// the list after we seek to the end.
// 4. Unsetting the media element's src attribute should remove all tracks.
const elemType = getMajorMimeType(test.type);
const element = document.createElement(elemType);
let audioOnaddtrack = 0;
let audioOnremovetrack = 0;
let videoOnaddtrack = 0;
let videoOnremovetrack = 0;
let isPlaying = false;
let steps = 0;
function testExpectedAddtrack(expectedCalls) {
if (test.hasAudio) {
is(audioOnaddtrack, expectedCalls, 'Calls of onaddtrack on audioTracks should be '+expectedCalls+' times.');
}
if (test.hasVideo) {
is(videoOnaddtrack, expectedCalls, 'Calls of onaddtrack on videoTracks should be '+expectedCalls+' times.');
}
}
function testExpectedRemovetrack(expectedCalls) {
if (test.hasAudio) {
is(audioOnremovetrack, expectedCalls, 'Calls of onremovetrack on audioTracks should be '+expectedCalls+' times.');
}
if (test.hasVideo) {
is(videoOnremovetrack, expectedCalls, 'Calls of onremovetrack on videoTracks should be '+expectedCalls+' times.');
}
}
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.