author Jean-Yves Avenard <>
Fri, 28 Apr 2017 16:18:36 +0200
changeset 361278 bc1e56d5cb9ba2d563981973573cf3b10fc0abdb
parent 361277 c89c6c8630f132296b2e2edbba4239a8ad7a1075
child 418719 abc9351a9c159afb31d58fc29beda855ad4f832b
permissions -rw-r--r--
Bug 1362165: P3. Remove unecessary code. r=gerald We have no need to call endOfStream here as we don't rely on the ended event being fired. Also, there's no need to track how many update count we will get when we only use appendBuffer once. Adding extra test to help identify where the actual failure of the test could occur. MozReview-Commit-ID: HIu1XQpHark

  <title>MSE: seeking in buffered range</title>
  <script type="text/javascript" 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" />
<pre id="test">
<script class="testbody" type="text/javascript">


runWithMSE(function (ms, v) {
  ms.addEventListener("sourceopen", function () {
    var sb = ms.addSourceBuffer("video/webm");

    fetchWithXHR("seek.webm", function (arrayBuffer) {
      sb.appendBuffer(new Uint8Array(arrayBuffer));

    var target = 2;

    v.addEventListener("loadedmetadata", function () {
      ok(true, "received loadedmetadata");
      v.currentTime = target;

    var wasSeeking = false;

    v.addEventListener("seeking", function () {
      wasSeeking = true;
      is(v.currentTime, target, "Video currentTime at target");

    v.addEventListener("seeked", function () {
      ok(wasSeeking, "Received expected seeking and seeked events");
      is(v.currentTime, target, "Video currentTime at target");