@phenixrts/bitmovin-plugin 2024.0.0-beta.2
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/LICENSE.md +1 -0
- package/README.md +49 -0
- package/package.json +21 -0
- package/packages/phenix-sdk-api/package.json +11 -0
- package/packages/phenix-sdk-api/phenix-sdk-api.package.js +147 -0
- package/packages/phenix-sdk-api/phenix-sdk-api.package.js.map +1 -0
- package/packages/phenix-sdk-plugin/package.json +11 -0
- package/packages/phenix-sdk-plugin/phenix-sdk-plugin.package.js +125 -0
- package/packages/phenix-sdk-plugin/phenix-sdk-plugin.package.js.map +1 -0
- package/packages/types/PhenixSdkApi.package.d.ts +27 -0
- package/packages/types/PhenixSdkPlugin.package.d.ts +22 -0
- package/packages/types/PhenixSdkStateAtom.d.ts +13 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
|
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Phenix RTS SDK Bitmovin plugin
|
|
2
|
+
This project demonstrates the integration of the popular web video player [Bitmovin](https://bitmovin.com) with the [PhenixRTS SDK](https://www.npmjs.com/package/@phenixrts/sdk).
|
|
3
|
+
|
|
4
|
+
## Setup
|
|
5
|
+
1. Install the Bitmovin web-x player
|
|
6
|
+
```bash
|
|
7
|
+
npm i @bitmovin/player-web-x
|
|
8
|
+
```
|
|
9
|
+
2. Install the Phenix RTS SDK Bitmovin plugin
|
|
10
|
+
```bash
|
|
11
|
+
npm i @phenixrts/bitmovin-plugin
|
|
12
|
+
```
|
|
13
|
+
3. Install the Phenix RTS SDK
|
|
14
|
+
```bash
|
|
15
|
+
npm i @phenixrts/sdk
|
|
16
|
+
```
|
|
17
|
+
4. Initialize the web-x player with the Phenix RTS SDK Bitmovin plugin
|
|
18
|
+
```JavaScript
|
|
19
|
+
import { Player } from '@bitmovin/player-web-x/bundles/playerx-core';
|
|
20
|
+
...
|
|
21
|
+
import { PhenixSdkApi } from '@phenixrts/bitmovin-plugin';
|
|
22
|
+
import { PhenixSdkPlugin } from '@phenixrts/bitmovin-plugin/dist/phenix-sdk-plugin';
|
|
23
|
+
...
|
|
24
|
+
const player = Player({
|
|
25
|
+
key: <bitmovin_key>,
|
|
26
|
+
ui: false
|
|
27
|
+
});
|
|
28
|
+
player.packages.add(PhenixSdkApi);
|
|
29
|
+
player.packages.add(PhenixSdkPlugin);
|
|
30
|
+
...
|
|
31
|
+
const channel = player.phenixrts.createChannel(<token>)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Run the example
|
|
35
|
+
1. Publish a stream via [Phenix RTS Portal](https://www.phenixrts.com/portal/).
|
|
36
|
+
2. Make sure you are in the `examples` folder and run:
|
|
37
|
+
```bash
|
|
38
|
+
npm install
|
|
39
|
+
```
|
|
40
|
+
3. Start the example with:
|
|
41
|
+
```bash
|
|
42
|
+
npm run start
|
|
43
|
+
```
|
|
44
|
+
4. Create a viewing token using the [Phenix RTS Portal](https://www.phenixrts.com/portal/).
|
|
45
|
+
- Go to Channels
|
|
46
|
+
- Select the channel in which the stream was published
|
|
47
|
+
- Go to the EdgeAuth tab
|
|
48
|
+
- Copy the viewing token
|
|
49
|
+
5. Open the locally served URL and at the end add a 'token' query parameter and the previously generated token: `http://127.0.0.1:5173/phenixrts-sdk-plugin-for-real-time.html?token=<viewToken>`.
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@phenixrts/bitmovin-plugin",
|
|
3
|
+
"version": "2024.0.0-beta.2",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"author": "Phenix Real Time Solutions, Inc.",
|
|
8
|
+
"description": "Phenix Real Time Solutions Bitmovin plugin",
|
|
9
|
+
"files": [
|
|
10
|
+
"packages"
|
|
11
|
+
],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=16"
|
|
14
|
+
},
|
|
15
|
+
"main": "packages/phenix-sdk-api/phenix-sdk-api.package.js",
|
|
16
|
+
"types": "packages/types/sdk/channels/index.d.ts",
|
|
17
|
+
"license": "See in LICENSE file",
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@phenixrts/sdk": "^2023.2.22"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@phenixrts/bitmovin-plugin/phenix-sdk-api",
|
|
3
|
+
"version": "2024.0.0-beta.2",
|
|
4
|
+
"files": [
|
|
5
|
+
"*"
|
|
6
|
+
],
|
|
7
|
+
"author": "Phenix Real Time Solutions, Inc.",
|
|
8
|
+
"license": "See in LICENSE file",
|
|
9
|
+
"main": "./phenix-sdk-api.package.js",
|
|
10
|
+
"types": "../types/PhenixSdkApi.package.d.ts"
|
|
11
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("@phenixrts/sdk"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define(["@phenixrts/sdk"], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["phenix-sdk-api"] = factory(require("@phenixrts/sdk"));
|
|
8
|
+
else
|
|
9
|
+
root["bitmovin"] = root["bitmovin"] || {}, root["bitmovin"]["playerx"] = root["bitmovin"]["playerx"] || {}, root["bitmovin"]["playerx"]["phenix-sdk-api"] = factory(root["@phenixrts/sdk"]);
|
|
10
|
+
})(self, (__WEBPACK_EXTERNAL_MODULE__48__) => {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ var __webpack_modules__ = ({
|
|
13
|
+
|
|
14
|
+
/***/ 497:
|
|
15
|
+
/***/ ((module) => {
|
|
16
|
+
|
|
17
|
+
/*******************************************************************************
|
|
18
|
+
* This source code is the proprietary property of Bitmovin, Inc. Unauthorized
|
|
19
|
+
* copying, distribution, or use of this code, or any portion thereof, is
|
|
20
|
+
* strictly prohibited. © 2023 Bitmovin, Inc. All rights reserved. This
|
|
21
|
+
* source code is subject to the terms and conditions of the accompanying
|
|
22
|
+
* license agreement.
|
|
23
|
+
*
|
|
24
|
+
* Bitmovin Player X Version 10.0.0-beta.12
|
|
25
|
+
*******************************************************************************/
|
|
26
|
+
!function(e,t){ true?module.exports=t():0}(self,(()=>(()=>{"use strict";var e={508:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createEffectFactory=void 0;const r=e=>e;t.createEffectFactory=r},898:(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},465:(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)}}Object.defineProperty(t,"__esModule",{value:!0}),t.createTaskClosure=t.createTask=void 0,t.createTask=r,t.createTaskClosure=a}},t={};function r(a){var o=t[a];if(void 0!==o)return o.exports;var c=t[a]={exports:{}};return e[a](c,c.exports,r),c.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(508);Object.defineProperty(e,"createEffectFactory",{enumerable:!0,get:function(){return t.createEffectFactory}});var o=r(898);Object.defineProperty(e,"createPackage",{enumerable:!0,get:function(){return o.createPackage}});var c=r(465);Object.defineProperty(e,"createTask",{enumerable:!0,get:function(){return c.createTask}}),Object.defineProperty(e,"createTaskClosure",{enumerable:!0,get:function(){return c.createTaskClosure}})})(),a})()));
|
|
27
|
+
|
|
28
|
+
/***/ }),
|
|
29
|
+
|
|
30
|
+
/***/ 91:
|
|
31
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
32
|
+
|
|
33
|
+
"use strict";
|
|
34
|
+
|
|
35
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
36
|
+
exports.PhenixSdkApi = void 0;
|
|
37
|
+
const sdk_1 = __webpack_require__(48);
|
|
38
|
+
const playerx_framework_utils_1 = __webpack_require__(497);
|
|
39
|
+
const PhenixSdkStateAtom_1 = __webpack_require__(865);
|
|
40
|
+
exports.PhenixSdkApi = (0, playerx_framework_utils_1.createPackage)('phenix-sdk-api-package', (apiManager, baseContext) => {
|
|
41
|
+
const { StateEffectFactory, StoreEffectFactory, EventListenerEffectFactory } = baseContext.registry.get('core-effects');
|
|
42
|
+
const videoElement = apiManager.api.getVideoElement();
|
|
43
|
+
const contextWithState = baseContext.using(StateEffectFactory).using(EventListenerEffectFactory);
|
|
44
|
+
const phenixSdkState = (0, PhenixSdkStateAtom_1.createPhenixSdkStateAtom)(contextWithState);
|
|
45
|
+
const contextWithPlaybackState = contextWithState
|
|
46
|
+
.using(StoreEffectFactory('phenixSdkState', phenixSdkState))
|
|
47
|
+
.using(EventListenerEffectFactory);
|
|
48
|
+
contextWithState.registry.set(PhenixSdkStateAtom_1.PhenixSdkNameAtom, phenixSdkState);
|
|
49
|
+
const { state } = contextWithPlaybackState.effects;
|
|
50
|
+
let channel;
|
|
51
|
+
const api = {
|
|
52
|
+
createChannel: (token) => {
|
|
53
|
+
channel = sdk_1.default.Channels.createChannel({
|
|
54
|
+
videoElement,
|
|
55
|
+
token
|
|
56
|
+
});
|
|
57
|
+
state.dispatch(phenixSdkState.set, true);
|
|
58
|
+
return channel;
|
|
59
|
+
},
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
61
|
+
initSDK: (options) => {
|
|
62
|
+
sdk_1.default.SDK.init(options);
|
|
63
|
+
return null;
|
|
64
|
+
},
|
|
65
|
+
disposeChannel: () => {
|
|
66
|
+
if (channel) {
|
|
67
|
+
state.dispatch(phenixSdkState.set, false);
|
|
68
|
+
channel.dispose();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
apiManager.set('phenixrts', api);
|
|
73
|
+
return;
|
|
74
|
+
}, ['core-effects']);
|
|
75
|
+
exports["default"] = exports.PhenixSdkApi;
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
/***/ }),
|
|
79
|
+
|
|
80
|
+
/***/ 865:
|
|
81
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
82
|
+
|
|
83
|
+
"use strict";
|
|
84
|
+
|
|
85
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
86
|
+
exports.createPhenixSdkStateAtom = exports.PhenixSdkNameAtom = void 0;
|
|
87
|
+
exports.PhenixSdkNameAtom = 'phenix-sdk-state';
|
|
88
|
+
function createPhenixSdkStateAtom(context) {
|
|
89
|
+
const initialState = { isSdkRunning: false };
|
|
90
|
+
return context.effects.state.create(initialState, {
|
|
91
|
+
set: (state, isSdkRunning) => {
|
|
92
|
+
state.isSdkRunning = isSdkRunning;
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
exports.createPhenixSdkStateAtom = createPhenixSdkStateAtom;
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
/***/ }),
|
|
101
|
+
|
|
102
|
+
/***/ 48:
|
|
103
|
+
/***/ ((module) => {
|
|
104
|
+
|
|
105
|
+
"use strict";
|
|
106
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__48__;
|
|
107
|
+
|
|
108
|
+
/***/ })
|
|
109
|
+
|
|
110
|
+
/******/ });
|
|
111
|
+
/************************************************************************/
|
|
112
|
+
/******/ // The module cache
|
|
113
|
+
/******/ var __webpack_module_cache__ = {};
|
|
114
|
+
/******/
|
|
115
|
+
/******/ // The require function
|
|
116
|
+
/******/ function __webpack_require__(moduleId) {
|
|
117
|
+
/******/ // Check if module is in cache
|
|
118
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
119
|
+
/******/ if (cachedModule !== undefined) {
|
|
120
|
+
/******/ return cachedModule.exports;
|
|
121
|
+
/******/ }
|
|
122
|
+
/******/ // Create a new module (and put it into the cache)
|
|
123
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
124
|
+
/******/ // no module.id needed
|
|
125
|
+
/******/ // no module.loaded needed
|
|
126
|
+
/******/ exports: {}
|
|
127
|
+
/******/ };
|
|
128
|
+
/******/
|
|
129
|
+
/******/ // Execute the module function
|
|
130
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
131
|
+
/******/
|
|
132
|
+
/******/ // Return the exports of the module
|
|
133
|
+
/******/ return module.exports;
|
|
134
|
+
/******/ }
|
|
135
|
+
/******/
|
|
136
|
+
/************************************************************************/
|
|
137
|
+
/******/
|
|
138
|
+
/******/ // startup
|
|
139
|
+
/******/ // Load entry module and return exports
|
|
140
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
141
|
+
/******/ var __webpack_exports__ = __webpack_require__(91);
|
|
142
|
+
/******/
|
|
143
|
+
/******/ return __webpack_exports__;
|
|
144
|
+
/******/ })()
|
|
145
|
+
;
|
|
146
|
+
});
|
|
147
|
+
//# sourceMappingURL=phenix-sdk-api.package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phenix-sdk-api/phenix-sdk-api.package.js","mappings":"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","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__48__) => {\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. © 2023 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.0.0-beta.12\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={508:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:!0}),t.createEffectFactory=void 0;const r=e=>e;t.createEffectFactory=r},898:(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},465:(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)}}Object.defineProperty(t,\"__esModule\",{value:!0}),t.createTaskClosure=t.createTask=void 0,t.createTask=r,t.createTaskClosure=a}},t={};function r(a){var o=t[a];if(void 0!==o)return o.exports;var c=t[a]={exports:{}};return e[a](c,c.exports,r),c.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(508);Object.defineProperty(e,\"createEffectFactory\",{enumerable:!0,get:function(){return t.createEffectFactory}});var o=r(898);Object.defineProperty(e,\"createPackage\",{enumerable:!0,get:function(){return o.createPackage}});var c=r(465);Object.defineProperty(e,\"createTask\",{enumerable:!0,get:function(){return c.createTask}}),Object.defineProperty(e,\"createTaskClosure\",{enumerable:!0,get:function(){return c.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__48__;","// 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__(91);\n",""],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@phenixrts/bitmovin-plugin/phenix-sdk-plugin",
|
|
3
|
+
"version": "2024.0.0-beta.2",
|
|
4
|
+
"files": [
|
|
5
|
+
"*"
|
|
6
|
+
],
|
|
7
|
+
"author": "Phenix Real Time Solutions, Inc.",
|
|
8
|
+
"license": "See in LICENSE file",
|
|
9
|
+
"main": "./phenix-sdk-plugin.package.js",
|
|
10
|
+
"types": "../types/PhenixSdkPlugin.package.d.ts"
|
|
11
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define([], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["phenix-sdk-plugin"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["bitmovin"] = root["bitmovin"] || {}, root["bitmovin"]["playerx"] = root["bitmovin"]["playerx"] || {}, root["bitmovin"]["playerx"]["phenix-sdk-plugin"] = factory();
|
|
10
|
+
})(self, () => {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ var __webpack_modules__ = ({
|
|
13
|
+
|
|
14
|
+
/***/ 497:
|
|
15
|
+
/***/ ((module) => {
|
|
16
|
+
|
|
17
|
+
/*******************************************************************************
|
|
18
|
+
* This source code is the proprietary property of Bitmovin, Inc. Unauthorized
|
|
19
|
+
* copying, distribution, or use of this code, or any portion thereof, is
|
|
20
|
+
* strictly prohibited. © 2023 Bitmovin, Inc. All rights reserved. This
|
|
21
|
+
* source code is subject to the terms and conditions of the accompanying
|
|
22
|
+
* license agreement.
|
|
23
|
+
*
|
|
24
|
+
* Bitmovin Player X Version 10.0.0-beta.12
|
|
25
|
+
*******************************************************************************/
|
|
26
|
+
!function(e,t){ true?module.exports=t():0}(self,(()=>(()=>{"use strict";var e={508:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createEffectFactory=void 0;const r=e=>e;t.createEffectFactory=r},898:(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},465:(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)}}Object.defineProperty(t,"__esModule",{value:!0}),t.createTaskClosure=t.createTask=void 0,t.createTask=r,t.createTaskClosure=a}},t={};function r(a){var o=t[a];if(void 0!==o)return o.exports;var c=t[a]={exports:{}};return e[a](c,c.exports,r),c.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(508);Object.defineProperty(e,"createEffectFactory",{enumerable:!0,get:function(){return t.createEffectFactory}});var o=r(898);Object.defineProperty(e,"createPackage",{enumerable:!0,get:function(){return o.createPackage}});var c=r(465);Object.defineProperty(e,"createTask",{enumerable:!0,get:function(){return c.createTask}}),Object.defineProperty(e,"createTaskClosure",{enumerable:!0,get:function(){return c.createTaskClosure}})})(),a})()));
|
|
27
|
+
|
|
28
|
+
/***/ }),
|
|
29
|
+
|
|
30
|
+
/***/ 465:
|
|
31
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
32
|
+
|
|
33
|
+
"use strict";
|
|
34
|
+
|
|
35
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
36
|
+
exports.PhenixSdkPlugin = void 0;
|
|
37
|
+
const playerx_framework_utils_1 = __webpack_require__(497);
|
|
38
|
+
const PhenixSdkStateAtom_1 = __webpack_require__(865);
|
|
39
|
+
exports.PhenixSdkPlugin = (0, playerx_framework_utils_1.createPackage)('phenix-sdk-package', (apiManager, baseContext) => {
|
|
40
|
+
const { StateEffectFactory, EventListenerEffectFactory } = baseContext.registry.get('core-effects');
|
|
41
|
+
const context = baseContext.using(StateEffectFactory).using(EventListenerEffectFactory);
|
|
42
|
+
const sourceState = context.registry.get('source-state');
|
|
43
|
+
const phenixSdkState = context.registry.get(PhenixSdkStateAtom_1.PhenixSdkNameAtom);
|
|
44
|
+
const { state } = context.effects;
|
|
45
|
+
state.subscribe(context, phenixSdkState, ApiStateChangeSubscriber(apiManager));
|
|
46
|
+
state.subscribe(context, sourceState, SourceStateChangeSubscriber(apiManager));
|
|
47
|
+
}, ['core-effects', PhenixSdkStateAtom_1.PhenixSdkNameAtom, 'source-state']);
|
|
48
|
+
const SourceStateChangeSubscriber = (apiManager) => (0, playerx_framework_utils_1.createTask)('source-state-sdk-subscriber', (source) => {
|
|
49
|
+
if (source.isActive) {
|
|
50
|
+
apiManager.api.phenixrts.disposeChannel();
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const ApiStateChangeSubscriber = (apiManager) => (0, playerx_framework_utils_1.createTask)('api-state-change-subscriber', (source, context) => {
|
|
54
|
+
const sourceState = context.registry.get('source-state');
|
|
55
|
+
if (source.isSdkRunning && apiManager.api.sources) {
|
|
56
|
+
const { state } = context.effects;
|
|
57
|
+
state.dispatch(sourceState.setActive, false);
|
|
58
|
+
state.dispatch(sourceState.video.clear);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
exports["default"] = exports.PhenixSdkPlugin;
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/***/ }),
|
|
65
|
+
|
|
66
|
+
/***/ 865:
|
|
67
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
68
|
+
|
|
69
|
+
"use strict";
|
|
70
|
+
|
|
71
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
72
|
+
exports.createPhenixSdkStateAtom = exports.PhenixSdkNameAtom = void 0;
|
|
73
|
+
exports.PhenixSdkNameAtom = 'phenix-sdk-state';
|
|
74
|
+
function createPhenixSdkStateAtom(context) {
|
|
75
|
+
const initialState = { isSdkRunning: false };
|
|
76
|
+
return context.effects.state.create(initialState, {
|
|
77
|
+
set: (state, isSdkRunning) => {
|
|
78
|
+
state.isSdkRunning = isSdkRunning;
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
exports.createPhenixSdkStateAtom = createPhenixSdkStateAtom;
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
/***/ })
|
|
87
|
+
|
|
88
|
+
/******/ });
|
|
89
|
+
/************************************************************************/
|
|
90
|
+
/******/ // The module cache
|
|
91
|
+
/******/ var __webpack_module_cache__ = {};
|
|
92
|
+
/******/
|
|
93
|
+
/******/ // The require function
|
|
94
|
+
/******/ function __webpack_require__(moduleId) {
|
|
95
|
+
/******/ // Check if module is in cache
|
|
96
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
97
|
+
/******/ if (cachedModule !== undefined) {
|
|
98
|
+
/******/ return cachedModule.exports;
|
|
99
|
+
/******/ }
|
|
100
|
+
/******/ // Create a new module (and put it into the cache)
|
|
101
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
102
|
+
/******/ // no module.id needed
|
|
103
|
+
/******/ // no module.loaded needed
|
|
104
|
+
/******/ exports: {}
|
|
105
|
+
/******/ };
|
|
106
|
+
/******/
|
|
107
|
+
/******/ // Execute the module function
|
|
108
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
109
|
+
/******/
|
|
110
|
+
/******/ // Return the exports of the module
|
|
111
|
+
/******/ return module.exports;
|
|
112
|
+
/******/ }
|
|
113
|
+
/******/
|
|
114
|
+
/************************************************************************/
|
|
115
|
+
/******/
|
|
116
|
+
/******/ // startup
|
|
117
|
+
/******/ // Load entry module and return exports
|
|
118
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
119
|
+
/******/ var __webpack_exports__ = __webpack_require__(465);
|
|
120
|
+
/******/
|
|
121
|
+
/******/ return __webpack_exports__;
|
|
122
|
+
/******/ })()
|
|
123
|
+
;
|
|
124
|
+
});
|
|
125
|
+
//# sourceMappingURL=phenix-sdk-plugin.package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phenix-sdk-plugin/phenix-sdk-plugin.package.js","mappings":"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","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/PhenixSdkPlugin.package.ts","webpack://bitmovin.playerx/./src/phenix-bitmovin-plugin/PhenixSdkStateAtom.ts","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();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"phenix-sdk-plugin\"] = factory();\n\telse\n\t\troot[\"bitmovin\"] = root[\"bitmovin\"] || {}, root[\"bitmovin\"][\"playerx\"] = root[\"bitmovin\"][\"playerx\"] || {}, root[\"bitmovin\"][\"playerx\"][\"phenix-sdk-plugin\"] = factory();\n})(self, () => {\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. © 2023 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.0.0-beta.12\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={508:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:!0}),t.createEffectFactory=void 0;const r=e=>e;t.createEffectFactory=r},898:(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},465:(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)}}Object.defineProperty(t,\"__esModule\",{value:!0}),t.createTaskClosure=t.createTask=void 0,t.createTask=r,t.createTaskClosure=a}},t={};function r(a){var o=t[a];if(void 0!==o)return o.exports;var c=t[a]={exports:{}};return e[a](c,c.exports,r),c.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(508);Object.defineProperty(e,\"createEffectFactory\",{enumerable:!0,get:function(){return t.createEffectFactory}});var o=r(898);Object.defineProperty(e,\"createPackage\",{enumerable:!0,get:function(){return o.createPackage}});var c=r(465);Object.defineProperty(e,\"createTask\",{enumerable:!0,get:function(){return c.createTask}}),Object.defineProperty(e,\"createTaskClosure\",{enumerable:!0,get:function(){return c.createTaskClosure}})})(),a})()));","/**\n * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.\n */\nimport type {ApiManager} from '@bitmovin/player-web-x/framework-types/api-manager/ApiManager';\nimport type {ContextHaving} from '@bitmovin/player-web-x/framework-types/execution-context/Types';\nimport type {EmptyObject} from '@bitmovin/player-web-x/types/BaseTypes';\nimport type {CoreEffects} from '@bitmovin/player-web-x/types/framework/core/core/Core.package';\nimport type {SourceStateAtom} from '@bitmovin/player-web-x/types/framework/core/source/atoms/SourceStateAtom';\nimport type {ContextWithState} from '@bitmovin/player-web-x/types/framework/core/Types';\nimport type {ComponentName} from '@bitmovin/player-web-x/types/framework/Types';\nimport type {IPhenixApi} from './PhenixSdkApi.package';\nimport type {PhenixSdkStateAtom} from './PhenixSdkStateAtom';\nimport {createPackage, createTask} from '@bitmovin/player-web-x/playerx-framework-utils';\nimport {PhenixSdkNameAtom} from './PhenixSdkStateAtom';\n\ntype Dependencies = {\n [ComponentName.CoreEffects]: CoreEffects;\n [ComponentName.SourceState]: SourceStateAtom;\n [PhenixSdkNameAtom]: PhenixSdkStateAtom;\n};\n\ntype Exports = EmptyObject;\n\ntype Api = {\n sources: EmptyObject;\n phenixrts: IPhenixApi;\n};\n\nexport type PhenixSdkPluginContext = ContextHaving<Dependencies, Exports, ContextWithState>;\n\nexport const PhenixSdkPlugin = createPackage<Dependencies, Exports, Api>(\n 'phenix-sdk-package',\n (apiManager, baseContext) => {\n const {StateEffectFactory, EventListenerEffectFactory} = baseContext.registry.get('core-effects');\n const context = baseContext.using(StateEffectFactory).using(EventListenerEffectFactory);\n const sourceState = context.registry.get('source-state');\n const phenixSdkState = context.registry.get(PhenixSdkNameAtom);\n const {state} = context.effects;\n\n state.subscribe(context, phenixSdkState, ApiStateChangeSubscriber(apiManager));\n state.subscribe(context, sourceState, SourceStateChangeSubscriber(apiManager));\n },\n ['core-effects', PhenixSdkNameAtom, 'source-state'],\n);\n\nconst SourceStateChangeSubscriber = (apiManager: ApiManager<Api>) =>\n createTask('source-state-sdk-subscriber', (source: SourceStateAtom) => {\n if (source.isActive) {\n apiManager.api.phenixrts.disposeChannel();\n }\n });\nconst ApiStateChangeSubscriber = (apiManager: ApiManager<Api>) =>\n createTask('api-state-change-subscriber', (source: PhenixSdkStateAtom, context: PhenixSdkPluginContext) => {\n const sourceState = context.registry.get('source-state');\n\n if (source.isSdkRunning && apiManager.api.sources) {\n const {state} = context.effects;\n\n state.dispatch(sourceState.setActive, false);\n state.dispatch(sourceState.video.clear);\n }\n });\n\nexport default PhenixSdkPlugin;","/**\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}","// 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__(465);\n",""],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
|
|
3
|
+
*/
|
|
4
|
+
import type { CoreEffects } from '@bitmovin/player-web-x/types/framework/core/core/Core.package';
|
|
5
|
+
import type { ComponentName } from '@bitmovin/player-web-x/types/framework/Types';
|
|
6
|
+
import type Channel from '@phenixrts/sdk/types/sdk/channels/Channel';
|
|
7
|
+
import type { PhenixSdkStateAtom } from './PhenixSdkStateAtom';
|
|
8
|
+
import { PhenixSdkNameAtom } from './PhenixSdkStateAtom';
|
|
9
|
+
type Dependencies = {
|
|
10
|
+
[ComponentName.CoreEffects]: CoreEffects;
|
|
11
|
+
};
|
|
12
|
+
type Exports = {
|
|
13
|
+
[PhenixSdkNameAtom]: PhenixSdkStateAtom;
|
|
14
|
+
};
|
|
15
|
+
type Api = {
|
|
16
|
+
getVideoElement: () => HTMLVideoElement;
|
|
17
|
+
phenixrts: IPhenixApi;
|
|
18
|
+
};
|
|
19
|
+
export interface IPhenixApi {
|
|
20
|
+
createChannel: (token: string) => Channel;
|
|
21
|
+
initSDK: (options: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}) => void;
|
|
24
|
+
disposeChannel: () => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const PhenixSdkApi: import("@bitmovin/player-web-x/framework-types/package-api/Package").Package<Dependencies, Exports, Api>;
|
|
27
|
+
export default PhenixSdkApi;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ContextHaving } from '@bitmovin/player-web-x/framework-types/execution-context/Types';
|
|
2
|
+
import type { EmptyObject } from '@bitmovin/player-web-x/types/BaseTypes';
|
|
3
|
+
import type { CoreEffects } from '@bitmovin/player-web-x/types/framework/core/core/Core.package';
|
|
4
|
+
import type { SourceStateAtom } from '@bitmovin/player-web-x/types/framework/core/source/atoms/SourceStateAtom';
|
|
5
|
+
import type { ContextWithState } from '@bitmovin/player-web-x/types/framework/core/Types';
|
|
6
|
+
import type { ComponentName } from '@bitmovin/player-web-x/types/framework/Types';
|
|
7
|
+
import type { IPhenixApi } from './PhenixSdkApi.package';
|
|
8
|
+
import type { PhenixSdkStateAtom } from './PhenixSdkStateAtom';
|
|
9
|
+
import { PhenixSdkNameAtom } from './PhenixSdkStateAtom';
|
|
10
|
+
type Dependencies = {
|
|
11
|
+
[ComponentName.CoreEffects]: CoreEffects;
|
|
12
|
+
[ComponentName.SourceState]: SourceStateAtom;
|
|
13
|
+
[PhenixSdkNameAtom]: PhenixSdkStateAtom;
|
|
14
|
+
};
|
|
15
|
+
type Exports = EmptyObject;
|
|
16
|
+
type Api = {
|
|
17
|
+
sources: EmptyObject;
|
|
18
|
+
phenixrts: IPhenixApi;
|
|
19
|
+
};
|
|
20
|
+
export type PhenixSdkPluginContext = ContextHaving<Dependencies, Exports, ContextWithState>;
|
|
21
|
+
export declare const PhenixSdkPlugin: import("@bitmovin/player-web-x/framework-types/package-api/Package").Package<Dependencies, EmptyObject, Api>;
|
|
22
|
+
export default PhenixSdkPlugin;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
|
|
3
|
+
*/
|
|
4
|
+
import type { ContextWithState } from '@bitmovin/player-web-x/types/framework/core/Types';
|
|
5
|
+
interface IPhenixSdkState {
|
|
6
|
+
isSdkRunning: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const PhenixSdkNameAtom = "phenix-sdk-state";
|
|
9
|
+
export type PhenixSdkStateAtom = ReturnType<typeof createPhenixSdkStateAtom>;
|
|
10
|
+
export declare function createPhenixSdkStateAtom(context: ContextWithState): import("@bitmovin/player-web-x/types/framework/core/core/state/Types").StateAtom<IPhenixSdkState, {
|
|
11
|
+
set: (state: IPhenixSdkState, isSdkRunning: boolean) => true;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|