@clockworkdog/cogs-client 0.14.0 → 0.17.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/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { default as CogsConnection } from './CogsConnection';
2
2
  export { default as CogsClientMessage } from './types/CogsClientMessage';
3
+ export { default as MediaClipStateMessage } from './types/MediaClipStateMessage';
3
4
  export * from './types/valueTypes';
4
5
  export { default as MediaObjectFit } from './types/MediaObjectFit';
5
- export { default as BackgroundOptions } from './types/BackgroundOptions';
6
6
  export { default as CogsAudioPlayer } from './AudioPlayer';
7
+ export { default as CogsVideoPlayer } from './VideoPlayer';
7
8
  export * from './types/AudioState';
8
9
  export { assetUrl } from './helpers/urls';
9
10
  export { preloadUrl } from './helpers/urls';
package/dist/index.js CHANGED
@@ -13,12 +13,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
14
14
  };
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.preloadUrl = exports.assetUrl = exports.CogsAudioPlayer = exports.CogsConnection = void 0;
16
+ exports.preloadUrl = exports.assetUrl = exports.CogsVideoPlayer = exports.CogsAudioPlayer = exports.CogsConnection = void 0;
17
17
  var CogsConnection_1 = require("./CogsConnection");
18
18
  Object.defineProperty(exports, "CogsConnection", { enumerable: true, get: function () { return __importDefault(CogsConnection_1).default; } });
19
19
  __exportStar(require("./types/valueTypes"), exports);
20
20
  var AudioPlayer_1 = require("./AudioPlayer");
21
21
  Object.defineProperty(exports, "CogsAudioPlayer", { enumerable: true, get: function () { return __importDefault(AudioPlayer_1).default; } });
22
+ var VideoPlayer_1 = require("./VideoPlayer");
23
+ Object.defineProperty(exports, "CogsVideoPlayer", { enumerable: true, get: function () { return __importDefault(VideoPlayer_1).default; } });
22
24
  __exportStar(require("./types/AudioState"), exports);
23
25
  var urls_1 = require("./helpers/urls");
