UNPKG

bitmovin-player-react-native

Version:

Official React Native bindings for Bitmovin's mobile Player SDKs.

50 lines (49 loc) 1.86 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const withBitmovinIosConfig_1 = __importDefault(require("./withBitmovinIosConfig")); const withBitmovinAndroidConfig_1 = __importDefault(require("./withBitmovinAndroidConfig")); const defaultFeatureFlags = { airPlay: false, backgroundPlayback: false, googleCastSDK: undefined, offline: false, pictureInPicture: false, }; /** * Expo Config Plugin for Bitmovin Player. * This plugin configures the Bitmovin Player for both iOS and Android platforms. * It accepts a player license key and feature flags to customize the player's behavior. * @param config - The Expo config object. * @param options - An object containing the player license key and feature flags. * @returns The modified Expo config object with Bitmovin Player configurations. * * @example * // app.config.js * module.exports = { * plugins: [ * [ * 'bitmovin-player-react-native', * { * playerLicenseKey: 'YOUR_BITMOVIN_PLAYER_LICENSE_KEY', * featureFlags: { * airPlay: true, * backgroundPlayback: true, * googleCastSDK: { android: '21.3.0', ios: '4.8.1.2' }, * offline: true, * pictureInPicture: true, * }, * }, * ] * ] * }; */ const withBitmovinConfig = (config, { playerLicenseKey, featureFlags }) => { const features = { ...defaultFeatureFlags, ...(featureFlags || {}) }; config = (0, withBitmovinIosConfig_1.default)(config, { playerLicenseKey, features }); config = (0, withBitmovinAndroidConfig_1.default)(config, { playerLicenseKey, features }); return config; }; exports.default = withBitmovinConfig;