Skip to content

Commit

Permalink
fix: Fix fetch plugin with old implementations (#5091)
Browse files Browse the repository at this point in the history
Fixes #5088
  • Loading branch information
avelad authored and joeyparrish committed Apr 26, 2023
1 parent 259f0f7 commit 18e3c51
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/net/http_fetch_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,16 @@ shaka.net.HttpFetchPlugin = class {
} else {
return false;
}
// Old fetch implementations hasn't body and ReadableStream implementation
// See: https://github.com/shaka-project/shaka-player/issues/5088
if (window.Response) {
const response = new Response('');
if (!response.body) {
return false;
}
} else {
return false;
}
return !!(window.fetch && window.AbortController);
}
};
Expand Down

0 comments on commit 18e3c51

Please sign in to comment.