私はMediaSourceを拡張したいと思います。私はバベルを使用しています。BabelでMediaSourceを拡張する - super()を正しく呼び出す方法?
Chromeでは直接動作します。バベルで行わtranspiledビルドでは、私は次のエラーを取得する:
Uncaught TypeError: Failed to construct 'MediaSource': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
これはGitHubの問題に似ているようだ:https://github.com/babel/babel/issues/1966私も次のパッケージを試してみましたが、私の特定の状況には適用されていないようです...違いはありません:
https://www.npmjs.com/package/babel-plugin-transform-custom-element-classesマイ.babelrc
:
{ "presets": [ "es2015" ] }
この問題を回避する方法はありますか?
[BabelでES6に組み込みのネイティブを拡張する](https://stackoverflow.com/questions/33832646/extending-built-in-natives-in-es6-with-babel) – estus