@clockworkdog/cogs-client 2.0.0-beta.5 → 2.1.0
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/dist/AudioPlayer.d.ts +1 -0
- package/dist/AudioPlayer.js +4 -4
- package/dist/CogsConnection.d.ts +12 -0
- package/dist/CogsConnection.js +59 -10
- package/dist/VideoPlayer.d.ts +1 -0
- package/dist/VideoPlayer.js +2 -2
- package/dist/browser/index.js +302 -28
- package/dist/helpers/urls.d.ts +9 -0
- package/dist/helpers/urls.js +10 -3
- package/dist/types/CogsClientMessage.d.ts +6 -1
- package/package.json +4 -1
package/dist/helpers/urls.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export declare const COGS_ASSETS_SERVER_PORT = 12094;
|
|
1
2
|
export declare const COGS_SERVER_PORT = 12095;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use {@link CogsConnection#getAssetUrl} instead. Or pass a boolean to say if you want a
|
|
5
|
+
* HTTP/2 asset URL or not.
|
|
6
|
+
*/
|
|
2
7
|
export declare function assetUrl(file: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Returns a URL for the asset. This is different based on if HTTP/2 is requested or not
|
|
10
|
+
*/
|
|
11
|
+
export declare function assetUrl(file: string, useHttp2AssetsServer: boolean): string;
|
|
3
12
|
export declare function preloadUrl(url: string): Promise<string>;
|
package/dist/helpers/urls.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.preloadUrl = exports.assetUrl = exports.COGS_SERVER_PORT = void 0;
|
|
3
|
+
exports.preloadUrl = exports.assetUrl = exports.COGS_SERVER_PORT = exports.COGS_ASSETS_SERVER_PORT = void 0;
|
|
4
|
+
exports.COGS_ASSETS_SERVER_PORT = 12094;
|
|
4
5
|
exports.COGS_SERVER_PORT = 12095;
|
|
5
|
-
function assetUrl(file) {
|
|
6
|
+
function assetUrl(file, useHttp2AssetsServer) {
|
|
6
7
|
const location = typeof window !== 'undefined' ? window.location : undefined;
|
|
7
|
-
|
|
8
|
+
const path = `/assets/${encodeURIComponent(file)}`;
|
|
9
|
+
if (useHttp2AssetsServer) {
|
|
10
|
+
return `https://${location === null || location === void 0 ? void 0 : location.hostname}:${exports.COGS_ASSETS_SERVER_PORT}${path}`;
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return `${location === null || location === void 0 ? void 0 : location.protocol}//${location === null || location === void 0 ? void 0 : location.hostname}:${exports.COGS_SERVER_PORT}${path}`;
|
|
14
|
+
}
|
|
8
15
|
}
|
|
9
16
|
exports.assetUrl = assetUrl;
|
|
10
17
|
async function preloadUrl(url) {
|
|
@@ -16,6 +16,11 @@ interface TextHintsUpdateMessage {
|
|
|
16
16
|
type: 'text_hints_update';
|
|
17
17
|
lastSentHint: string;
|
|
18
18
|
}
|
|
19
|
+
interface CogsEnvironmentMessage {
|
|
20
|
+
type: 'cogs_environment';
|
|
21
|
+
cogsVersion: string;
|
|
22
|
+
http2AssetsServer: boolean;
|
|
23
|
+
}
|
|
19
24
|
export type Media = {
|
|
20
25
|
type: 'audio';
|
|
21
26
|
preload: boolean;
|
|
@@ -81,5 +86,5 @@ type MediaClientMessage = {
|
|
|
81
86
|
file: string;
|
|
82
87
|
fit: MediaObjectFit;
|
|
83
88
|
};
|
|
84
|
-
export type CogsClientMessage<CustomConfig = {}> = ShowResetMessage | ShowPhaseMessage | AdjustableTimerUpdateMessage | TextHintsUpdateMessage | (MediaClientConfigMessage & CustomConfig) | MediaClientMessage;
|
|
89
|
+
export type CogsClientMessage<CustomConfig = {}> = ShowResetMessage | ShowPhaseMessage | AdjustableTimerUpdateMessage | TextHintsUpdateMessage | (MediaClientConfigMessage & CustomConfig) | CogsEnvironmentMessage | MediaClientMessage;
|
|
85
90
|
export default CogsClientMessage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clockworkdog/cogs-client",
|
|
3
|
-
"version": "v2.
|
|
3
|
+
"version": "v2.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"unpkg": "dist/browser/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"lint:ts": "eslint --ext .js,.ts --ignore-path .gitignore .",
|
|
11
11
|
"build": "tsc && browserify --debug --standalone COGS dist/index.js -o dist/browser/index.js",
|
|
12
12
|
"watch-build": "tsc -w",
|
|
13
|
+
"build-docs": "typedoc --out docs --name @clockworkdog/cogs-client src/index.ts",
|
|
13
14
|
"release": "yarn publish --access public"
|
|
14
15
|
},
|
|
15
16
|
"keywords": [],
|
|
@@ -25,10 +26,12 @@
|
|
|
25
26
|
"eslint-config-prettier": "^7.1.0",
|
|
26
27
|
"eslint-plugin-prettier": "^3.3.1",
|
|
27
28
|
"prettier": "^2.2.1",
|
|
29
|
+
"typedoc": "^0.25.7",
|
|
28
30
|
"typescript": "^5.1.6"
|
|
29
31
|
},
|
|
30
32
|
"dependencies": {
|
|
31
33
|
"@clockworkdog/media-stream-library-browser": "^11.1.1-fixes.6",
|
|
34
|
+
"compare-versions": "^6.1.0",
|
|
32
35
|
"howler": "clockwork-dog/howler.js#fix-looping-clips",
|
|
33
36
|
"reconnecting-websocket": "^4.4.0"
|
|
34
37
|
},
|