Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fetchSetup config support promise #6714

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

zce
Copy link
Contributor

@zce zce commented Sep 23, 2024

This PR will...

  • support promise in fetchSetup config
const hls = new Hls({
  progressive: true,
  async fetchSetup (ctx, init) {
    const signature = await sign(ctx.url)
    init.headers = { ...init.headers, 'x-signature': signature }
    return new Request(ctx.url, init)
  }
})

Why is this Pull Request needed?

This will be more friendly to users using progressive mode.
Currently only xhrSetup supports promises

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

src/utils/fetch-loader.ts Outdated Show resolved Hide resolved
src/utils/fetch-loader.ts Outdated Show resolved Hide resolved
@zce zce requested a review from robwalch October 4, 2024 08:22
@robwalch robwalch added this to the 1.6.0 milestone Oct 5, 2024
@robwalch robwalch merged commit 65d6b1f into video-dev:master Oct 7, 2024
12 checks passed
@zce zce deleted the feat-fetch-setup-promise-support branch October 8, 2024 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants