UNPKG

react-native-theoplayer

Version:

A THEOplayer video component for react-native.

47 lines (45 loc) 1.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.withTHEOplayerIOS = void 0; var _withCustomPod = require("./withCustomPod"); const CAST_POD_LINE = ` pod 'react-native-google-cast', :git => 'https://github.com/Danesz/react-native-google-cast.git', branch: 'feature/guestmode_apple_silicon'`; function mapIOSExtensionKey(ext) { switch (ext) { case 'ima': return 'GOOGLE_IMA'; case 'cast': return 'CHROMECAST'; case 'theoads': return 'THEO_ADS'; case 'millicast': return 'MILLICAST'; case 'sideloaded-texttracks': return 'SIDELOADED_TEXTTRACKS'; default: return undefined; } } const applyIOSExtensions = (config, extensions) => { const iosFeatures = extensions?.map(mapIOSExtensionKey)?.filter(f => !!f); if (iosFeatures?.length ?? 0 > 0) { const featureList = iosFeatures?.join(','); console.log(`Setting THEO_FEATURES="${featureList}"`); process.env.THEO_FEATURES = featureList; } // Align react-native-google-cast dependency if (extensions?.includes('cast')) { config = (0, _withCustomPod.withCustomPod)(config, CAST_POD_LINE); } return config; }; const withTHEOplayerIOS = (config, props = {}) => { const { extensions, ios } = props; return applyIOSExtensions(config, ios?.extensions ?? extensions); }; exports.withTHEOplayerIOS = withTHEOplayerIOS; //# sourceMappingURL=withTHEOplayerIOS.js.map