@phenixrts/bitmovin-plugin 2024.2.1-beta.42 → 2024.2.1-beta.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/phenix-sdk-api/package.json +1 -1
- package/packages/phenix-sdk-api/phenix-sdk-api.package.js +16 -3
- package/packages/phenix-sdk-api/phenix-sdk-api.package.js.map +1 -1
- package/packages/phenix-sdk-plugin/package.json +1 -1
- package/packages/types/PhenixSdkApi.package.d.ts +4 -1
package/package.json
CHANGED
|
@@ -39,17 +39,29 @@ const playerx_framework_utils_1 = __webpack_require__(173);
|
|
|
39
39
|
const PhenixSdkStateAtom_1 = __webpack_require__(463);
|
|
40
40
|
exports.PhenixSdkApi = (0, playerx_framework_utils_1.createPackage)('phenix-sdk-api-package', (apiManager, baseContext) => {
|
|
41
41
|
const { StateEffectFactory, StoreEffectFactory, EventListenerEffectFactory } = baseContext.registry.get('core-effects');
|
|
42
|
-
const videoElement = apiManager.api.getVideoElement();
|
|
43
42
|
const contextWithState = baseContext.using(StateEffectFactory).using(EventListenerEffectFactory);
|
|
44
43
|
const phenixSdkState = (0, PhenixSdkStateAtom_1.createPhenixSdkStateAtom)(contextWithState);
|
|
45
44
|
const contextWithPlaybackState = contextWithState
|
|
46
45
|
.using(StoreEffectFactory('phenixSdkState', phenixSdkState))
|
|
47
46
|
.using(EventListenerEffectFactory);
|
|
47
|
+
let videoElement = undefined;
|
|
48
48
|
contextWithState.registry.set(PhenixSdkStateAtom_1.PhenixSdkNameAtom, phenixSdkState);
|
|
49
|
+
if (apiManager.api.getVideoElement) { // DEPRECATED -- to be removed in part 2
|
|
50
|
+
videoElement = apiManager.api.getVideoElement();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
apiManager.api.events.on('video-attached', (event) => {
|
|
54
|
+
videoElement = event.videoElement;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
49
57
|
const { state } = contextWithPlaybackState.effects;
|
|
50
|
-
let channel;
|
|
58
|
+
let channel = undefined;
|
|
51
59
|
const api = {
|
|
52
60
|
createChannel: (token) => {
|
|
61
|
+
if (!videoElement) {
|
|
62
|
+
console.log('Error: PlayerWebX VideoElement not attached before calling phenixrts.createChannel()');
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
53
65
|
channel = sdk_1.default.Channels.createChannel({
|
|
54
66
|
videoElement,
|
|
55
67
|
token
|
|
@@ -64,9 +76,10 @@ exports.PhenixSdkApi = (0, playerx_framework_utils_1.createPackage)('phenix-sdk-
|
|
|
64
76
|
},
|
|
65
77
|
disposeChannel: () => {
|
|
66
78
|
if (channel) {
|
|
67
|
-
state.dispatch(phenixSdkState.set, false);
|
|
68
79
|
channel.dispose();
|
|
80
|
+
channel = undefined;
|
|
69
81
|
}
|
|
82
|
+
state.dispatch(phenixSdkState.set, false);
|
|
70
83
|
}
|
|
71
84
|
};
|
|
72
85
|
apiManager.set('phenixrts', api);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phenix-sdk-api/phenix-sdk-api.package.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,iEAAiE;AAC5G,CAAC;AACD,O;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAiD,oBAAoB,CAA0N,CAAC,iBAAiB,aAAa,OAAO,YAAY,sCAAsC,SAAS,+BAA+B,aAAa,wBAAwB,YAAY,kBAAkB,UAAU,kBAAkB,wBAAwB,sCAAsC,SAAS,2CAA2C,aAAa,gBAAgB,UAAU,mBAAmB,cAAc,eAAe,mBAAmB,eAAe,cAAc,MAAM,+CAA+C,sCAAsC,SAAS,8GAA8G,MAAM,cAAc,WAAW,+BAA+B,YAAY,YAAY,qCAAqC,SAAS,YAAY,QAAQ,sCAAsC,SAAS,gFAAgF,aAAa,+CAA+C,6BAA6B,8BAA8B,EAAE,YAAY,yCAAyC,6BAA6B,wBAAwB,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GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEzB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,cAAc,EAAE,GAAG,EAAE;YACnB,IAAI,OAAO,EAAE,CAAC;gBACZ,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBAE1C,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,CAAC;QACH,CAAC;KACF,CAAC;IAEF,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAEjC,OAAO;AACT,CAAC,EACD,CAAC,cAAc,CAAC,CACjB,CAAC;AAEF,qBAAe,oBAAY,CAAC;;;;;;;;;;;;ACjE5B,4DAUC;AAdY,yBAAiB,GAAG,kBAAkB,CAAC;AAIpD,SAAgB,wBAAwB,CAAC,OAAyB;IAChE,MAAM,YAAY,GAAoB,EAAC,YAAY,EAAE,KAAK,EAAC,CAAC;IAE5D,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE;QAChD,GAAG,EAAE,CAAC,KAAsB,EAAE,YAAqB,EAAE,EAAE;YACrD,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;YAElC,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC;;;;;;;;;ACvBD;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://bitmovin.playerx/webpack/universalModuleDefinition","webpack://bitmovin.playerx/./node_modules/@bitmovin/player-web-x/playerx-framework-utils.js","webpack://bitmovin.playerx/./src/phenix-bitmovin-plugin/PhenixSdkApi.package.ts","webpack://bitmovin.playerx/./src/phenix-bitmovin-plugin/PhenixSdkStateAtom.ts","webpack://bitmovin.playerx/external umd \"@phenixrts/sdk\"","webpack://bitmovin.playerx/webpack/bootstrap","webpack://bitmovin.playerx/webpack/before-startup","webpack://bitmovin.playerx/webpack/startup","webpack://bitmovin.playerx/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@phenixrts/sdk\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@phenixrts/sdk\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"phenix-sdk-api\"] = factory(require(\"@phenixrts/sdk\"));\n\telse\n\t\troot[\"bitmovin\"] = root[\"bitmovin\"] || {}, root[\"bitmovin\"][\"playerx\"] = root[\"bitmovin\"][\"playerx\"] || {}, root[\"bitmovin\"][\"playerx\"][\"phenix-sdk-api\"] = factory(root[\"@phenixrts/sdk\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__318__) => {\nreturn ","/*******************************************************************************\n * This source code is the proprietary property of Bitmovin, Inc. Unauthorized\n * copying, distribution, or use of this code, or any portion thereof, is\n * strictly prohibited. © 2024 Bitmovin, Inc. All rights reserved. This\n * source code is subject to the terms and conditions of the accompanying\n * license agreement.\n *\n * Bitmovin Player X Version 10.1.2\n *******************************************************************************/\n!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports[\"framework-utils\"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.playerx=e.bitmovin.playerx||{},e.bitmovin.playerx[\"framework-utils\"]=t())}(self,(()=>(()=>{\"use strict\";var e={281:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:!0}),t.createEffectFactory=void 0;const r=e=>e;t.createEffectFactory=r},85:(e,t)=>{function r(e,t,r){const a=t;return a._name=e,{onAdd:a,dependencies:r}}Object.defineProperty(t,\"__esModule\",{value:!0}),t.createPackage=void 0,t.createPackage=r},270:(e,t)=>{function r(e,t){const r=t;return r._name=e,r}function a(e){return(...t)=>{const[a,o]=e(...t);return r(a,o)}}function o(e){var t;return null!==(t=e._name)&&void 0!==t?t:e.name}Object.defineProperty(t,\"__esModule\",{value:!0}),t.getTaskName=t.createTaskClosure=t.createTask=void 0,t.createTask=r,t.createTaskClosure=a,t.getTaskName=o}},t={};function r(a){var o=t[a];if(void 0!==o)return o.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,r),n.exports}var a={};return(()=>{var e=a;Object.defineProperty(e,\"__esModule\",{value:!0}),e.createTaskClosure=e.createTask=e.createPackage=e.createEffectFactory=void 0;var t=r(281);Object.defineProperty(e,\"createEffectFactory\",{enumerable:!0,get:function(){return t.createEffectFactory}});var o=r(85);Object.defineProperty(e,\"createPackage\",{enumerable:!0,get:function(){return o.createPackage}});var n=r(270);Object.defineProperty(e,\"createTask\",{enumerable:!0,get:function(){return n.createTask}}),Object.defineProperty(e,\"createTaskClosure\",{enumerable:!0,get:function(){return n.createTaskClosure}})})(),a})()));","/**\n * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.\n */\nimport type {CoreEffects} from '@bitmovin/player-web-x/types/framework/core/core/Core.package';\nimport type {ComponentName} from '@bitmovin/player-web-x/types/framework/Types';\nimport type Channel from '@phenixrts/sdk/types/sdk/channels/Channel';\nimport type {PhenixSdkStateAtom} from './PhenixSdkStateAtom';\nimport phenix from '@phenixrts/sdk';\nimport {createPackage} from '@bitmovin/player-web-x/playerx-framework-utils';\nimport {createPhenixSdkStateAtom, PhenixSdkNameAtom} from './PhenixSdkStateAtom';\n\ntype Dependencies = {\n [ComponentName.CoreEffects]: CoreEffects;\n};\n\ntype Exports = {\n [PhenixSdkNameAtom]: PhenixSdkStateAtom;\n};\n\ntype Api = {\n getVideoElement: () => HTMLVideoElement;\n phenixrts: IPhenixApi;\n};\n\nexport interface IPhenixApi {\n createChannel: (token: string) => Channel;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n initSDK: (options: { [key: string]: any }) => void;\n disposeChannel: () => void;\n}\n\nexport const PhenixSdkApi = createPackage<Dependencies, Exports, Api>(\n 'phenix-sdk-api-package',\n (apiManager, baseContext) => {\n const {StateEffectFactory, StoreEffectFactory, EventListenerEffectFactory} = baseContext.registry.get('core-effects');\n const videoElement = apiManager.api.getVideoElement();\n const contextWithState = baseContext.using(StateEffectFactory).using(EventListenerEffectFactory);\n const phenixSdkState = createPhenixSdkStateAtom(contextWithState);\n const contextWithPlaybackState = contextWithState\n .using(StoreEffectFactory('phenixSdkState', phenixSdkState))\n .using(EventListenerEffectFactory);\n\n contextWithState.registry.set(PhenixSdkNameAtom, phenixSdkState);\n\n const {state} = contextWithPlaybackState.effects;\n let channel: Channel;\n const api: IPhenixApi = {\n createChannel: (token: string) => {\n channel = phenix.Channels.createChannel({\n videoElement,\n token\n });\n state.dispatch(phenixSdkState.set, true);\n\n return channel;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n initSDK: (options: { [key: string]: any }) => {\n phenix.SDK.init(options);\n\n return null;\n },\n disposeChannel: () => {\n if (channel) {\n state.dispatch(phenixSdkState.set, false);\n\n channel.dispose();\n }\n }\n };\n\n apiManager.set('phenixrts', api);\n\n return;\n },\n ['core-effects'],\n);\n\nexport default PhenixSdkApi;","/**\n * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.\n */\nimport type {ContextWithState} from '@bitmovin/player-web-x/types/framework/core/Types';\n\ninterface IPhenixSdkState {\n isSdkRunning: boolean;\n}\n\nexport const PhenixSdkNameAtom = 'phenix-sdk-state';\n\nexport type PhenixSdkStateAtom = ReturnType<typeof createPhenixSdkStateAtom>;\n\nexport function createPhenixSdkStateAtom(context: ContextWithState) {\n const initialState: IPhenixSdkState = {isSdkRunning: false};\n\n return context.effects.state.create(initialState, {\n set: (state: IPhenixSdkState, isSdkRunning: boolean) => {\n state.isSdkRunning = isSdkRunning;\n\n return true;\n }\n });\n}","module.exports = __WEBPACK_EXTERNAL_MODULE__318__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(593);\n",""],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"phenix-sdk-api/phenix-sdk-api.package.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,iEAAiE;AAC5G,CAAC;AACD,O;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAiD,oBAAoB,CAA0N,CAAC,iBAAiB,aAAa,OAAO,YAAY,sCAAsC,SAAS,+BAA+B,aAAa,wBAAwB,YAAY,kBAAkB,UAAU,kBAAkB,wBAAwB,sCAAsC,SAAS,2CAA2C,aAAa,gBAAgB,UAAU,mBAAmB,cAAc,eAAe,mBAAmB,eAAe,cAAc,MAAM,+CAA+C,sCAAsC,SAAS,8GAA8G,MAAM,cAAc,WAAW,+BAA+B,YAAY,YAAY,qCAAqC,SAAS,YAAY,QAAQ,sCAAsC,SAAS,gFAAgF,aAAa,+CAA+C,6BAA6B,8BAA8B,EAAE,YAAY,yCAAyC,6BAA6B,wBAAwB,EAAE,aAAa,sCAAsC,6BAA6B,qBAAqB,+CAA+C,6BAA6B,4BAA4B,EAAE,MAAM;;;;;;;;;;;ACCzqD,uCAAoC;AACpC,2DAA6E;AAC7E,sDAAiF;AAuBpE,oBAAY,GAAG,2CAAa,EACvC,wBAAwB,EACxB,C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;;;UEtBA;UACA;UACA;UACA","sources":["webpack://bitmovin.playerx/webpack/universalModuleDefinition","webpack://bitmovin.playerx/./node_modules/@bitmovin/player-web-x/playerx-framework-utils.js","webpack://bitmovin.playerx/./src/phenix-bitmovin-plugin/PhenixSdkApi.package.ts","webpack://bitmovin.playerx/./src/phenix-bitmovin-plugin/PhenixSdkStateAtom.ts","webpack://bitmovin.playerx/external umd \"@phenixrts/sdk\"","webpack://bitmovin.playerx/webpack/bootstrap","webpack://bitmovin.playerx/webpack/before-startup","webpack://bitmovin.playerx/webpack/startup","webpack://bitmovin.playerx/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@phenixrts/sdk\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@phenixrts/sdk\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"phenix-sdk-api\"] = factory(require(\"@phenixrts/sdk\"));\n\telse\n\t\troot[\"bitmovin\"] = root[\"bitmovin\"] || {}, root[\"bitmovin\"][\"playerx\"] = root[\"bitmovin\"][\"playerx\"] || {}, root[\"bitmovin\"][\"playerx\"][\"phenix-sdk-api\"] = factory(root[\"@phenixrts/sdk\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__318__) => {\nreturn ","/*******************************************************************************\n * This source code is the proprietary property of Bitmovin, Inc. Unauthorized\n * copying, distribution, or use of this code, or any portion thereof, is\n * strictly prohibited. © 2024 Bitmovin, Inc. All rights reserved. This\n * source code is subject to the terms and conditions of the accompanying\n * license agreement.\n *\n * Bitmovin Player X Version 10.1.2\n *******************************************************************************/\n!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports[\"framework-utils\"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.playerx=e.bitmovin.playerx||{},e.bitmovin.playerx[\"framework-utils\"]=t())}(self,(()=>(()=>{\"use strict\";var e={281:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:!0}),t.createEffectFactory=void 0;const r=e=>e;t.createEffectFactory=r},85:(e,t)=>{function r(e,t,r){const a=t;return a._name=e,{onAdd:a,dependencies:r}}Object.defineProperty(t,\"__esModule\",{value:!0}),t.createPackage=void 0,t.createPackage=r},270:(e,t)=>{function r(e,t){const r=t;return r._name=e,r}function a(e){return(...t)=>{const[a,o]=e(...t);return r(a,o)}}function o(e){var t;return null!==(t=e._name)&&void 0!==t?t:e.name}Object.defineProperty(t,\"__esModule\",{value:!0}),t.getTaskName=t.createTaskClosure=t.createTask=void 0,t.createTask=r,t.createTaskClosure=a,t.getTaskName=o}},t={};function r(a){var o=t[a];if(void 0!==o)return o.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,r),n.exports}var a={};return(()=>{var e=a;Object.defineProperty(e,\"__esModule\",{value:!0}),e.createTaskClosure=e.createTask=e.createPackage=e.createEffectFactory=void 0;var t=r(281);Object.defineProperty(e,\"createEffectFactory\",{enumerable:!0,get:function(){return t.createEffectFactory}});var o=r(85);Object.defineProperty(e,\"createPackage\",{enumerable:!0,get:function(){return o.createPackage}});var n=r(270);Object.defineProperty(e,\"createTask\",{enumerable:!0,get:function(){return n.createTask}}),Object.defineProperty(e,\"createTaskClosure\",{enumerable:!0,get:function(){return n.createTaskClosure}})})(),a})()));","/**\n * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.\n */\nimport type {CoreEffects} from '@bitmovin/player-web-x/types/framework/core/core/Core.package';\nimport type {ComponentName} from '@bitmovin/player-web-x/types/framework/Types';\nimport type {EventBus} from '@bitmovin/player-web-x/types/packages/event-bus/Types';\nimport type {PlayerEventMap} from '@bitmovin/player-web-x/types/packages/player-api/Types';\nimport type {VideoAttachedEvent} from '@bitmovin/player-web-x/types/packages/sources-api/Types';\nimport type Channel from '@phenixrts/sdk/types/sdk/channels/Channel';\nimport type {PhenixSdkStateAtom} from './PhenixSdkStateAtom';\nimport phenix from '@phenixrts/sdk';\nimport {createPackage} from '@bitmovin/player-web-x/playerx-framework-utils';\nimport {createPhenixSdkStateAtom, PhenixSdkNameAtom} from './PhenixSdkStateAtom';\n\ntype Dependencies = {\n [ComponentName.CoreEffects]: CoreEffects;\n};\n\ntype Exports = {\n [PhenixSdkNameAtom]: PhenixSdkStateAtom;\n};\n\ntype Api = {\n events: EventBus<PlayerEventMap>;\n getVideoElement: () => HTMLVideoElement; // DEPRECATED -- to be removed in part 2\n phenixrts: IPhenixApi;\n};\n\nexport interface IPhenixApi {\n createChannel: (token: string) => Channel | undefined;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n initSDK: (options: { [key: string]: any }) => void;\n disposeChannel: () => void;\n}\n\nexport const PhenixSdkApi = createPackage<Dependencies, Exports, Api>(\n 'phenix-sdk-api-package',\n (apiManager, baseContext) => {\n const {StateEffectFactory, StoreEffectFactory, EventListenerEffectFactory} = baseContext.registry.get('core-effects');\n const contextWithState = baseContext.using(StateEffectFactory).using(EventListenerEffectFactory);\n const phenixSdkState = createPhenixSdkStateAtom(contextWithState);\n const contextWithPlaybackState = contextWithState\n .using(StoreEffectFactory('phenixSdkState', phenixSdkState))\n .using(EventListenerEffectFactory);\n let videoElement: HTMLVideoElement | undefined = undefined;\n\n contextWithState.registry.set(PhenixSdkNameAtom, phenixSdkState);\n\n if (apiManager.api.getVideoElement) { // DEPRECATED -- to be removed in part 2\n videoElement = apiManager.api.getVideoElement();\n } else {\n apiManager.api.events.on('video-attached', (event: VideoAttachedEvent) => {\n videoElement = event.videoElement;\n });\n }\n\n const {state} = contextWithPlaybackState.effects;\n let channel: Channel | undefined = undefined;\n const api: IPhenixApi = {\n createChannel: (token: string) => {\n if (!videoElement) {\n console.log('Error: PlayerWebX VideoElement not attached before calling phenixrts.createChannel()');\n\n return undefined;\n }\n\n channel = phenix.Channels.createChannel({\n videoElement,\n token\n });\n state.dispatch(phenixSdkState.set, true);\n\n return channel;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n initSDK: (options: { [key: string]: any }) => {\n phenix.SDK.init(options);\n\n return null;\n },\n disposeChannel: () => {\n if (channel) {\n channel.dispose();\n channel = undefined;\n }\n\n state.dispatch(phenixSdkState.set, false);\n }\n };\n\n apiManager.set('phenixrts', api);\n\n return;\n },\n ['core-effects'],\n);\n\nexport default PhenixSdkApi;","/**\n * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.\n */\nimport type {ContextWithState} from '@bitmovin/player-web-x/types/framework/core/Types';\n\ninterface IPhenixSdkState {\n isSdkRunning: boolean;\n}\n\nexport const PhenixSdkNameAtom = 'phenix-sdk-state';\n\nexport type PhenixSdkStateAtom = ReturnType<typeof createPhenixSdkStateAtom>;\n\nexport function createPhenixSdkStateAtom(context: ContextWithState) {\n const initialState: IPhenixSdkState = {isSdkRunning: false};\n\n return context.effects.state.create(initialState, {\n set: (state: IPhenixSdkState, isSdkRunning: boolean) => {\n state.isSdkRunning = isSdkRunning;\n\n return true;\n }\n });\n}","module.exports = __WEBPACK_EXTERNAL_MODULE__318__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(593);\n",""],"names":[],"sourceRoot":""}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { EventBus } from '@bitmovin/player-web-x/types/packages/event-bus/Types';
|
|
2
|
+
import type { PlayerEventMap } from '@bitmovin/player-web-x/types/packages/player-api/Types';
|
|
1
3
|
import type Channel from '@phenixrts/sdk/types/sdk/channels/Channel';
|
|
2
4
|
import type { PhenixSdkStateAtom } from './PhenixSdkStateAtom';
|
|
3
5
|
import { PhenixSdkNameAtom } from './PhenixSdkStateAtom';
|
|
@@ -6,11 +8,12 @@ type Exports = {
|
|
|
6
8
|
[PhenixSdkNameAtom]: PhenixSdkStateAtom;
|
|
7
9
|
};
|
|
8
10
|
type Api = {
|
|
11
|
+
events: EventBus<PlayerEventMap>;
|
|
9
12
|
getVideoElement: () => HTMLVideoElement;
|
|
10
13
|
phenixrts: IPhenixApi;
|
|
11
14
|
};
|
|
12
15
|
export interface IPhenixApi {
|
|
13
|
-
createChannel: (token: string) => Channel;
|
|
16
|
+
createChannel: (token: string) => Channel | undefined;
|
|
14
17
|
initSDK: (options: {
|
|
15
18
|
[key: string]: any;
|
|
16
19
|
}) => void;
|