How to import player modules?
When doing imports to build the player (eg: in a typescript project), it's crucial to avoid mixing imports from the monolith and core module. This is not correctly tree-shakable with any basic/standard configuration, thus likely to yield unexpected behaviors, so it's an unsupported scenario. Hence, all imports should be done either from monolith or from core module, but should never be mixed. Both cannot be present one the code at the same time.
Example of wrong imports causing unexpected behaviors:
// monolith or module first - order does not matter
import {Player} from 'bitmovin-player/modules/bitmovinplayer-core';
import { ViewMode } from 'bitmovin-player';
import EngineBitmovinModule from 'bitmovin-player/modules/bitmovinplayer-engine-bitmovin';
import MseRendererModule from 'bitmovin-player/modules/bitmovinplayer-mserenderer';
Example of correct imports using monolith approach:
import {Player, ViewMode} from 'bitmovin-player';
import EngineBitmovinModule from 'bitmovin-player/modules/bitmovinplayer-engine-bitmovin';
import MseRendererModule from 'bitmovin-player/modules/bitmovinplayer-mserenderer';
Example of correct imports using core module approach:
import {Player, ViewMode} from 'bitmovin-player/modules/bitmovinplayer-core';
import EngineBitmovinModule from 'bitmovin-player/modules/bitmovinplayer-engine-bitmovin';
import MseRendererModule from 'bitmovin-player/modules/bitmovinplayer-mserenderer';
Updated 3 months ago