@clockworkdog/cogs-client-react 0.16.3 → 1.0.0-rc.1
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/README.md +32 -18
- package/dist/components/Hint.d.ts +1 -1
- package/dist/components/Hint.js +4 -1
- package/dist/components/Hint.js.map +1 -1
- package/dist/components/Images.d.ts +1 -1
- package/dist/components/Images.js +4 -1
- package/dist/components/Images.js.map +1 -1
- package/dist/components/Timer.d.ts +1 -1
- package/dist/components/Timer.js +4 -1
- package/dist/components/Timer.js.map +1 -1
- package/dist/components/VideoContainer.d.ts +10 -0
- package/dist/components/VideoContainer.js +38 -0
- package/dist/components/VideoContainer.js.map +1 -0
- package/dist/hooks/useImages.js +3 -0
- package/dist/hooks/useImages.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/providers/CogsConnectionProvider.d.ts +23 -4
- package/dist/providers/CogsConnectionProvider.js +45 -8
- package/dist/providers/CogsConnectionProvider.js.map +1 -1
- package/package.json +3 -2
- package/dist/components/Video.d.ts +0 -20
- package/dist/components/Video.js +0 -105
- package/dist/components/Video.js.map +0 -1
- package/dist/types/ActiveAudioClipState.d.ts +0 -7
- package/dist/types/ActiveAudioClipState.js +0 -11
- package/dist/types/ActiveAudioClipState.js.map +0 -1
- package/dist/types/VideoClipState.d.ts +0 -6
- package/dist/types/VideoClipState.js +0 -10
- package/dist/types/VideoClipState.js.map +0 -1
package/README.md
CHANGED
|
@@ -21,26 +21,47 @@ yarn add @clockworkdog/cogs-client-react
|
|
|
21
21
|
Import the library
|
|
22
22
|
|
|
23
23
|
```ts
|
|
24
|
-
import {
|
|
25
|
-
|
|
24
|
+
import {
|
|
25
|
+
CogsConnectionProvider,
|
|
26
|
+
VideoContainer,
|
|
27
|
+
Timer,
|
|
28
|
+
Hint,
|
|
29
|
+
useIsConnected,
|
|
30
|
+
useAudioPlayer,
|
|
31
|
+
useIsAudioPlaying,
|
|
32
|
+
} from '@clockworkdog/cogs-client-react';
|
|
26
33
|
```
|
|
27
34
|
|
|
28
35
|
or
|
|
29
36
|
|
|
30
37
|
```js
|
|
31
|
-
const {
|
|
32
|
-
|
|
38
|
+
const {
|
|
39
|
+
CogsConnectionProvider,
|
|
40
|
+
VideoContainer,
|
|
41
|
+
Hint,
|
|
42
|
+
Timer,
|
|
43
|
+
useIsConnected,
|
|
44
|
+
useAudioPlayer,
|
|
45
|
+
useIsAudioPlaying,
|
|
46
|
+
} = require('@clockworkdog/cogs-client-react');
|
|
33
47
|
```
|
|
34
48
|
|
|
35
49
|
then
|
|
36
50
|
|
|
37
51
|
```tsx
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
function App() {
|
|
53
|
+
return (
|
|
54
|
+
<CogsConnectionProvider audioPlayer videoPlayer>
|
|
55
|
+
<MyComponent />
|
|
56
|
+
</CogsConnectionProvider>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
41
59
|
|
|
42
60
|
function MyComponent() {
|
|
61
|
+
const cogsConnection = useCogsConnection();
|
|
43
62
|
const isConnected = useIsConnected(cogsConnection);
|
|
63
|
+
|
|
64
|
+
const audioPlayer = useAudioPlayer();
|
|
44
65
|
const isAudioPlaying = useIsAudioPlaying(audioPlayer);
|
|
45
66
|
|
|
46
67
|
return (
|
|
@@ -49,14 +70,14 @@ function MyComponent() {
|
|
|
49
70
|
<div>Audio playing: {isAudioPlaying}</div>
|
|
50
71
|
<div style={{ fontSize: 100 }}>
|
|
51
72
|
{/* The time from the adjustable timer plugin in the format 'MM:SS' */}
|
|
52
|
-
<Timer
|
|
73
|
+
<Timer center />
|
|
53
74
|
</div>
|
|
54
75
|
<div style={{ fontSize: 20 }}>
|
|
55
76
|
{/* The latest text hint as a string */}
|
|
56
|
-
<Hint
|
|
77
|
+
<Hint />
|
|
57
78
|
</div>
|
|
58
|
-
{/*
|
|
59
|
-
<
|
|
79
|
+
{/* Specify where you want the video to be displayed. Leave this out for default fullscreen behavior */}
|
|
80
|
+
<VideoContainer style={{ position: 'absolute', top: 100, left: 100, width: 400, height: 300 }} />
|
|
60
81
|
</div>
|
|
61
82
|
);
|
|
62
83
|
}
|
|
@@ -81,10 +102,3 @@ Or, if you're using `create-react-app` for your project, you'll need to configur
|
|
|
81
102
|
```
|
|
82
103
|
"homepage": ".",
|
|
83
104
|
```
|
|
84
|
-
|
|
85
|
-
## Release process
|
|
86
|
-
|
|
87
|
-
1. Create a new commit with a bumped version number in `package.json`.
|
|
88
|
-
2. [Click here to create a new release on GitHub](https://github.com/clockwork-dog/cogs-client-react-lib/releases/new) where the Tag Version is the version from `package.json` prefixed with a `v`.
|
|
89
|
-
|
|
90
|
-
The release will be automatically built and released on npm.
|
package/dist/components/Hint.js
CHANGED
|
@@ -5,7 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const useHint_1 = __importDefault(require("../hooks/useHint"));
|
|
8
|
-
|
|
8
|
+
const CogsConnectionProvider_1 = require("../providers/CogsConnectionProvider");
|
|
9
|
+
function Hint({ connection: customConnection }) {
|
|
10
|
+
const providerConnection = CogsConnectionProvider_1.useCogsConnection();
|
|
11
|
+
const connection = customConnection !== null && customConnection !== void 0 ? customConnection : providerConnection;
|
|
9
12
|
const hint = useHint_1.default(connection);
|
|
10
13
|
return hint ? react_1.default.createElement(react_1.default.Fragment, null, hint) : null;
|
|
11
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hint.js","sourceRoot":"","sources":["../../src/components/Hint.tsx"],"names":[],"mappings":";;;;;AACA,kDAA0B;AAC1B,+DAAuC;
|
|
1
|
+
{"version":3,"file":"Hint.js","sourceRoot":"","sources":["../../src/components/Hint.tsx"],"names":[],"mappings":";;;;;AACA,kDAA0B;AAC1B,+DAAuC;AACvC,gFAAwE;AAExE,SAAwB,IAAI,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAkC;IAC3F,MAAM,kBAAkB,GAAG,0CAAiB,EAAE,CAAC;IAC/C,MAAM,UAAU,GAAG,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,kBAAkB,CAAC;IAC1D,MAAM,IAAI,GAAG,iBAAO,CAAC,UAAU,CAAC,CAAC;IACjC,OAAO,IAAI,CAAC,CAAC,CAAC,8DAAG,IAAI,CAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,CAAC;AALD,uBAKC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CogsConnection } from '@clockworkdog/cogs-client';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export default function Images({ className, style, connection, fullscreen, }: {
|
|
3
|
+
export default function Images({ className, style, connection: customConnection, fullscreen, }: {
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
6
6
|
connection: CogsConnection;
|
|
@@ -6,7 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const cogs_client_1 = require("@clockworkdog/cogs-client");
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const useImages_1 = __importDefault(require("../hooks/useImages"));
|
|
9
|
-
|
|
9
|
+
const CogsConnectionProvider_1 = require("../providers/CogsConnectionProvider");
|
|
10
|
+
function Images({ className, style, connection: customConnection, fullscreen, }) {
|
|
11
|
+
const providerConnection = CogsConnectionProvider_1.useCogsConnection();
|
|
12
|
+
const connection = customConnection !== null && customConnection !== void 0 ? customConnection : providerConnection;
|
|
10
13
|
const images = useImages_1.default(connection);
|
|
11
14
|
const fullscreenCustomStyle = typeof fullscreen === 'object' ? fullscreen.style : undefined;
|
|
12
15
|
const imageElements = images.map((image, index) => (react_1.default.createElement("img", { className: className, key: index, src: cogs_client_1.assetUrl(image.file), alt: image.file, style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Images.js","sourceRoot":"","sources":["../../src/components/Images.tsx"],"names":[],"mappings":";;;;;AAAA,2DAAqE;AACrE,kDAA0B;AAC1B,mEAA2C;
|
|
1
|
+
{"version":3,"file":"Images.js","sourceRoot":"","sources":["../../src/components/Images.tsx"],"names":[],"mappings":";;;;;AAAA,2DAAqE;AACrE,kDAA0B;AAC1B,mEAA2C;AAC3C,gFAAwE;AAExE,SAAwB,MAAM,CAAC,EAC7B,SAAS,EACT,KAAK,EACL,UAAU,EAAE,gBAAgB,EAC5B,UAAU,GAMX;IACC,MAAM,kBAAkB,GAAG,0CAAiB,EAAE,CAAC;IAC/C,MAAM,UAAU,GAAG,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,kBAAkB,CAAC;IAE1D,MAAM,MAAM,GAAG,mBAAS,CAAC,UAAU,CAAC,CAAC;IAErC,MAAM,qBAAqB,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAE5F,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACjD,uCACE,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,KAAK,EACV,GAAG,EAAE,sBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EACzB,GAAG,EAAE,KAAK,CAAC,IAAI,EACf,KAAK,EAAE;YACL,SAAS,EAAE,KAAK,CAAC,GAAG;YACpB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/F,GAAG,KAAK;SACT,GACD,CACH,CAAC,CAAC;IAEH,OAAO,CACL,8DACG,UAAU,CAAC,CAAC,CAAC,CACZ,uCAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,qBAAqB,EAAE,IACxH,aAAa,CACV,CACP,CAAC,CAAC,CAAC,CACF,aAAa,CACd,CACA,CACJ,CAAC;AACJ,CAAC;AA3CD,yBA2CC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CogsConnection } from '@clockworkdog/cogs-client';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export default function Timer({ className, style, connection, separator, center, }: {
|
|
3
|
+
export default function Timer({ className, style, connection: customConnection, separator, center, }: {
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
6
6
|
connection: CogsConnection;
|
package/dist/components/Timer.js
CHANGED
|
@@ -24,6 +24,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
const react_1 = __importStar(require("react"));
|
|
26
26
|
const useCogsMessage_1 = __importDefault(require("../hooks/useCogsMessage"));
|
|
27
|
+
const CogsConnectionProvider_1 = require("../providers/CogsConnectionProvider");
|
|
27
28
|
function formatTime(time, countingUp) {
|
|
28
29
|
const negative = time < 0;
|
|
29
30
|
// Flip things for negative times
|
|
@@ -37,8 +38,10 @@ function formatTime(time, countingUp) {
|
|
|
37
38
|
const seconds = String((roundedTime / 1000) % 60).padStart(2, '0');
|
|
38
39
|
return { minutes, seconds };
|
|
39
40
|
}
|
|
40
|
-
function Timer({ className, style, connection, separator = ':', center, }) {
|
|
41
|
+
function Timer({ className, style, connection: customConnection, separator = ':', center, }) {
|
|
41
42
|
var _a, _b, _c, _d, _e, _f;
|
|
43
|
+
const providerConnection = CogsConnectionProvider_1.useCogsConnection();
|
|
44
|
+
const connection = customConnection !== null && customConnection !== void 0 ? customConnection : providerConnection;
|
|
42
45
|
const [timerElapsed, setTimerElapsed] = react_1.useState(0);
|
|
43
46
|
const [timerStartedAt, setTimerStartedAt] = react_1.useState((_b = (_a = connection.timerState) === null || _a === void 0 ? void 0 : _a.startedAt) !== null && _b !== void 0 ? _b : 0);
|
|
44
47
|
const [timerTotalMillis, setTimerTotalMillis] = react_1.useState((_d = (_c = connection.timerState) === null || _c === void 0 ? void 0 : _c.durationMillis) !== null && _d !== void 0 ? _d : 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timer.js","sourceRoot":"","sources":["../../src/components/Timer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAAgE;AAChE,6EAAqD;
|
|
1
|
+
{"version":3,"file":"Timer.js","sourceRoot":"","sources":["../../src/components/Timer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAAgE;AAChE,6EAAqD;AACrD,gFAAwE;AAExE,SAAS,UAAU,CAAC,IAAY,EAAE,UAAmB;IACnD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC;IAE1B,iCAAiC;IACjC,IAAI,QAAQ,EAAE;QACZ,UAAU,GAAG,CAAC,UAAU,CAAC;QACzB,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC;KACjB;IAED,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChG,6BAA6B;IAC7B,MAAM,OAAO,GAAG,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,QAA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,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK;QACxG,wCAAM,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,IAAG,OAAO,CAAQ;QACrG,4CAAO,SAAS,CAAQ;QACxB,wCAAM,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,IAAG,OAAO,CAAQ,CAChG,CACP,CAAC;AACJ,CAAC;AAxED,wBAwEC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CogsVideoPlayer } from '@clockworkdog/cogs-client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export default function VideoContainer({ className, style, videoPlayer: customVideoPlayer, fullscreen, }: {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
videoPlayer?: CogsVideoPlayer;
|
|
7
|
+
fullscreen?: boolean | {
|
|
8
|
+
style: React.CSSProperties;
|
|
9
|
+
};
|
|
10
|
+
}): JSX.Element | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
const react_1 = __importStar(require("react"));
|
|
23
|
+
const CogsConnectionProvider_1 = require("../providers/CogsConnectionProvider");
|
|
24
|
+
function VideoContainer({ className, style, videoPlayer: customVideoPlayer, fullscreen, }) {
|
|
25
|
+
const containerRef = react_1.useRef(null);
|
|
26
|
+
const providerVideoPlayer = CogsConnectionProvider_1.useVideoPlayer();
|
|
27
|
+
const videoPlayer = customVideoPlayer !== null && customVideoPlayer !== void 0 ? customVideoPlayer : providerVideoPlayer;
|
|
28
|
+
react_1.useEffect(() => {
|
|
29
|
+
if (videoPlayer && containerRef.current) {
|
|
30
|
+
videoPlayer.setParentElement(containerRef.current);
|
|
31
|
+
return () => videoPlayer.resetParentElement();
|
|
32
|
+
}
|
|
33
|
+
}, [videoPlayer]);
|
|
34
|
+
const fullscreenCustomStyle = typeof fullscreen === 'object' ? fullscreen.style : style;
|
|
35
|
+
return (react_1.default.createElement("div", { ref: containerRef, className: className, style: fullscreen ? { position: 'absolute', zIndex: 1, top: 0, left: 0, width: '100vw', height: '100vh', ...fullscreenCustomStyle } : style }));
|
|
36
|
+
}
|
|
37
|
+
exports.default = VideoContainer;
|
|
38
|
+
//# sourceMappingURL=VideoContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoContainer.js","sourceRoot":"","sources":["../../src/components/VideoContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,+CAAiD;AACjD,gFAAqE;AAErE,SAAwB,cAAc,CAAC,EACrC,SAAS,EACT,KAAK,EACL,WAAW,EAAE,iBAAiB,EAC9B,UAAU,GAMX;IACC,MAAM,YAAY,GAAG,cAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,mBAAmB,GAAG,uCAAc,EAAE,CAAC;IAC7C,MAAM,WAAW,GAAG,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,mBAAmB,CAAC;IAE7D,iBAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW,IAAI,YAAY,CAAC,OAAO,EAAE;YACvC,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACnD,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,kBAAkB,EAAE,CAAC;SAC/C;IACH,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,qBAAqB,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACxF,OAAO,CACL,uCACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,qBAAqB,EAAE,CAAC,CAAC,CAAC,KAAK,GAC3I,CACH,CAAC;AACJ,CAAC;AA9BD,iCA8BC"}
|
package/dist/hooks/useImages.js
CHANGED
|
@@ -23,6 +23,9 @@ function useImages(connection) {
|
|
|
23
23
|
setImages([]);
|
|
24
24
|
}
|
|
25
25
|
break;
|
|
26
|
+
case 'image_set_fit':
|
|
27
|
+
setImages((images) => images.map((image) => (!message.file || message.file === image.file ? { ...image, fit: message.fit } : image)));
|
|
28
|
+
break;
|
|
26
29
|
}
|
|
27
30
|
}, []));
|
|
28
31
|
return images;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useImages.js","sourceRoot":"","sources":["../../src/hooks/useImages.ts"],"names":[],"mappings":";;;;;AACA,iCAA8C;AAC9C,sEAA8C;AAI9C,SAAwB,SAAS,CAAC,UAA0B;IAC1D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,gBAAQ,CAAU,EAAE,CAAC,CAAC;IAElD,wBAAc,CACZ,UAAU,EACV,mBAAW,CAAC,CAAC,OAA0B,EAAE,EAAE;QACzC,QAAQ,OAAO,CAAC,IAAI,EAAE;YACpB,KAAK,YAAY;gBACf;oBACE,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;oBAC1D,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;iBAClF;gBACD,MAAM;YACR,KAAK,YAAY;gBACf,IAAI,OAAO,CAAC,IAAI,EAAE;oBAChB,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;iBAC3E;qBAAM;oBACL,SAAS,CAAC,EAAE,CAAC,CAAC;iBACf;gBACD,MAAM;SACT;IACH,CAAC,EAAE,EAAE,CAAC,CACP,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"useImages.js","sourceRoot":"","sources":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CAAC;gBACtI,MAAM;SACT;IACH,CAAC,EAAE,EAAE,CAAC,CACP,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AA5BD,4BA4BC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as CogsConnectionProvider, useCogsConnection } from './providers/CogsConnectionProvider';
|
|
1
|
+
export { default as CogsConnectionProvider, useCogsConnection, useAudioPlayer, useVideoPlayer } from './providers/CogsConnectionProvider';
|
|
2
2
|
export { default as useIsConnected } from './hooks/useIsConnected';
|
|
3
3
|
export { default as useCogsConfig } from './hooks/useCogsConfig';
|
|
4
4
|
export { default as useCogsEvent } from './hooks/useCogsEvent';
|
|
@@ -10,9 +10,9 @@ export { default as useShowPhase } from './hooks/useShowPhase';
|
|
|
10
10
|
export { default as useWhenShowReset } from './hooks/useWhenShowReset';
|
|
11
11
|
export { default as useAudioClips } from './hooks/useAudioClips';
|
|
12
12
|
export { default as useIsAudioPlaying } from './hooks/useIsAudioPlaying';
|
|
13
|
+
export { default as VideoContainer } from './components/VideoContainer';
|
|
13
14
|
export { default as useHint } from './hooks/useHint';
|
|
14
15
|
export { default as Hint } from './components/Hint';
|
|
15
16
|
export { default as Timer } from './components/Timer';
|
|
16
|
-
export { default as Video } from './components/Video';
|
|
17
17
|
export { default as useImages } from './hooks/useImages';
|
|
18
18
|
export { default as Images } from './components/Images';
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Images = exports.useImages = exports.
|
|
6
|
+
exports.Images = exports.useImages = exports.Timer = exports.Hint = exports.useHint = exports.VideoContainer = exports.useIsAudioPlaying = exports.useAudioClips = exports.useWhenShowReset = exports.useShowPhase = exports.usePreloadedUrl = exports.useCogsMessage = exports.useCogsInputPortValues = exports.useCogsInputPortValue = exports.useCogsEvent = exports.useCogsConfig = exports.useIsConnected = exports.useVideoPlayer = exports.useAudioPlayer = exports.useCogsConnection = exports.CogsConnectionProvider = void 0;
|
|
7
7
|
// Utilities
|
|
8
8
|
var CogsConnectionProvider_1 = require("./providers/CogsConnectionProvider");
|
|
9
9
|
Object.defineProperty(exports, "CogsConnectionProvider", { enumerable: true, get: function () { return __importDefault(CogsConnectionProvider_1).default; } });
|
|
10
10
|
Object.defineProperty(exports, "useCogsConnection", { enumerable: true, get: function () { return CogsConnectionProvider_1.useCogsConnection; } });
|
|
11
|
+
Object.defineProperty(exports, "useAudioPlayer", { enumerable: true, get: function () { return CogsConnectionProvider_1.useAudioPlayer; } });
|
|
12
|
+
Object.defineProperty(exports, "useVideoPlayer", { enumerable: true, get: function () { return CogsConnectionProvider_1.useVideoPlayer; } });
|
|
11
13
|
var useIsConnected_1 = require("./hooks/useIsConnected");
|
|
12
14
|
Object.defineProperty(exports, "useIsConnected", { enumerable: true, get: function () { return __importDefault(useIsConnected_1).default; } });
|
|
13
15
|
var useCogsConfig_1 = require("./hooks/useCogsConfig");
|
|
@@ -31,6 +33,9 @@ var useAudioClips_1 = require("./hooks/useAudioClips");
|
|
|
31
33
|
Object.defineProperty(exports, "useAudioClips", { enumerable: true, get: function () { return __importDefault(useAudioClips_1).default; } });
|
|
32
34
|
var useIsAudioPlaying_1 = require("./hooks/useIsAudioPlaying");
|
|
33
35
|
Object.defineProperty(exports, "useIsAudioPlaying", { enumerable: true, get: function () { return __importDefault(useIsAudioPlaying_1).default; } });
|
|
36
|
+
// Video
|
|
37
|
+
var VideoContainer_1 = require("./components/VideoContainer");
|
|
38
|
+
Object.defineProperty(exports, "VideoContainer", { enumerable: true, get: function () { return __importDefault(VideoContainer_1).default; } });
|
|
34
39
|
// Hints
|
|
35
40
|
var useHint_1 = require("./hooks/useHint");
|
|
36
41
|
Object.defineProperty(exports, "useHint", { enumerable: true, get: function () { return __importDefault(useHint_1).default; } });
|
|
@@ -39,9 +44,6 @@ Object.defineProperty(exports, "Hint", { enumerable: true, get: function () { re
|
|
|
39
44
|
// Timer
|
|
40
45
|
var Timer_1 = require("./components/Timer");
|
|
41
46
|
Object.defineProperty(exports, "Timer", { enumerable: true, get: function () { return __importDefault(Timer_1).default; } });
|
|
42
|
-
// Video
|
|
43
|
-
var Video_1 = require("./components/Video");
|
|
44
|
-
Object.defineProperty(exports, "Video", { enumerable: true, get: function () { return __importDefault(Video_1).default; } });
|
|
45
47
|
// Images
|
|
46
48
|
var useImages_1 = require("./hooks/useImages");
|
|
47
49
|
Object.defineProperty(exports, "useImages", { enumerable: true, get: function () { return __importDefault(useImages_1).default; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,YAAY;AACZ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,YAAY;AACZ,6EAA0I;AAAjI,iJAAA,OAAO,OAA0B;AAAE,2HAAA,iBAAiB,OAAA;AAAE,wHAAA,cAAc,OAAA;AAAE,wHAAA,cAAc,OAAA;AAC7F,yDAAmE;AAA1D,iIAAA,OAAO,OAAkB;AAClC,uDAAiE;AAAxD,+HAAA,OAAO,OAAiB;AACjC,qDAA+D;AAAtD,6HAAA,OAAO,OAAgB;AAChC,uEAAiF;AAAxE,+IAAA,OAAO,OAAyB;AACzC,yEAAmF;AAA1E,iJAAA,OAAO,OAA0B;AAC1C,yDAAmE;AAA1D,iIAAA,OAAO,OAAkB;AAClC,2DAAqE;AAA5D,mIAAA,OAAO,OAAmB;AACnC,qDAA+D;AAAtD,6HAAA,OAAO,OAAgB;AAChC,6DAAuE;AAA9D,qIAAA,OAAO,OAAoB;AAEpC,QAAQ;AACR,uDAAiE;AAAxD,+HAAA,OAAO,OAAiB;AACjC,+DAAyE;AAAhE,uIAAA,OAAO,OAAqB;AAErC,QAAQ;AACR,8DAAwE;AAA/D,iIAAA,OAAO,OAAkB;AAElC,QAAQ;AACR,2CAAqD;AAA5C,mHAAA,OAAO,OAAW;AAC3B,0CAAoD;AAA3C,6GAAA,OAAO,OAAQ;AAExB,QAAQ;AACR,4CAAsD;AAA7C,+GAAA,OAAO,OAAS;AAEzB,SAAS;AACT,+CAAyD;AAAhD,uHAAA,OAAO,OAAa;AAC7B,8CAAwD;AAA/C,iHAAA,OAAO,OAAU"}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { CogsConnection } from '@clockworkdog/cogs-client';
|
|
1
|
+
import { CogsAudioPlayer, CogsConnection, CogsVideoPlayer } from '@clockworkdog/cogs-client';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare type CogsConnectionCustomTypes<Connection> = Connection extends CogsConnection<infer T> ? T : never;
|
|
4
4
|
/**
|
|
5
5
|
* Create a persistent connection to COGS which can be accessed with `useCogsConnection()`
|
|
6
|
+
* @param audioPlayer Creates a `CogsAudioPlayer` than can be accessed with `useAudioPlayer()`
|
|
7
|
+
*
|
|
8
|
+
* Note: If unset, the audio player will remain active.
|
|
9
|
+
*
|
|
10
|
+
* @param videoPlayer Creates a `CogsVideoPlayer` than can be accessed with `useVideoPlayer()`
|
|
11
|
+
*
|
|
12
|
+
* Note: If unset, the video player will remain active.
|
|
13
|
+
*
|
|
14
|
+
* *Example:*
|
|
6
15
|
*
|
|
7
16
|
* ```jsx
|
|
8
17
|
* function MyComponent() {
|
|
@@ -13,7 +22,7 @@ declare type CogsConnectionCustomTypes<Connection> = Connection extends CogsConn
|
|
|
13
22
|
* }
|
|
14
23
|
*
|
|
15
24
|
* function App() {
|
|
16
|
-
* return <CogsConnectionProvider>
|
|
25
|
+
* return <CogsConnectionProvider audioPlayer videoPlayer>
|
|
17
26
|
* <MyComponent />
|
|
18
27
|
* <CogsConnectionProvider/>;
|
|
19
28
|
* }
|
|
@@ -34,19 +43,29 @@ declare type CogsConnectionCustomTypes<Connection> = Connection extends CogsConn
|
|
|
34
43
|
* }
|
|
35
44
|
*
|
|
36
45
|
* function App() {
|
|
37
|
-
* return <CogsConnectionProvider>
|
|
46
|
+
* return <CogsConnectionProvider audioPlayer videoPlayer>
|
|
38
47
|
* <MyComponent />
|
|
39
48
|
* <CogsConnectionProvider/>;
|
|
40
49
|
* }
|
|
41
50
|
* ```
|
|
42
51
|
*/
|
|
43
|
-
export default function CogsConnectionProvider({ hostname, port, children, }: {
|
|
52
|
+
export default function CogsConnectionProvider({ hostname, port, children, audioPlayer, videoPlayer, }: {
|
|
44
53
|
hostname?: string;
|
|
45
54
|
port?: number;
|
|
46
55
|
children: React.ReactNode;
|
|
56
|
+
audioPlayer?: boolean;
|
|
57
|
+
videoPlayer?: boolean;
|
|
47
58
|
}): JSX.Element | null;
|
|
48
59
|
/**
|
|
49
60
|
* Get the connection from `<CogsConnectionProvider>`
|
|
50
61
|
*/
|
|
51
62
|
export declare function useCogsConnection<CustomTypes extends CogsConnectionCustomTypes<CogsConnection>>(): CogsConnection<CustomTypes>;
|
|
63
|
+
/**
|
|
64
|
+
* Get the audio player from `<CogsConnectionProvider audioPlayer>`
|
|
65
|
+
*/
|
|
66
|
+
export declare function useAudioPlayer(): CogsAudioPlayer | null;
|
|
67
|
+
/**
|
|
68
|
+
* Get the video player from `<CogsConnectionProvider audioPlayer>`
|
|
69
|
+
*/
|
|
70
|
+
export declare function useVideoPlayer(): CogsVideoPlayer | null;
|
|
52
71
|
export {};
|
|
@@ -19,16 +19,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.useCogsConnection = void 0;
|
|
22
|
+
exports.useVideoPlayer = exports.useAudioPlayer = exports.useCogsConnection = void 0;
|
|
23
23
|
const cogs_client_1 = require("@clockworkdog/cogs-client");
|
|
24
24
|
const react_1 = __importStar(require("react"));
|
|
25
25
|
const CogsConnectionContext = react_1.default.createContext({
|
|
26
|
-
useCogsConnection: () =>
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
useCogsConnection: () => undefined,
|
|
27
|
+
useAudioPlayer: () => undefined,
|
|
28
|
+
useVideoPlayer: () => undefined,
|
|
29
29
|
});
|
|
30
30
|
/**
|
|
31
31
|
* Create a persistent connection to COGS which can be accessed with `useCogsConnection()`
|
|
32
|
+
* @param audioPlayer Creates a `CogsAudioPlayer` than can be accessed with `useAudioPlayer()`
|
|
33
|
+
*
|
|
34
|
+
* Note: If unset, the audio player will remain active.
|
|
35
|
+
*
|
|
36
|
+
* @param videoPlayer Creates a `CogsVideoPlayer` than can be accessed with `useVideoPlayer()`
|
|
37
|
+
*
|
|
38
|
+
* Note: If unset, the video player will remain active.
|
|
39
|
+
*
|
|
40
|
+
* *Example:*
|
|
32
41
|
*
|
|
33
42
|
* ```jsx
|
|
34
43
|
* function MyComponent() {
|
|
@@ -39,7 +48,7 @@ const CogsConnectionContext = react_1.default.createContext({
|
|
|
39
48
|
* }
|
|
40
49
|
*
|
|
41
50
|
* function App() {
|
|
42
|
-
* return <CogsConnectionProvider>
|
|
51
|
+
* return <CogsConnectionProvider audioPlayer videoPlayer>
|
|
43
52
|
* <MyComponent />
|
|
44
53
|
* <CogsConnectionProvider/>;
|
|
45
54
|
* }
|
|
@@ -60,13 +69,13 @@ const CogsConnectionContext = react_1.default.createContext({
|
|
|
60
69
|
* }
|
|
61
70
|
*
|
|
62
71
|
* function App() {
|
|
63
|
-
* return <CogsConnectionProvider>
|
|
72
|
+
* return <CogsConnectionProvider audioPlayer videoPlayer>
|
|
64
73
|
* <MyComponent />
|
|
65
74
|
* <CogsConnectionProvider/>;
|
|
66
75
|
* }
|
|
67
76
|
* ```
|
|
68
77
|
*/
|
|
69
|
-
function CogsConnectionProvider({ hostname, port, children, }) {
|
|
78
|
+
function CogsConnectionProvider({ hostname, port, children, audioPlayer, videoPlayer, }) {
|
|
70
79
|
const connectionRef = react_1.useRef();
|
|
71
80
|
const [, forceRender] = react_1.useState({});
|
|
72
81
|
react_1.useEffect(() => {
|
|
@@ -78,13 +87,27 @@ function CogsConnectionProvider({ hostname, port, children, }) {
|
|
|
78
87
|
connection.close();
|
|
79
88
|
};
|
|
80
89
|
}, [hostname, port]);
|
|
90
|
+
const audioPlayerRef = react_1.useRef();
|
|
91
|
+
react_1.useEffect(() => {
|
|
92
|
+
if (audioPlayer && !audioPlayerRef.current && connectionRef.current) {
|
|
93
|
+
audioPlayerRef.current = new cogs_client_1.CogsAudioPlayer(connectionRef.current);
|
|
94
|
+
}
|
|
95
|
+
}, [audioPlayer]);
|
|
96
|
+
const videoPlayerRef = react_1.useRef();
|
|
97
|
+
react_1.useEffect(() => {
|
|
98
|
+
if (videoPlayer && !videoPlayerRef.current && connectionRef.current) {
|
|
99
|
+
videoPlayerRef.current = new cogs_client_1.CogsVideoPlayer(connectionRef.current);
|
|
100
|
+
}
|
|
101
|
+
}, [videoPlayer]);
|
|
81
102
|
if (!connectionRef.current) {
|
|
82
|
-
// Do not render if the `useEffect` above
|
|
103
|
+
// Do not render if the `useEffect`s above have not run
|
|
83
104
|
return null;
|
|
84
105
|
}
|
|
85
106
|
const value = {
|
|
86
107
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
87
108
|
useCogsConnection: () => connectionRef.current,
|
|
109
|
+
useAudioPlayer: () => { var _a; return (_a = audioPlayerRef.current) !== null && _a !== void 0 ? _a : null; },
|
|
110
|
+
useVideoPlayer: () => { var _a; return (_a = videoPlayerRef.current) !== null && _a !== void 0 ? _a : null; },
|
|
88
111
|
};
|
|
89
112
|
return react_1.default.createElement(CogsConnectionContext.Provider, { value: value }, children);
|
|
90
113
|
}
|
|
@@ -96,4 +119,18 @@ function useCogsConnection() {
|
|
|
96
119
|
return react_1.useContext(CogsConnectionContext).useCogsConnection();
|
|
97
120
|
}
|
|
98
121
|
exports.useCogsConnection = useCogsConnection;
|
|
122
|
+
/**
|
|
123
|
+
* Get the audio player from `<CogsConnectionProvider audioPlayer>`
|
|
124
|
+
*/
|
|
125
|
+
function useAudioPlayer() {
|
|
126
|
+
return react_1.useContext(CogsConnectionContext).useAudioPlayer();
|
|
127
|
+
}
|
|
128
|
+
exports.useAudioPlayer = useAudioPlayer;
|
|
129
|
+
/**
|
|
130
|
+
* Get the video player from `<CogsConnectionProvider audioPlayer>`
|
|
131
|
+
*/
|
|
132
|
+
function useVideoPlayer() {
|
|
133
|
+
return react_1.useContext(CogsConnectionContext).useVideoPlayer();
|
|
134
|
+
}
|
|
135
|
+
exports.useVideoPlayer = useVideoPlayer;
|
|
99
136
|
//# sourceMappingURL=CogsConnectionProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CogsConnectionProvider.js","sourceRoot":"","sources":["../../src/providers/CogsConnectionProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CogsConnectionProvider.js","sourceRoot":"","sources":["../../src/providers/CogsConnectionProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA6F;AAC7F,+CAAuE;AAUvE,MAAM,qBAAqB,GAAG,eAAK,CAAC,aAAa,CAA6B;IAC5E,iBAAiB,EAAE,GAAG,EAAE,CAAC,SAAgB;IACzC,cAAc,EAAE,GAAG,EAAE,CAAC,SAAgB;IACtC,cAAc,EAAE,GAAG,EAAE,CAAC,SAAgB;CACvC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,SAAwB,sBAAsB,CAAC,EAC7C,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,WAAW,GAOZ;IACC,MAAM,aAAa,GAAG,cAAM,EAAkB,CAAC;IAC/C,MAAM,CAAC,EAAE,WAAW,CAAC,GAAG,gBAAQ,CAAC,EAAE,CAAC,CAAC;I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AAE,GAAG,EAAE,WAAC,OAAA,MAAA,cAAc,CAAC,OAAO,mCAAI,IAAI,CAAA,EAAA;KACrD,CAAC;IAEF,OAAO,8BAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAkC,CAAC;AACnG,CAAC;AArDD,yCAqDC;AAED;;GAEG;AACH,SAAgB,iBAAiB;IAC/B,OAAO,kBAAU,CAAC,qBAA+E,CAAC,CAAC,iBAAiB,EAAE,CAAC;AACzH,CAAC;AAFD,8CAEC;AAED;;GAEG;AACH,SAAgB,cAAc;IAC5B,OAAO,kBAAU,CAAC,qBAAkE,CAAC,CAAC,cAAc,EAAE,CAAC;AACzG,CAAC;AAFD,wCAEC;AAED;;GAEG;AACH,SAAgB,cAAc;IAC5B,OAAO,kBAAU,CAAC,qBAAkE,CAAC,CAAC,cAAc,EAAE,CAAC;AACzG,CAAC;AAFD,wCAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clockworkdog/cogs-client-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "v1.0.0-rc.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"lint:json": "prettier --list-different .eslintrc *.json",
|
|
9
9
|
"lint:ts": "eslint --ext .js,.ts --ignore-path .gitignore .",
|
|
10
10
|
"build": "tsc",
|
|
11
|
+
"watch-build": "tsc -w",
|
|
11
12
|
"build-docs": "typedoc --out docs --name @clockworkdog/cogs-client-react src/index.ts",
|
|
12
13
|
"release": "yarn publish --access public"
|
|
13
14
|
},
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
"typescript": "^4.1.3"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@clockworkdog/cogs-client": "
|
|
34
|
+
"@clockworkdog/cogs-client": "latest"
|
|
34
35
|
},
|
|
35
36
|
"description": "React components and hooks to connect to COGS to build a custom Media Master",
|
|
36
37
|
"repository": {
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CogsConnection, MediaObjectFit } from '@clockworkdog/cogs-client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import VideoClipState from '../types/VideoClipState';
|
|
4
|
-
export interface VideoClip {
|
|
5
|
-
src: string;
|
|
6
|
-
state: VideoClipState;
|
|
7
|
-
volume: number;
|
|
8
|
-
loop: boolean;
|
|
9
|
-
fit: MediaObjectFit;
|
|
10
|
-
}
|
|
11
|
-
export default function Video({ className, style, connection, fullscreen, onStopped, getCachedAsset }: {
|
|
12
|
-
className?: string;
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
connection: CogsConnection;
|
|
15
|
-
fullscreen?: boolean | {
|
|
16
|
-
style: React.CSSProperties;
|
|
17
|
-
};
|
|
18
|
-
onStopped?: () => void;
|
|
19
|
-
getCachedAsset?: (assetUrl: string) => string | undefined;
|
|
20
|
-
}): JSX.Element | null;
|
package/dist/components/Video.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
const cogs_client_1 = require("@clockworkdog/cogs-client");
|
|
26
|
-
const react_1 = __importStar(require("react"));
|
|
27
|
-
const useCogsMessage_1 = __importDefault(require("../hooks/useCogsMessage"));
|
|
28
|
-
const VideoClipState_1 = __importDefault(require("../types/VideoClipState"));
|
|
29
|
-
function Video({ className, style, connection, fullscreen, onStopped, getCachedAsset }) {
|
|
30
|
-
var _a;
|
|
31
|
-
const [globalVolume, setGlobalVolume] = react_1.useState(1);
|
|
32
|
-
const [videoClip, setVideoClip] = react_1.useState(null);
|
|
33
|
-
useCogsMessage_1.default(connection, react_1.useCallback((message) => {
|
|
34
|
-
var _a;
|
|
35
|
-
switch (message.type) {
|
|
36
|
-
case 'media_config_update':
|
|
37
|
-
setGlobalVolume(message.globalVolume);
|
|
38
|
-
break;
|
|
39
|
-
case 'video_play':
|
|
40
|
-
setVideoClip({
|
|
41
|
-
src: cogs_client_1.assetUrl(message.file),
|
|
42
|
-
volume: message.volume,
|
|
43
|
-
fit: message.fit,
|
|
44
|
-
loop: (_a = message.loop) !== null && _a !== void 0 ? _a : false,
|
|
45
|
-
state: VideoClipState_1.default.Playing,
|
|
46
|
-
});
|
|
47
|
-
break;
|
|
48
|
-
case 'video_pause':
|
|
49
|
-
setVideoClip((video) => (video ? { ...video, state: VideoClipState_1.default.Paused } : null));
|
|
50
|
-
break;
|
|
51
|
-
case 'video_stop':
|
|
52
|
-
setVideoClip(null);
|
|
53
|
-
break;
|
|
54
|
-
case 'video_set_volume':
|
|
55
|
-
setVideoClip((video) => (video ? { ...video, volume: message.volume } : null));
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
}, []));
|
|
59
|
-
const ref = react_1.useRef(null);
|
|
60
|
-
react_1.useEffect(() => {
|
|
61
|
-
if (ref.current) {
|
|
62
|
-
switch (videoClip === null || videoClip === void 0 ? void 0 : videoClip.state) {
|
|
63
|
-
case VideoClipState_1.default.Playing:
|
|
64
|
-
ref.current.play();
|
|
65
|
-
break;
|
|
66
|
-
case VideoClipState_1.default.Paused:
|
|
67
|
-
ref.current.pause();
|
|
68
|
-
break;
|
|
69
|
-
case VideoClipState_1.default.Stopped:
|
|
70
|
-
ref.current.currentTime = 0;
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}, [videoClip]);
|
|
75
|
-
react_1.useEffect(() => {
|
|
76
|
-
var _a;
|
|
77
|
-
if (ref.current) {
|
|
78
|
-
ref.current.volume = (_a = videoClip === null || videoClip === void 0 ? void 0 : videoClip.volume) !== null && _a !== void 0 ? _a : 1 * globalVolume;
|
|
79
|
-
}
|
|
80
|
-
}, [videoClip, globalVolume]);
|
|
81
|
-
react_1.useEffect(() => {
|
|
82
|
-
var _a;
|
|
83
|
-
if (ref.current) {
|
|
84
|
-
ref.current.loop = (_a = videoClip === null || videoClip === void 0 ? void 0 : videoClip.loop) !== null && _a !== void 0 ? _a : false;
|
|
85
|
-
}
|
|
86
|
-
}, [videoClip]);
|
|
87
|
-
const notifyVideoStopped = react_1.useCallback(() => {
|
|
88
|
-
if (!(videoClip === null || videoClip === void 0 ? void 0 : videoClip.loop)) {
|
|
89
|
-
setVideoClip(null);
|
|
90
|
-
onStopped === null || onStopped === void 0 ? void 0 : onStopped();
|
|
91
|
-
}
|
|
92
|
-
}, [videoClip, onStopped]);
|
|
93
|
-
if (!videoClip) {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
const video = (react_1.default.createElement("video", { className: className, ref: ref, style: {
|
|
97
|
-
objectFit: videoClip.fit,
|
|
98
|
-
...(fullscreen ? { width: '100%', height: '100%' } : {}),
|
|
99
|
-
...style,
|
|
100
|
-
}, src: (_a = (getCachedAsset && getCachedAsset(videoClip.src))) !== null && _a !== void 0 ? _a : videoClip.src, onEnded: notifyVideoStopped }));
|
|
101
|
-
const fullscreenCustomStyle = typeof fullscreen === 'object' ? fullscreen.style : undefined;
|
|
102
|
-
return fullscreen ? (react_1.default.createElement("div", { style: { position: 'absolute', zIndex: 1, top: 0, left: 0, width: '100vw', height: '100vh', ...fullscreenCustomStyle } }, video)) : (video);
|
|
103
|
-
}
|
|
104
|
-
exports.default = Video;
|
|
105
|
-
//# sourceMappingURL=Video.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Video.js","sourceRoot":"","sources":["../../src/components/Video.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAAwG;AACxG,+CAAwE;AACxE,6EAAqD;AACrD,6EAAqD;AAUrD,SAAwB,KAAK,CAAC,EAC5B,SAAS,EACT,KAAK,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,cAAc,EAQf;;IACC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,gBAAQ,CAAC,CAAC,CAAC,CAAC;IAEpD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,gBAAQ,CAAmB,IAAI,CAAC,CAAC;IAEnE,wBAAc,CACZ,UAAU,EACV,mBAAW,CAAC,CAAC,OAA0B,EAAE,EAAE;;QACzC,QAAQ,OAAO,CAAC,IAAI,EAAE;YACpB,KAAK,qBAAqB;gBACxB,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;gBACtC,MAAM;YACR,KAAK,YAAY;gBACf,YAAY,CAAC;oBACX,GAAG,EAAE,sBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;oBAC3B,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,GAAG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B,GAC3B,CACH,CAAC;IAEF,MAAM,qBAAqB,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5F,OAAO,UAAU,CAAC,CAAC,CAAC,CAClB,uCAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,qBAAqB,EAAE,IAAG,KAAK,CAAO,CAC3I,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CAAC;AACJ,CAAC;AA7GD,wBA6GC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var ActiveAudioClipState;
|
|
4
|
-
(function (ActiveAudioClipState) {
|
|
5
|
-
ActiveAudioClipState["Paused"] = "paused";
|
|
6
|
-
ActiveAudioClipState["Pausing"] = "pausing";
|
|
7
|
-
ActiveAudioClipState["Playing"] = "playing";
|
|
8
|
-
ActiveAudioClipState["Stopping"] = "stopping";
|
|
9
|
-
})(ActiveAudioClipState || (ActiveAudioClipState = {}));
|
|
10
|
-
exports.default = ActiveAudioClipState;
|
|
11
|
-
//# sourceMappingURL=ActiveAudioClipState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveAudioClipState.js","sourceRoot":"","sources":["../../src/types/ActiveAudioClipState.ts"],"names":[],"mappings":";;AAAA,IAAK,oBAKJ;AALD,WAAK,oBAAoB;IACvB,yCAAiB,CAAA;IACjB,2CAAmB,CAAA;IACnB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;AACvB,CAAC,EALI,oBAAoB,KAApB,oBAAoB,QAKxB;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var VideoClipState;
|
|
4
|
-
(function (VideoClipState) {
|
|
5
|
-
VideoClipState["Playing"] = "playing";
|
|
6
|
-
VideoClipState["Paused"] = "paused";
|
|
7
|
-
VideoClipState["Stopped"] = "stopped";
|
|
8
|
-
})(VideoClipState || (VideoClipState = {}));
|
|
9
|
-
exports.default = VideoClipState;
|
|
10
|
-
//# sourceMappingURL=VideoClipState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VideoClipState.js","sourceRoot":"","sources":["../../src/types/VideoClipState.ts"],"names":[],"mappings":";;AAAA,IAAK,cAIJ;AAJD,WAAK,cAAc;IACjB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;AACrB,CAAC,EAJI,cAAc,KAAd,cAAc,QAIlB;AAED,kBAAe,cAAc,CAAC"}
|