24
26
  Object.defineProperty(exports, "assetUrl", { enumerable: true, get: function () { return urls_1.assetUrl; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAA6D;AAApD,iIAAA,OAAO,OAAkB;AAElC,qDAAmC;AAGnC,6CAA2D;AAAlD,+HAAA,OAAO,OAAmB;AACnC,qDAAmC;AACnC,uCAA0C;AAAjC,gGAAA,QAAQ,OAAA;AACjB,uCAA4C;AAAnC,kGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAA6D;AAApD,iIAAA,OAAO,OAAkB;AAGlC,qDAAmC;AAEnC,6CAA2D;AAAlD,+HAAA,OAAO,OAAmB;AACnC,6CAA2D;AAAlD,+HAAA,OAAO,OAAmB;AACnC,qDAAmC;AACnC,uCAA0C;AAAjC,gGAAA,QAAQ,OAAA;AACjB,uCAA4C;AAAnC,kGAAA,UAAU,OAAA"}
@@ -0,0 +1,5 @@
1
+ export declare type MediaStatus = 'playing' | 'paused' | 'stopped';
2
+ export default interface AllMediaClipStatesMessage {
3
+ mediaType: 'audio' | 'video';
4
+ files: [string, MediaStatus][];
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=AllMediaClipStatesMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllMediaClipStatesMessage.js","sourceRoot":"","sources":["../../src/types/AllMediaClipStatesMessage.ts"],"names":[],"mappings":""}
@@ -17,6 +17,7 @@ export interface ActiveClip {
17
17
  state: ActiveAudioClipState;
18
18
  loop: boolean;
19
19
  volume: number;
20
+ playId: string;
20
21
  }
21
22
  export interface AudioState {
22
23
  isPlaying: boolean;
@@ -1,5 +1,12 @@
1
- import BackgroundOptions from './BackgroundOptions';
2
1
  import MediaObjectFit from './MediaObjectFit';
2
+ import { ShowPhase } from './valueTypes';
3
+ interface ShowResetMessage {
4
+ type: 'show_reset';
5
+ }
6
+ interface ShowPhaseMessage {
7
+ type: 'show_phase';
8
+ phase: ShowPhase;
9
+ }
3
10
  interface AdjustableTimerUpdateMessage {
4
11
  type: 'adjustable_timer_update';
5
12
  ticking: boolean;
@@ -15,12 +22,13 @@ interface MediaClientConfigMessage {
15
22
  files: {
16
23
  [path: string]: {
17
24
  preload: boolean;
25
+ type: 'audio' | 'video';
18
26
  };
19
27
  };
20
- background?: BackgroundOptions;
21
28
  }
22
29
  declare type MediaClientMessage = {
23
30
  type: 'audio_play';
31
+ playId: string;
24
32
  file: string;
25
33
  fade?: number;
26
34
  loop?: true;
@@ -40,20 +48,33 @@ declare type MediaClientMessage = {
40
48
  fade?: number;
41
49
  } | {
42
50
  type: 'video_play';
51
+ playId: string;
43
52
  file: string;
44
53
  loop?: true;
45
54
  volume: number;
46
55
  fit: MediaObjectFit;
47
56
  } | {
48
57
  type: 'video_pause';
49
- file: string;
50
58
  } | {
51
59
  type: 'video_stop';
52
- file?: string;
53
60
  } | {
54
61
  type: 'video_set_volume';
55
- file: string;
56
62
  volume: number;
63
+ } | {
64
+ type: 'video_set_fit';
65
+ fit: MediaObjectFit;
66
+ } | {
67
+ type: 'image_show';
68
+ file: string;
69
+ fit: MediaObjectFit;
70
+ hideOthers?: boolean;
71
+ } | {
72
+ type: 'image_hide';
73
+ file?: string;
74
+ } | {
75
+ type: 'image_set_fit';
76
+ file: string;
77
+ fit: MediaObjectFit;
57
78
  };
58
- export declare type CogsClientMessage = AdjustableTimerUpdateMessage | TextHintsUpdateMessage | MediaClientConfigMessage | MediaClientMessage;
79
+ export declare type CogsClientMessage<CustomConfig = {}> = ShowResetMessage | ShowPhaseMessage | AdjustableTimerUpdateMessage | TextHintsUpdateMessage | (MediaClientConfigMessage & CustomConfig) | MediaClientMessage;
59
80
  export default CogsClientMessage;
@@ -0,0 +1,7 @@
1
+ export declare type MediaStatus = 'playing' | 'paused' | 'stopped';
2
+ export default interface MediaClipStateMessage {
3
+ playId: string;
4
+ mediaType: 'audio' | 'video';
5
+ file: string;
6
+ status: MediaStatus;
7
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=BackgroundOptions.js.map
3
+ //# sourceMappingURL=MediaClipStateMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaClipStateMessage.js","sourceRoot":"","sources":["../../src/types/MediaClipStateMessage.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { MediaObjectFit } from '..';
2
+ export declare enum ActiveVideoClipState {
3
+ Paused = "paused",
4
+ Playing = "playing"
5
+ }
6
+ export interface VideoClip {
7
+ config: {
8
+ preload: boolean;
9
+ ephemeral: boolean;
10
+ fit: MediaObjectFit;
11
+ };
12
+ }
13
+ export interface ActiveClip {
14
+ path: string;
15
+ state: ActiveVideoClipState;
16
+ loop: boolean;
17
+ volume: number;
18
+ }
19
+ export interface VideoState {
20
+ isPlaying: boolean;
21
+ globalVolume: number;
22
+ clips: {
23
+ [path: string]: VideoClip;
24
+ };
25
+ activeClip?: ActiveClip;
26
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActiveVideoClipState = void 0;
4
+ var ActiveVideoClipState;
5
+ (function (ActiveVideoClipState) {
6
+ ActiveVideoClipState["Paused"] = "paused";
7
+ ActiveVideoClipState["Playing"] = "playing";
8
+ })(ActiveVideoClipState = exports.ActiveVideoClipState || (exports.ActiveVideoClipState = {}));
9
+ //# sourceMappingURL=VideoState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VideoState.js","sourceRoot":"","sources":["../../src/types/VideoState.ts"],"names":[],"mappings":";;;AAEA,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,2CAAmB,CAAA;AACrB,CAAC,EAHW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAG/B"}
@@ -1,6 +1,12 @@
1
1
  export declare type PortValue = string | number | boolean;
2
2
  export declare type ConfigValue = string | number | boolean;
3
3
  export declare type EventValue = string | number | boolean;
4
+ export declare enum ShowPhase {
5
+ Setup = "setup",
6
+ Preshow = "pre-show",
7
+ InProgress = "in progress",
8
+ Finished = "finished"
9
+ }
4
10
  export declare type EventKeyValue<TypeMap extends {
5
11
  [key: string]: EventValue | null;
6
12
  }, Key extends keyof TypeMap = keyof TypeMap> = Key extends string ? TypeMap[Key] extends null ? {
@@ -1,3 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShowPhase = void 0;
4
+ var ShowPhase;
5
+ (function (ShowPhase) {
6
+ ShowPhase["Setup"] = "setup";
7
+ ShowPhase["Preshow"] = "pre-show";
8
+ ShowPhase["InProgress"] = "in progress";
9
+ ShowPhase["Finished"] = "finished";
10
+ })(ShowPhase = exports.ShowPhase || (exports.ShowPhase = {}));
3
11
  //# sourceMappingURL=valueTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"valueTypes.js","sourceRoot":"","sources":["../../src/types/valueTypes.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"valueTypes.js","sourceRoot":"","sources":["../../src/types/valueTypes.ts"],"names":[],"mappings":";;;AAIA,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,iCAAoB,CAAA;IACpB,uCAA0B,CAAA;IAC1B,kCAAqB,CAAA;AACvB,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clockworkdog/cogs-client",
3
- "version": "0.14.0",
3
+ "version": "v0.17.0-rc.1",
4
4
  "main": "dist/index.js",
5
5
  "unpkg": "dist/browser/index.js",
6
6
  "scripts": {
@@ -9,13 +9,14 @@
9
9
  "lint:json": "prettier --list-different .eslintrc *.json",
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
+ "watch-build": "tsc -w",
12
13
  "release": "yarn publish --access public"
13
14
  },
14
15
  "keywords": [],
15
16
  "author": "Clockwork Dog <info@clockwork.dog>",
16
17
  "license": "MIT",
17
18
  "devDependencies": {
18
- "@types/howler": "^2.2.2",
19
+ "@types/howler": "^2.2.4",
19
20
  "@typescript-eslint/eslint-plugin": "^4.12.0",
20
21
  "@typescript-eslint/parser": "^4.12.0",
21
22
  "browserify": "^17.0.0",
@@ -26,7 +27,7 @@
26
27
  "typescript": "^4.1.3"
27
28
  },
28
29
  "dependencies": {
29
- "howler": "^2.2.1",
30
+ "howler": "^2.2.3",
30
31
  "reconnecting-websocket": "^4.4.0"
31
32
  },
32
33
  "description": "Connect to COGS to build a custom Media Master",
@@ -1,8 +0,0 @@
1
- import MediaObjectFit from './MediaObjectFit';
2
- export default interface BackgroundOptions {
3
- color: string;
4
- image?: {
5
- file: string;
6
- fit: MediaObjectFit;
7
- };
8
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"BackgroundOptions.js","sourceRoot":"","sources":["../../src/types/BackgroundOptions.ts"],"names":[],"mappings":""}