Skip to content

Commit

Permalink
Merge pull request #3787 from papan01/master
Browse files Browse the repository at this point in the history
Direct set SearchParams on URL and remove sort.
  • Loading branch information
robwalch committed Apr 16, 2021
2 parents d57ec50 + 1de74a5 commit b3e9457
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/types/level.ts
Expand Up @@ -68,18 +68,15 @@ export class HlsUrlParameters {

addDirectives(uri: string): string | never {
const url: URL = new self.URL(uri);
const searchParams: URLSearchParams = url.searchParams;
if (this.msn !== undefined) {
searchParams.set('_HLS_msn', this.msn.toString());
url.searchParams.set('_HLS_msn', this.msn.toString());
}
if (this.part !== undefined) {
searchParams.set('_HLS_part', this.part.toString());
url.searchParams.set('_HLS_part', this.part.toString());
}
if (this.skip) {
searchParams.set('_HLS_skip', this.skip);
url.searchParams.set('_HLS_skip', this.skip);
}
searchParams.sort();
url.search = searchParams.toString();
return url.toString();
}
}
Expand Down

0 comments on commit b3e9457

Please sign in to comment.