5

Question:

I'm struggling with adding query params to urls. I want to add ?md5=<string>&expires=<number> for each request url (m3u8, ts). I heard fetchSetup would be useful but I didn't see any examples, does anyone know how to solve this problem?

I already tried this but nothing happened:

const hlsConfig = {
  fetchSetup: (context, initParams) => {
    initParams.credentials = 'include';
    return new Request(
      context.url + '?md5=test123&expires=test123', 
      initParams
    );
  }
}

Related issues on Github: #2152, #2142.

Same question with video.js: Appending paramaters to each m3u8 and ts file while playing live stream

Arthur
  • 3,056
  • 7
  • 31
  • 61

1 Answers1

1

We've solved it by modifying window.XMLHttpRequest.prototype.open to update url. May be something related to xhrSetup (which was given a try but didn't spend much time).

Charan Kumar
  • 553
  • 2
  • 13