404 Не найдено сообщение в hls (HTTP Live Streaming)

Я использую следующие фрагменты кода в моей базе кода в моем файле hls.js.

  loadInternal () {
    let xhr, context = this.context;
    xhr = this.loader = new XMLHttpRequest();

    let stats = this.stats;
    stats.tfirst = 0;
    stats.loaded = 0;
    const xhrSetup = this.xhrSetup;

    try {
      if (xhrSetup) {
        try {
          xhrSetup(xhr, context.url);
        } catch (e) {
          // fix xhrSetup: (xhr, url) => {xhr.setRequestHeader("Content-Language", "test");}
          // not working, as xhr.setRequestHeader expects xhr.readyState === OPEN
          xhr.open('GET', context.url, true);
          xhrSetup(xhr, context.url);
        }
      }
      if (!xhr.readyState) {
        xhr.open('GET', context.url, true);    // context.url returns ../_definst_/u7sdeqg19d32m6jv2uoj20bgn3/77361a840b3487468ad276adc99b47d974e47a7a/chunklist_w121969216.m3u8

      }
    } catch (e) {
      // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS
      this.callbacks.onError({ code: xhr.status, text: e.message }, context, xhr);
      return;
    }

    if (context.rangeEnd) {
      xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));
    }

    xhr.onreadystatechange = this.readystatechange.bind(this);
    xhr.onprogress = this.loadprogress.bind(this);
    xhr.responseType = context.responseType;

    // setup timeout before we perform request
    this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), this.config.timeout);
    xhr.send();  // This line is throwing GET 404 Not found 
  }

Вышеуказанные фрагменты кода также присутствуют в следующей ссылке. В этой ссылке я использовал большую часть кода в моем файле hls.js.


Постановка задачи:

Мне интересно, каковы причины error 404 Not found в строке xhr.send().

Сообщение об ошибке:

На линии xhr.send() как упоминалось в заявлении о проблеме, я получаю сообщение об ошибке GET 404, не найденное на консоли, с оставленной на нем ссылкой context.url (как показано ниже).

context.url возвращает, ../_definst_/u7sdeqg19d32m6jv2uoj20bgn3/77361a840b3487468ad276adc99b47d974e47a7a/chunklist_w121969216.m3u8

0 ответов

Другие вопросы по тегам