mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-13 15:46:46 +03:00
fix: Fix getOrInsertComputed is not available at the init, so not used at the init (#10202)
getOrInsertComputed is not available at init, until polyfills are used, but the problem that this PR fixes is that there is a call that uses it before calling the polyfill.
This commit is contained in:
committed by
GitHub
parent
0f8f2edea2
commit
1c63e75557
@@ -81,7 +81,10 @@ shaka.metadata.Metadata = class {
|
||||
*/
|
||||
static registerParserByMime(mimeType, parserFactory) {
|
||||
const map = shaka.metadata.Metadata.parsersByMime_;
|
||||
map.getOrInsertComputed(mimeType, () => []).push(parserFactory);
|
||||
if (!map.has(mimeType)) {
|
||||
map.set(mimeType, []);
|
||||
}
|
||||
map.get(mimeType).push(parserFactory);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user