@sprucelabs/heartwood-view-controllers 118.0.23 → 118.0.24
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/build/.spruce/errors/errors.types.d.ts +12 -0
- package/build/.spruce/errors/heartwoodViewControllers/didNotGenerateOffer.schema.d.ts +3 -0
- package/build/.spruce/errors/heartwoodViewControllers/didNotGenerateOffer.schema.js +12 -0
- package/build/.spruce/errors/options.types.d.ts +4 -1
- package/build/.spruce/schemas/heartwoodViewControllers/v2021_02_11/webRtcPlayer.schema.d.ts +3 -0
- package/build/.spruce/schemas/heartwoodViewControllers/v2021_02_11/webRtcPlayer.schema.js +29 -0
- package/build/.spruce/schemas/schemas.types.d.ts +37 -0
- package/build/controllerMap.d.ts +2 -2
- package/build/controllerMap.js +2 -2
- package/build/errors/SpruceError.js +3 -0
- package/build/errors/didNotGenerateOffer.builder.d.ts +6 -0
- package/build/errors/didNotGenerateOffer.builder.js +8 -0
- package/build/esm/.spruce/errors/errors.types.d.ts +12 -0
- package/build/esm/.spruce/errors/options.types.d.ts +4 -1
- package/build/esm/.spruce/schemas/heartwoodViewControllers/v2021_02_11/webRtcPlayer.schema.d.ts +3 -0
- package/build/esm/.spruce/schemas/heartwoodViewControllers/v2021_02_11/webRtcPlayer.schema.js +27 -0
- package/build/esm/.spruce/schemas/schemas.types.d.ts +37 -0
- package/build/esm/controllerMap.d.ts +2 -2
- package/build/esm/controllerMap.js +2 -2
- package/build/esm/errors/SpruceError.js +3 -0
- package/build/esm/errors/didNotGenerateOffer.builder.d.ts +6 -0
- package/build/esm/errors/didNotGenerateOffer.builder.js +6 -0
- package/build/esm/index.d.ts +3 -0
- package/build/esm/index.js +3 -0
- package/build/esm/schemas/v2021_02_11/webRtcPlayer.builder.d.ts +21 -0
- package/build/esm/schemas/v2021_02_11/webRtcPlayer.builder.js +21 -0
- package/build/esm/tests/MockRtcPeerConnection.d.ts +2 -1
- package/build/esm/tests/MockRtcPeerConnection.js +6 -2
- package/build/esm/types/heartwood.types.d.ts +4 -3
- package/build/esm/viewControllers/webRtcStreaming/WebRtcPlayer.vc.d.ts +14 -0
- package/build/esm/viewControllers/webRtcStreaming/WebRtcPlayer.vc.js +51 -0
- package/build/esm/webRtcStreaming/WebRtcConnection.d.ts +5 -12
- package/build/esm/webRtcStreaming/WebRtcStreamer.d.ts +3 -2
- package/build/esm/webRtcStreaming/WebRtcStreamer.js +2 -1
- package/build/index.d.ts +3 -0
- package/build/index.js +9 -4
- package/build/schemas/v2021_02_11/webRtcPlayer.builder.d.ts +21 -0
- package/build/schemas/v2021_02_11/webRtcPlayer.builder.js +23 -0
- package/build/tests/MockRtcPeerConnection.d.ts +2 -1
- package/build/tests/MockRtcPeerConnection.js +4 -2
- package/build/types/heartwood.types.d.ts +4 -3
- package/build/viewControllers/webRtcStreaming/WebRtcPlayer.vc.d.ts +14 -0
- package/build/viewControllers/webRtcStreaming/WebRtcPlayer.vc.js +43 -0
- package/build/webRtcStreaming/WebRtcConnection.d.ts +5 -12
- package/build/webRtcStreaming/WebRtcStreamer.d.ts +3 -2
- package/build/webRtcStreaming/WebRtcStreamer.js +1 -1
- package/package.json +1 -1
- package/build/esm/viewControllers/webRtcStreaming/WebRtcStreamingCard.vc.d.ts +0 -10
- package/build/esm/viewControllers/webRtcStreaming/WebRtcStreamingCard.vc.js +0 -22
- package/build/viewControllers/webRtcStreaming/WebRtcStreamingCard.vc.d.ts +0 -10
- package/build/viewControllers/webRtcStreaming/WebRtcStreamingCard.vc.js +0 -24
|
@@ -327,6 +327,18 @@ export declare namespace SpruceErrors.HeartwoodViewControllers {
|
|
|
327
327
|
}
|
|
328
328
|
type DuplicateEventIdEntity = SchemaEntity<SpruceErrors.HeartwoodViewControllers.DuplicateEventIdSchema>;
|
|
329
329
|
}
|
|
330
|
+
export declare namespace SpruceErrors.HeartwoodViewControllers {
|
|
331
|
+
interface DidNotGenerateOffer {
|
|
332
|
+
}
|
|
333
|
+
interface DidNotGenerateOfferSchema extends SpruceSchema.Schema {
|
|
334
|
+
id: 'didNotGenerateOffer';
|
|
335
|
+
namespace: 'HeartwoodViewControllers';
|
|
336
|
+
name: 'Did not generate offer';
|
|
337
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers';
|
|
338
|
+
fields: {};
|
|
339
|
+
}
|
|
340
|
+
type DidNotGenerateOfferEntity = SchemaEntity<SpruceErrors.HeartwoodViewControllers.DidNotGenerateOfferSchema>;
|
|
341
|
+
}
|
|
330
342
|
export declare namespace SpruceErrors.HeartwoodViewControllers {
|
|
331
343
|
interface DateNotSelected {
|
|
332
344
|
'year': number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
4
|
+
const didNotGenerateOfferSchema = {
|
|
5
|
+
id: 'didNotGenerateOffer',
|
|
6
|
+
namespace: 'HeartwoodViewControllers',
|
|
7
|
+
name: 'Did not generate offer',
|
|
8
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers',
|
|
9
|
+
fields: {}
|
|
10
|
+
};
|
|
11
|
+
schema_1.SchemaRegistry.getInstance().trackSchema(didNotGenerateOfferSchema);
|
|
12
|
+
exports.default = didNotGenerateOfferSchema;
|
|
@@ -51,6 +51,9 @@ export interface DuplicateRowIdErrorOptions extends SpruceErrors.HeartwoodViewCo
|
|
|
51
51
|
export interface DuplicateEventIdErrorOptions extends SpruceErrors.HeartwoodViewControllers.DuplicateEventId, ISpruceErrorOptions {
|
|
52
52
|
code: 'DUPLICATE_EVENT_ID';
|
|
53
53
|
}
|
|
54
|
+
export interface DidNotGenerateOfferErrorOptions extends SpruceErrors.HeartwoodViewControllers.DidNotGenerateOffer, ISpruceErrorOptions {
|
|
55
|
+
code: 'DID_NOT_GENERATE_OFFER';
|
|
56
|
+
}
|
|
54
57
|
export interface DateNotSelectedErrorOptions extends SpruceErrors.HeartwoodViewControllers.DateNotSelected, ISpruceErrorOptions {
|
|
55
58
|
code: 'DATE_NOT_SELECTED';
|
|
56
59
|
}
|
|
@@ -63,5 +66,5 @@ export interface CellDeletedErrorOptions extends SpruceErrors.HeartwoodViewContr
|
|
|
63
66
|
export interface AppNotFoundErrorOptions extends SpruceErrors.HeartwoodViewControllers.AppNotFound, ISpruceErrorOptions {
|
|
64
67
|
code: 'APP_NOT_FOUND';
|
|
65
68
|
}
|
|
66
|
-
type ErrorOptions = ViewAlreadyDestroyedErrorOptions | ToolNotFoundErrorOptions | StepNotCompleteErrorOptions | SlideNotFoundErrorOptions | RowDeletedErrorOptions | PersonNotFoundErrorOptions | NoFieldVcSetErrorOptions | MissingStorageErrorOptions | InvalidViewControllerSourceErrorOptions | InvalidViewControllerNameErrorOptions | InvalidSkillViewControllerErrorOptions | InvalidAppControllerErrorOptions | ExportFailedErrorOptions | EventNotFoundErrorOptions | DuplicateToolIdErrorOptions | DuplicateRowIdErrorOptions | DuplicateEventIdErrorOptions | DateNotSelectedErrorOptions | DateAlreadySelectedErrorOptions | CellDeletedErrorOptions | AppNotFoundErrorOptions;
|
|
69
|
+
type ErrorOptions = ViewAlreadyDestroyedErrorOptions | ToolNotFoundErrorOptions | StepNotCompleteErrorOptions | SlideNotFoundErrorOptions | RowDeletedErrorOptions | PersonNotFoundErrorOptions | NoFieldVcSetErrorOptions | MissingStorageErrorOptions | InvalidViewControllerSourceErrorOptions | InvalidViewControllerNameErrorOptions | InvalidSkillViewControllerErrorOptions | InvalidAppControllerErrorOptions | ExportFailedErrorOptions | EventNotFoundErrorOptions | DuplicateToolIdErrorOptions | DuplicateRowIdErrorOptions | DuplicateEventIdErrorOptions | DidNotGenerateOfferErrorOptions | DateNotSelectedErrorOptions | DateAlreadySelectedErrorOptions | CellDeletedErrorOptions | AppNotFoundErrorOptions;
|
|
67
70
|
export default ErrorOptions;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
4
|
+
const webRtcPlayerSchema = {
|
|
5
|
+
id: 'webRtcPlayer',
|
|
6
|
+
version: 'v2021_02_11',
|
|
7
|
+
namespace: 'HeartwoodViewControllers',
|
|
8
|
+
name: '',
|
|
9
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers',
|
|
10
|
+
fields: {
|
|
11
|
+
/** . */
|
|
12
|
+
'id': {
|
|
13
|
+
type: 'id',
|
|
14
|
+
options: undefined
|
|
15
|
+
},
|
|
16
|
+
/** . */
|
|
17
|
+
'controller': {
|
|
18
|
+
type: 'raw',
|
|
19
|
+
options: { valueType: `HeartwoodTypes.ViewController<HeartwoodTypes.WebRtcPlayer>`, }
|
|
20
|
+
},
|
|
21
|
+
/** . */
|
|
22
|
+
'streamer': {
|
|
23
|
+
type: 'raw',
|
|
24
|
+
options: { valueType: `HeartwoodTypes.WebRtcStreamer`, }
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
schema_1.SchemaRegistry.getInstance().trackSchema(webRtcPlayerSchema);
|
|
29
|
+
exports.default = webRtcPlayerSchema;
|
|
@@ -704,6 +704,43 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
704
704
|
interface InputEntity extends SchemaEntity<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.InputSchema> {
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
|
+
namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
|
|
708
|
+
interface WebRtcPlayer {
|
|
709
|
+
'id'?: string | undefined | null;
|
|
710
|
+
'controller'?: (HeartwoodTypes.ViewController<HeartwoodTypes.WebRtcPlayer>) | undefined | null;
|
|
711
|
+
'streamer'?: (HeartwoodTypes.WebRtcStreamer) | undefined | null;
|
|
712
|
+
}
|
|
713
|
+
interface WebRtcPlayerSchema extends SpruceSchema.Schema {
|
|
714
|
+
id: 'webRtcPlayer';
|
|
715
|
+
version: 'v2021_02_11';
|
|
716
|
+
namespace: 'HeartwoodViewControllers';
|
|
717
|
+
name: '';
|
|
718
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers';
|
|
719
|
+
fields: {
|
|
720
|
+
/** . */
|
|
721
|
+
'id': {
|
|
722
|
+
type: 'id';
|
|
723
|
+
options: undefined;
|
|
724
|
+
};
|
|
725
|
+
/** . */
|
|
726
|
+
'controller': {
|
|
727
|
+
type: 'raw';
|
|
728
|
+
options: {
|
|
729
|
+
valueType: `HeartwoodTypes.ViewController<HeartwoodTypes.WebRtcPlayer>`;
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
/** . */
|
|
733
|
+
'streamer': {
|
|
734
|
+
type: 'raw';
|
|
735
|
+
options: {
|
|
736
|
+
valueType: `HeartwoodTypes.WebRtcStreamer`;
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
interface WebRtcPlayerEntity extends SchemaEntity<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.WebRtcPlayerSchema> {
|
|
742
|
+
}
|
|
743
|
+
}
|
|
707
744
|
namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
|
|
708
745
|
interface ToolBeltTool {
|
|
709
746
|
/** Id. */
|
package/build/controllerMap.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ import StatsViewController from './viewControllers/reporting/Stats.vc';
|
|
|
27
27
|
import SwipeCardViewController from './viewControllers/SwipeCard.vc';
|
|
28
28
|
import TalkingSprucebotViewController from './viewControllers/TalkingSprucebot.vc';
|
|
29
29
|
import ToolBeltViewController from './viewControllers/ToolBelt.vc';
|
|
30
|
-
import
|
|
30
|
+
import WebRtcPlayerViewController from './viewControllers/webRtcStreaming/WebRtcPlayer.vc';
|
|
31
31
|
export declare const CORE_CONTROLLER_MAP: {
|
|
32
32
|
form: typeof FormViewController;
|
|
33
33
|
/**
|
|
@@ -99,5 +99,5 @@ export declare const CORE_CONTROLLER_MAP: {
|
|
|
99
99
|
'bar-chart': typeof BarChartViewController;
|
|
100
100
|
'line-graph': typeof LineGraphViewController;
|
|
101
101
|
'lock-screen': typeof LockScreenSkillViewController;
|
|
102
|
-
'web-rtc-
|
|
102
|
+
'web-rtc-player': typeof WebRtcPlayerViewController;
|
|
103
103
|
};
|
package/build/controllerMap.js
CHANGED
|
@@ -33,7 +33,7 @@ const Stats_vc_1 = __importDefault(require("./viewControllers/reporting/Stats.vc
|
|
|
33
33
|
const SwipeCard_vc_1 = __importDefault(require("./viewControllers/SwipeCard.vc"));
|
|
34
34
|
const TalkingSprucebot_vc_1 = __importDefault(require("./viewControllers/TalkingSprucebot.vc"));
|
|
35
35
|
const ToolBelt_vc_1 = __importDefault(require("./viewControllers/ToolBelt.vc"));
|
|
36
|
-
const
|
|
36
|
+
const WebRtcPlayer_vc_1 = __importDefault(require("./viewControllers/webRtcStreaming/WebRtcPlayer.vc"));
|
|
37
37
|
exports.CORE_CONTROLLER_MAP = {
|
|
38
38
|
form: Form_vc_1.default,
|
|
39
39
|
/**
|
|
@@ -105,5 +105,5 @@ exports.CORE_CONTROLLER_MAP = {
|
|
|
105
105
|
'bar-chart': BarChart_vc_1.default,
|
|
106
106
|
'line-graph': _1.LineGraphViewController,
|
|
107
107
|
'lock-screen': LockScreen_svc_1.default,
|
|
108
|
-
'web-rtc-
|
|
108
|
+
'web-rtc-player': WebRtcPlayer_vc_1.default,
|
|
109
109
|
};
|
|
@@ -80,6 +80,9 @@ class SpruceError extends error_1.default {
|
|
|
80
80
|
case 'INVALID_APP_CONTROLLER':
|
|
81
81
|
message = 'A Invalid app controller just happened!';
|
|
82
82
|
break;
|
|
83
|
+
case 'DID_NOT_GENERATE_OFFER':
|
|
84
|
+
message = `You have to generate an offer before setting an answer for streaming!`;
|
|
85
|
+
break;
|
|
83
86
|
default:
|
|
84
87
|
message = super.friendlyMessage();
|
|
85
88
|
}
|
|
@@ -327,6 +327,18 @@ export declare namespace SpruceErrors.HeartwoodViewControllers {
|
|
|
327
327
|
}
|
|
328
328
|
type DuplicateEventIdEntity = SchemaEntity<SpruceErrors.HeartwoodViewControllers.DuplicateEventIdSchema>;
|
|
329
329
|
}
|
|
330
|
+
export declare namespace SpruceErrors.HeartwoodViewControllers {
|
|
331
|
+
interface DidNotGenerateOffer {
|
|
332
|
+
}
|
|
333
|
+
interface DidNotGenerateOfferSchema extends SpruceSchema.Schema {
|
|
334
|
+
id: 'didNotGenerateOffer';
|
|
335
|
+
namespace: 'HeartwoodViewControllers';
|
|
336
|
+
name: 'Did not generate offer';
|
|
337
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers';
|
|
338
|
+
fields: {};
|
|
339
|
+
}
|
|
340
|
+
type DidNotGenerateOfferEntity = SchemaEntity<SpruceErrors.HeartwoodViewControllers.DidNotGenerateOfferSchema>;
|
|
341
|
+
}
|
|
330
342
|
export declare namespace SpruceErrors.HeartwoodViewControllers {
|
|
331
343
|
interface DateNotSelected {
|
|
332
344
|
'year': number;
|
|
@@ -51,6 +51,9 @@ export interface DuplicateRowIdErrorOptions extends SpruceErrors.HeartwoodViewCo
|
|
|
51
51
|
export interface DuplicateEventIdErrorOptions extends SpruceErrors.HeartwoodViewControllers.DuplicateEventId, ISpruceErrorOptions {
|
|
52
52
|
code: 'DUPLICATE_EVENT_ID';
|
|
53
53
|
}
|
|
54
|
+
export interface DidNotGenerateOfferErrorOptions extends SpruceErrors.HeartwoodViewControllers.DidNotGenerateOffer, ISpruceErrorOptions {
|
|
55
|
+
code: 'DID_NOT_GENERATE_OFFER';
|
|
56
|
+
}
|
|
54
57
|
export interface DateNotSelectedErrorOptions extends SpruceErrors.HeartwoodViewControllers.DateNotSelected, ISpruceErrorOptions {
|
|
55
58
|
code: 'DATE_NOT_SELECTED';
|
|
56
59
|
}
|
|
@@ -63,5 +66,5 @@ export interface CellDeletedErrorOptions extends SpruceErrors.HeartwoodViewContr
|
|
|
63
66
|
export interface AppNotFoundErrorOptions extends SpruceErrors.HeartwoodViewControllers.AppNotFound, ISpruceErrorOptions {
|
|
64
67
|
code: 'APP_NOT_FOUND';
|
|
65
68
|
}
|
|
66
|
-
type ErrorOptions = ViewAlreadyDestroyedErrorOptions | ToolNotFoundErrorOptions | StepNotCompleteErrorOptions | SlideNotFoundErrorOptions | RowDeletedErrorOptions | PersonNotFoundErrorOptions | NoFieldVcSetErrorOptions | MissingStorageErrorOptions | InvalidViewControllerSourceErrorOptions | InvalidViewControllerNameErrorOptions | InvalidSkillViewControllerErrorOptions | InvalidAppControllerErrorOptions | ExportFailedErrorOptions | EventNotFoundErrorOptions | DuplicateToolIdErrorOptions | DuplicateRowIdErrorOptions | DuplicateEventIdErrorOptions | DateNotSelectedErrorOptions | DateAlreadySelectedErrorOptions | CellDeletedErrorOptions | AppNotFoundErrorOptions;
|
|
69
|
+
type ErrorOptions = ViewAlreadyDestroyedErrorOptions | ToolNotFoundErrorOptions | StepNotCompleteErrorOptions | SlideNotFoundErrorOptions | RowDeletedErrorOptions | PersonNotFoundErrorOptions | NoFieldVcSetErrorOptions | MissingStorageErrorOptions | InvalidViewControllerSourceErrorOptions | InvalidViewControllerNameErrorOptions | InvalidSkillViewControllerErrorOptions | InvalidAppControllerErrorOptions | ExportFailedErrorOptions | EventNotFoundErrorOptions | DuplicateToolIdErrorOptions | DuplicateRowIdErrorOptions | DuplicateEventIdErrorOptions | DidNotGenerateOfferErrorOptions | DateNotSelectedErrorOptions | DateAlreadySelectedErrorOptions | CellDeletedErrorOptions | AppNotFoundErrorOptions;
|
|
67
70
|
export default ErrorOptions;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SchemaRegistry } from '@sprucelabs/schema';
|
|
2
|
+
const webRtcPlayerSchema = {
|
|
3
|
+
id: 'webRtcPlayer',
|
|
4
|
+
version: 'v2021_02_11',
|
|
5
|
+
namespace: 'HeartwoodViewControllers',
|
|
6
|
+
name: '',
|
|
7
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers',
|
|
8
|
+
fields: {
|
|
9
|
+
/** . */
|
|
10
|
+
'id': {
|
|
11
|
+
type: 'id',
|
|
12
|
+
options: undefined
|
|
13
|
+
},
|
|
14
|
+
/** . */
|
|
15
|
+
'controller': {
|
|
16
|
+
type: 'raw',
|
|
17
|
+
options: { valueType: `HeartwoodTypes.ViewController<HeartwoodTypes.WebRtcPlayer>`, }
|
|
18
|
+
},
|
|
19
|
+
/** . */
|
|
20
|
+
'streamer': {
|
|
21
|
+
type: 'raw',
|
|
22
|
+
options: { valueType: `HeartwoodTypes.WebRtcStreamer`, }
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
SchemaRegistry.getInstance().trackSchema(webRtcPlayerSchema);
|
|
27
|
+
export default webRtcPlayerSchema;
|
|
@@ -704,6 +704,43 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
704
704
|
interface InputEntity extends SchemaEntity<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.InputSchema> {
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
|
+
namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
|
|
708
|
+
interface WebRtcPlayer {
|
|
709
|
+
'id'?: string | undefined | null;
|
|
710
|
+
'controller'?: (HeartwoodTypes.ViewController<HeartwoodTypes.WebRtcPlayer>) | undefined | null;
|
|
711
|
+
'streamer'?: (HeartwoodTypes.WebRtcStreamer) | undefined | null;
|
|
712
|
+
}
|
|
713
|
+
interface WebRtcPlayerSchema extends SpruceSchema.Schema {
|
|
714
|
+
id: 'webRtcPlayer';
|
|
715
|
+
version: 'v2021_02_11';
|
|
716
|
+
namespace: 'HeartwoodViewControllers';
|
|
717
|
+
name: '';
|
|
718
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers';
|
|
719
|
+
fields: {
|
|
720
|
+
/** . */
|
|
721
|
+
'id': {
|
|
722
|
+
type: 'id';
|
|
723
|
+
options: undefined;
|
|
724
|
+
};
|
|
725
|
+
/** . */
|
|
726
|
+
'controller': {
|
|
727
|
+
type: 'raw';
|
|
728
|
+
options: {
|
|
729
|
+
valueType: `HeartwoodTypes.ViewController<HeartwoodTypes.WebRtcPlayer>`;
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
/** . */
|
|
733
|
+
'streamer': {
|
|
734
|
+
type: 'raw';
|
|
735
|
+
options: {
|
|
736
|
+
valueType: `HeartwoodTypes.WebRtcStreamer`;
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
interface WebRtcPlayerEntity extends SchemaEntity<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.WebRtcPlayerSchema> {
|
|
742
|
+
}
|
|
743
|
+
}
|
|
707
744
|
namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
|
|
708
745
|
interface ToolBeltTool {
|
|
709
746
|
/** Id. */
|
|
@@ -27,7 +27,7 @@ import StatsViewController from './viewControllers/reporting/Stats.vc';
|
|
|
27
27
|
import SwipeCardViewController from './viewControllers/SwipeCard.vc';
|
|
28
28
|
import TalkingSprucebotViewController from './viewControllers/TalkingSprucebot.vc';
|
|
29
29
|
import ToolBeltViewController from './viewControllers/ToolBelt.vc';
|
|
30
|
-
import
|
|
30
|
+
import WebRtcPlayerViewController from './viewControllers/webRtcStreaming/WebRtcPlayer.vc';
|
|
31
31
|
export declare const CORE_CONTROLLER_MAP: {
|
|
32
32
|
form: typeof FormViewController;
|
|
33
33
|
/**
|
|
@@ -99,5 +99,5 @@ export declare const CORE_CONTROLLER_MAP: {
|
|
|
99
99
|
'bar-chart': typeof BarChartViewController;
|
|
100
100
|
'line-graph': typeof LineGraphViewController;
|
|
101
101
|
'lock-screen': typeof LockScreenSkillViewController;
|
|
102
|
-
'web-rtc-
|
|
102
|
+
'web-rtc-player': typeof WebRtcPlayerViewController;
|
|
103
103
|
};
|
|
@@ -27,7 +27,7 @@ import StatsViewController from './viewControllers/reporting/Stats.vc.js';
|
|
|
27
27
|
import SwipeCardViewController from './viewControllers/SwipeCard.vc.js';
|
|
28
28
|
import TalkingSprucebotViewController from './viewControllers/TalkingSprucebot.vc.js';
|
|
29
29
|
import ToolBeltViewController from './viewControllers/ToolBelt.vc.js';
|
|
30
|
-
import
|
|
30
|
+
import WebRtcPlayerViewController from './viewControllers/webRtcStreaming/WebRtcPlayer.vc.js';
|
|
31
31
|
export const CORE_CONTROLLER_MAP = {
|
|
32
32
|
form: FormViewController,
|
|
33
33
|
/**
|
|
@@ -99,5 +99,5 @@ export const CORE_CONTROLLER_MAP = {
|
|
|
99
99
|
'bar-chart': BarChartViewController,
|
|
100
100
|
'line-graph': LineGraphViewController,
|
|
101
101
|
'lock-screen': LockScreenSkillViewController,
|
|
102
|
-
'web-rtc-
|
|
102
|
+
'web-rtc-player': WebRtcPlayerViewController,
|
|
103
103
|
};
|
|
@@ -76,6 +76,9 @@ export default class SpruceError extends AbstractSpruceError {
|
|
|
76
76
|
case 'INVALID_APP_CONTROLLER':
|
|
77
77
|
message = 'A Invalid app controller just happened!';
|
|
78
78
|
break;
|
|
79
|
+
case 'DID_NOT_GENERATE_OFFER':
|
|
80
|
+
message = `You have to generate an offer before setting an answer for streaming!`;
|
|
81
|
+
break;
|
|
79
82
|
default:
|
|
80
83
|
message = super.friendlyMessage();
|
|
81
84
|
}
|
package/build/esm/index.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export * from './viewControllers/progressNavigator/ProgressNavigator.vc';
|
|
|
33
33
|
export { default as PagerViewController } from './viewControllers/pagers/Pager.vc';
|
|
34
34
|
export * from './viewControllers/pagers/Pager.vc';
|
|
35
35
|
export { AssertConfirmViewController } from './tests/utilities/assertSupport';
|
|
36
|
+
export { default as WebRtcPlayerViewController } from './viewControllers/webRtcStreaming/WebRtcPlayer.vc';
|
|
37
|
+
export * from './viewControllers/webRtcStreaming/WebRtcPlayer.vc';
|
|
36
38
|
/**
|
|
37
39
|
* @deprecated SwipeViewControllerImpl->SwipeCardViewControllerImpl
|
|
38
40
|
*/
|
|
@@ -148,6 +150,7 @@ export { default as inputButtonSchema } from './.spruce/schemas/heartwoodViewCon
|
|
|
148
150
|
export { default as polarAreaSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/polarArea.schema';
|
|
149
151
|
export { default as polarAreaDataItemSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/polarAreaDataItem.schema';
|
|
150
152
|
export { default as pagerSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/pager.schema';
|
|
153
|
+
export { default as webRtcPlayerSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/webRtcPlayer.schema';
|
|
151
154
|
export { default as ViewControllerExporter } from './viewControllers/ViewControllerExporter';
|
|
152
155
|
export { default as ViewControllerImporter } from './viewControllers/ViewControllerImporter';
|
|
153
156
|
export { default as ViewControllerFactory } from './viewControllers/ViewControllerFactory';
|
package/build/esm/index.js
CHANGED
|
@@ -32,6 +32,8 @@ export { default as ProgressNavigatorViewController } from './viewControllers/pr
|
|
|
32
32
|
export * from './viewControllers/progressNavigator/ProgressNavigator.vc.js';
|
|
33
33
|
export { default as PagerViewController } from './viewControllers/pagers/Pager.vc.js';
|
|
34
34
|
export * from './viewControllers/pagers/Pager.vc.js';
|
|
35
|
+
export { default as WebRtcPlayerViewController } from './viewControllers/webRtcStreaming/WebRtcPlayer.vc.js';
|
|
36
|
+
export * from './viewControllers/webRtcStreaming/WebRtcPlayer.vc.js';
|
|
35
37
|
/**
|
|
36
38
|
* @deprecated SwipeViewControllerImpl->SwipeCardViewControllerImpl
|
|
37
39
|
*/
|
|
@@ -147,6 +149,7 @@ export { default as inputButtonSchema } from './.spruce/schemas/heartwoodViewCon
|
|
|
147
149
|
export { default as polarAreaSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/polarArea.schema.js';
|
|
148
150
|
export { default as polarAreaDataItemSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/polarAreaDataItem.schema.js';
|
|
149
151
|
export { default as pagerSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/pager.schema.js';
|
|
152
|
+
export { default as webRtcPlayerSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/webRtcPlayer.schema.js';
|
|
150
153
|
export { default as ViewControllerExporter } from './viewControllers/ViewControllerExporter.js';
|
|
151
154
|
export { default as ViewControllerImporter } from './viewControllers/ViewControllerImporter.js';
|
|
152
155
|
export { default as ViewControllerFactory } from './viewControllers/ViewControllerFactory.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
id: string;
|
|
3
|
+
fields: {
|
|
4
|
+
id: {
|
|
5
|
+
type: "id";
|
|
6
|
+
};
|
|
7
|
+
controller: {
|
|
8
|
+
type: "raw";
|
|
9
|
+
options: {
|
|
10
|
+
valueType: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
streamer: {
|
|
14
|
+
type: "raw";
|
|
15
|
+
options: {
|
|
16
|
+
valueType: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { buildSchema } from '@sprucelabs/schema';
|
|
2
|
+
export default buildSchema({
|
|
3
|
+
id: 'webRtcPlayer',
|
|
4
|
+
fields: {
|
|
5
|
+
id: {
|
|
6
|
+
type: 'id',
|
|
7
|
+
},
|
|
8
|
+
controller: {
|
|
9
|
+
type: 'raw',
|
|
10
|
+
options: {
|
|
11
|
+
valueType: 'HeartwoodTypes.ViewController<HeartwoodTypes.WebRtcPlayer>',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
streamer: {
|
|
15
|
+
type: 'raw',
|
|
16
|
+
options: {
|
|
17
|
+
valueType: 'HeartwoodTypes.WebRtcStreamer',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -6,6 +6,7 @@ export default class MocRtcPeerConnection implements RTCPeerConnection {
|
|
|
6
6
|
private lastAddedEventListener?;
|
|
7
7
|
constructor(options?: RTCConfiguration);
|
|
8
8
|
assertGeneratedOfferEquals(offer: RTCSessionDescriptionInit): void;
|
|
9
|
+
assertGeneratedOfferSdpEquals(sdp: string): void;
|
|
9
10
|
assertCreatedWithOptions(expected: {
|
|
10
11
|
sdpSemantics: string;
|
|
11
12
|
iceServers: never[];
|
|
@@ -42,7 +43,7 @@ export default class MocRtcPeerConnection implements RTCPeerConnection {
|
|
|
42
43
|
addTrack(_track: unknown, ..._streams: unknown[]): RTCRtpSender;
|
|
43
44
|
addTransceiver(_trackOrKind: unknown, _init?: unknown): RTCRtpTransceiver;
|
|
44
45
|
close(): void;
|
|
45
|
-
createAnswer(_successCallback?: unknown, _failureCallback?: unknown): Promise<
|
|
46
|
+
createAnswer(_successCallback?: unknown, _failureCallback?: unknown): Promise<any>;
|
|
46
47
|
createDataChannel(_label: unknown, _dataChannelDict?: unknown): RTCDataChannel;
|
|
47
48
|
createOffer(options?: RTCOfferOptions): Promise<any>;
|
|
48
49
|
getConfiguration(): RTCConfiguration;
|
|
@@ -40,6 +40,9 @@ export default class MocRtcPeerConnection {
|
|
|
40
40
|
assertGeneratedOfferEquals(offer) {
|
|
41
41
|
assert.isEqualDeep(offer, this.offer, 'Did not return the generated offer');
|
|
42
42
|
}
|
|
43
|
+
assertGeneratedOfferSdpEquals(sdp) {
|
|
44
|
+
assert.isEqualDeep(this.offer.sdp, sdp, 'Did not return the generated offer sdp');
|
|
45
|
+
}
|
|
43
46
|
assertCreatedWithOptions(expected) {
|
|
44
47
|
assert.isEqualDeep(this.constructorOptions, expected, 'Did not pass default options to peer connection');
|
|
45
48
|
}
|
|
@@ -72,9 +75,10 @@ export default class MocRtcPeerConnection {
|
|
|
72
75
|
close() {
|
|
73
76
|
throw new Error('Method not implemented.');
|
|
74
77
|
}
|
|
75
|
-
//@ts-ignore
|
|
76
78
|
createAnswer(_successCallback, _failureCallback) {
|
|
77
|
-
return {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
return {};
|
|
81
|
+
});
|
|
78
82
|
}
|
|
79
83
|
createDataChannel(_label, _dataChannelDict) {
|
|
80
84
|
return {};
|
|
@@ -42,7 +42,7 @@ import ToolBeltViewController, { ToolBeltViewControllerOptions } from '../viewCo
|
|
|
42
42
|
import ViewControllerFactory from '../viewControllers/ViewControllerFactory';
|
|
43
43
|
export * from './calendar.types';
|
|
44
44
|
import '@sprucelabs/mercury-core-events';
|
|
45
|
-
import
|
|
45
|
+
import WebRtcPlayerViewController, { WebRtcPlayerOptions } from '../viewControllers/webRtcStreaming/WebRtcPlayer.vc';
|
|
46
46
|
export { default as MapViewController } from '../viewControllers/Map.vc';
|
|
47
47
|
export type ErrorHandler = (message: string) => void;
|
|
48
48
|
type Person = SpruceSchemas.Spruce.v2020_07_22.Person;
|
|
@@ -250,6 +250,7 @@ export type LineGraph = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.LineG
|
|
|
250
250
|
export type ChartDataSet = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ChartDataSet;
|
|
251
251
|
export type ChartDataPoint = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ChartDataPoint;
|
|
252
252
|
export type Form<S extends Schema = any> = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Form<S>;
|
|
253
|
+
export type WebRtcPlayer = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.WebRtcPlayer;
|
|
253
254
|
export type NavigationRoute = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationRoute;
|
|
254
255
|
export type LayoutStyle = NonNullable<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.SkillView['layout']>;
|
|
255
256
|
export type ListColumnWidth = NonNullable<List['columnWidths']>[number];
|
|
@@ -385,7 +386,7 @@ export interface ViewControllerMap {
|
|
|
385
386
|
'bar-chart': BarChartViewController;
|
|
386
387
|
'line-graph': LineGraphViewController;
|
|
387
388
|
'lock-screen': LockScreenSkillViewController;
|
|
388
|
-
'web-rtc-
|
|
389
|
+
'web-rtc-player': WebRtcPlayerViewController;
|
|
389
390
|
}
|
|
390
391
|
export interface ViewControllerOptionsMap {
|
|
391
392
|
form: FormViewControllerOptions<any>;
|
|
@@ -430,7 +431,7 @@ export interface ViewControllerOptionsMap {
|
|
|
430
431
|
'bar-chart': BarChartViewControllerOptions;
|
|
431
432
|
'line-graph': LineGraphViewControllerOptions;
|
|
432
433
|
'lock-screen': LockScreenSkillViewControllerOptions;
|
|
433
|
-
'web-rtc-
|
|
434
|
+
'web-rtc-player': WebRtcPlayerOptions;
|
|
434
435
|
}
|
|
435
436
|
export interface SkillViewControllerMap {
|
|
436
437
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbstractViewController } from '../..';
|
|
2
|
+
import { ViewControllerOptions, WebRtcPlayer } from '../../types/heartwood.types';
|
|
3
|
+
import { WebRtcStreamer } from '../../webRtcStreaming/WebRtcStreamer';
|
|
4
|
+
export default class WebRtcPlayerViewController extends AbstractViewController<WebRtcPlayer> {
|
|
5
|
+
static id: string;
|
|
6
|
+
private streamer?;
|
|
7
|
+
constructor(options: ViewControllerOptions & WebRtcPlayerOptions);
|
|
8
|
+
setStreamer(streamer: WebRtcStreamer): void;
|
|
9
|
+
createOffer(offerOptions: RTCOfferOptions): Promise<string>;
|
|
10
|
+
setAnswer(answerSdp: string): Promise<void>;
|
|
11
|
+
render(): WebRtcPlayer;
|
|
12
|
+
}
|
|
13
|
+
export interface WebRtcPlayerOptions extends WebRtcPlayer {
|
|
14
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { assertOptions } from '@sprucelabs/schema';
|
|
11
|
+
import { AbstractViewController, WebRtcConnection } from '../../index.js';
|
|
12
|
+
import SpruceError from '../../errors/SpruceError.js';
|
|
13
|
+
class WebRtcPlayerViewController extends AbstractViewController {
|
|
14
|
+
constructor(options) {
|
|
15
|
+
super(options);
|
|
16
|
+
const { streamer } = options;
|
|
17
|
+
this.streamer = streamer !== null && streamer !== void 0 ? streamer : undefined;
|
|
18
|
+
}
|
|
19
|
+
setStreamer(streamer) {
|
|
20
|
+
assertOptions({ streamer }, ['streamer']);
|
|
21
|
+
this.streamer = streamer;
|
|
22
|
+
this.triggerRender();
|
|
23
|
+
}
|
|
24
|
+
createOffer(offerOptions) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const { offerSdp, streamer } = yield WebRtcConnection.createOffer({
|
|
27
|
+
offerOptions,
|
|
28
|
+
});
|
|
29
|
+
this.setStreamer(streamer);
|
|
30
|
+
return offerSdp.sdp;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
setAnswer(answerSdp) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (!this.streamer) {
|
|
36
|
+
throw new SpruceError({
|
|
37
|
+
code: 'DID_NOT_GENERATE_OFFER',
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
yield this.streamer.setAnswer(answerSdp);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return {
|
|
45
|
+
streamer: this.streamer,
|
|
46
|
+
controller: this,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
WebRtcPlayerViewController.id = 'web-rtc-player-card';
|
|
51
|
+
export default WebRtcPlayerViewController;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MockRtcPeerConnection from '../tests/MockRtcPeerConnection';
|
|
2
|
+
import { WebRtcStreamer } from './WebRtcStreamer';
|
|
2
3
|
export default class WebRtcConnection {
|
|
3
|
-
static get RTCPeerConnection():
|
|
4
|
-
|
|
5
|
-
prototype: RTCPeerConnection;
|
|
6
|
-
generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise<RTCCertificate>;
|
|
7
|
-
};
|
|
8
|
-
static set RTCPeerConnection(value: {
|
|
9
|
-
new (configuration?: RTCConfiguration): RTCPeerConnection;
|
|
10
|
-
prototype: RTCPeerConnection;
|
|
11
|
-
generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise<RTCCertificate>;
|
|
12
|
-
});
|
|
4
|
+
static get RTCPeerConnection(): new (config: RTCConfiguration) => RTCPeerConnection | MockRtcPeerConnection;
|
|
5
|
+
static set RTCPeerConnection(value: new (config: RTCConfiguration) => RTCPeerConnection | MockRtcPeerConnection);
|
|
13
6
|
static createOffer(options: WebRtcVcPluginCreateOfferOptions): Promise<{
|
|
14
7
|
offerSdp: RTCSessionDescriptionInit;
|
|
15
|
-
streamer:
|
|
8
|
+
streamer: WebRtcStreamer;
|
|
16
9
|
}>;
|
|
17
10
|
}
|
|
18
11
|
export interface WebRtcVcPluginCreateOfferOptions {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export default class WebRtcStreamerImpl {
|
|
1
|
+
export default class WebRtcStreamerImpl implements WebRtcStreamer {
|
|
2
2
|
private connection;
|
|
3
|
+
static Class?: new (connection: RTCPeerConnection) => WebRtcStreamer;
|
|
3
4
|
protected constructor(connection: RTCPeerConnection);
|
|
4
|
-
static Streamer(connection: RTCPeerConnection):
|
|
5
|
+
static Streamer(connection: RTCPeerConnection): WebRtcStreamer;
|
|
5
6
|
setAnswer(answerSdp: string): Promise<void>;
|
|
6
7
|
onTrack(cb: (event: RTCTrackEvent) => void): void;
|
|
7
8
|
}
|
|
@@ -13,7 +13,8 @@ export default class WebRtcStreamerImpl {
|
|
|
13
13
|
this.connection = connection;
|
|
14
14
|
}
|
|
15
15
|
static Streamer(connection) {
|
|
16
|
-
|
|
16
|
+
var _a;
|
|
17
|
+
return new ((_a = this.Class) !== null && _a !== void 0 ? _a : this)(connection);
|
|
17
18
|
}
|
|
18
19
|
setAnswer(answerSdp) {
|
|
19
20
|
return __awaiter(this, void 0, void 0, function* () {
|
package/build/index.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export * from './viewControllers/progressNavigator/ProgressNavigator.vc';
|
|
|
33
33
|
export { default as PagerViewController } from './viewControllers/pagers/Pager.vc';
|
|
34
34
|
export * from './viewControllers/pagers/Pager.vc';
|
|
35
35
|
export { AssertConfirmViewController } from './tests/utilities/assertSupport';
|
|
36
|
+
export { default as WebRtcPlayerViewController } from './viewControllers/webRtcStreaming/WebRtcPlayer.vc';
|
|
37
|
+
export * from './viewControllers/webRtcStreaming/WebRtcPlayer.vc';
|
|
36
38
|
/**
|
|
37
39
|
* @deprecated SwipeViewControllerImpl->SwipeCardViewControllerImpl
|
|
38
40
|
*/
|
|
@@ -148,6 +150,7 @@ export { default as inputButtonSchema } from './.spruce/schemas/heartwoodViewCon
|
|
|
148
150
|
export { default as polarAreaSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/polarArea.schema';
|
|
149
151
|
export { default as polarAreaDataItemSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/polarAreaDataItem.schema';
|
|
150
152
|
export { default as pagerSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/pager.schema';
|
|
153
|
+
export { default as webRtcPlayerSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/webRtcPlayer.schema';
|
|
151
154
|
export { default as ViewControllerExporter } from './viewControllers/ViewControllerExporter';
|
|
152
155
|
export { default as ViewControllerImporter } from './viewControllers/ViewControllerImporter';
|
|
153
156
|
export { default as ViewControllerFactory } from './viewControllers/ViewControllerFactory';
|
package/build/index.js
CHANGED
|
@@ -17,10 +17,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.navigationRouteSchema = exports.routerDestinationSchema = exports.navigationDropdownButtonSchema = exports.navigationButtonDropdownSchema = exports.chartDataSetSchema = exports.chartDataPointSchema = exports.lineGraphSchema = exports.barChartSchema = exports.progressDetailsSchema = exports.progressNavigatorStepSchema = exports.progressNavigatorSchema = exports.countdownTimerSchema = exports.permissionContractReferenceSchema = exports.navigationButtonSchema = exports.navigationSchema = exports.ToolBeltStateMachine = exports.removeUniversalViewOptions = exports.buildSkillViewLayout = exports.splitCardsIntoLayouts = exports.listUtil = exports.mapInteractor = exports.mapAssert = exports.renderUtil = exports.routerTestPatcher = exports.dialogTestPatcher = exports.confirmTestPatcher = exports.calendarSeeder = exports.interactionUtil = exports.chartAssert = exports.progressNavigatorAssert = exports.countdownTimerInteractor = exports.countdownTimerAssert = exports.calendarInteractor = exports.interactor = exports.normalizeScopeFromVc = exports.autocompleteInteractor = void 0;
|
|
20
|
+
exports.MocRtcPeerConnection = exports.WebRtcConnection = exports.WebRtcStreamerImpl = exports.buildSkillView = exports.buildForm = exports.buildBigForm = exports.AuthenticatorImpl = exports.PolarAreaViewController = exports.SpyViewControllerExporter = exports.lockScreenAssert = exports.MockActiveRecordCard = exports.activeRecordCardAssert = exports.buildActiveRecordList = exports.buildActiveRecordCard = exports.AbstractInputViewController = exports.AutocompleteInputViewController = exports.AbstractCalendarEventViewController = exports.RatingsViewController = exports.ProgressViewController = exports.StatsViewController = exports.FeedViewController = exports.ActiveRecordListViewController = exports.ActiveRecordCardViewController = exports.TalkingSprucebotViewController = exports.ButtonBarViewController = exports.CalendarViewController = exports.SwipeCardViewControllerImpl = exports.SwipeViewControllerImpl = exports.WebRtcPlayerViewController = exports.PagerViewController = exports.ProgressNavigatorViewController = exports.CountdownTimerViewController = exports.FormBuilderCardViewControllerImpl = exports.LoginViewController = exports.LineGraphViewController = exports.BarChartViewController = exports.ToolBeltViewController = exports.FormViewControllerImpl = exports.ListCellViewController = exports.ListRowViewController = exports.ListViewController = exports.NavigationViewController = exports.LockScreenSkillViewController = exports.DialogViewController = exports.ConfirmViewController = exports.CardViewControllerImpl = exports.ButtonGroupViewController = exports.AbstractAppController = exports.AbstractViewController = exports.AbstractSkillViewController = void 0;
|
|
21
|
+
exports.buttonBarButtonSchema = exports.buttonBarSchema = exports.toolBeltToolSchema = exports.toolBeltSchema = exports.calendarTimeSchema = exports.calendarPersonSchema = exports.calendarSchema = exports.themePropsSchema = exports.themeSchema = exports.cardFooterButtonSchema = exports.criticalErrorSchema = exports.sprucebotTypedMessageSentenceSchema = exports.sprucebotTypedMessageAvatarSchema = exports.selectInputChoiceSchema = exports.calendarEventColorOverrideSchema = exports.portalSchema = exports.listTextInputSchema = exports.listSelectInputSchema = exports.listCellButtonSchema = exports.dropdownButtonSchema = exports.bigFormSectionSchema = exports.textInputSchema = exports.phoneInputSchema = exports.inputSchema = exports.dropdownSchema = exports.sprucebotTypedMessageSchema = exports.talkingSprucebotSchema = exports.sprucebotAvatarSchema = exports.formBuilderImportExportObjectSchema = exports.listCellSchema = exports.listRowSchema = exports.listSchema = exports.layoutSchema = exports.cardSectionSchema = exports.cardHeaderSchema = exports.cardFooterSchema = exports.cardBodySchema = exports.cardSchema = exports.formSectionSchema = exports.formSchema = exports.textSchema = exports.lockScreenSchema = exports.dialogSchema = exports.buttonSchema = exports.lineIconSchema = exports.fancyIconSchema = exports.selectInputSchema = exports.skillViewSchema = exports.bigFormSchema = exports.calendarEventColorsSchema = void 0;
|
|
22
|
+
exports.listAssert = exports.buttonAssert = exports.deviceAssert = exports.navigationAssert = exports.toolBeltAssert = exports.toastAssert = exports.vcPluginAssert = exports.vcDurationAssert = exports.pagerAssert = exports.vcAssert = exports.vcAssertUtil = exports.feedAssert = exports.feedInteractor = exports.normalizeFormSectionFieldNamesUtil = exports.ViewControllerError = exports.SpyDevice = exports.StubStorage = exports.ViewControllerFactory = exports.ViewControllerImporter = exports.ViewControllerExporter = exports.webRtcPlayerSchema = exports.pagerSchema = exports.polarAreaDataItemSchema = exports.polarAreaSchema = exports.inputButtonSchema = exports.mapPinSchema = exports.mapSchema = exports.latLngSchema = exports.formBuilderImportExportPageSchema = exports.autocompleteSuggestionSchema = exports.autocompleteInputSchema = exports.feedSchema = exports.calendarShiftSchema = exports.receiptTotalSchema = exports.receiptSectionSchema = exports.receiptLineItemSchema = exports.receiptHeaderSchema = exports.receiptSchema = exports.listDateInputSchema = exports.calendarSelectedDateSchema = exports.calendarEventSchema = exports.ratingsInputSchema = exports.listRatingsInputSchema = exports.ratingsSchema = exports.progressSchema = exports.statsStatSchema = exports.statsSchema = exports.toggleInputSchema = exports.listToggleInputSchema = exports.addressInputSchema = void 0;
|
|
23
|
+
exports.navigationRouteSchema = exports.routerDestinationSchema = exports.navigationDropdownButtonSchema = exports.navigationButtonDropdownSchema = exports.chartDataSetSchema = exports.chartDataPointSchema = exports.lineGraphSchema = exports.barChartSchema = exports.progressDetailsSchema = exports.progressNavigatorStepSchema = exports.progressNavigatorSchema = exports.countdownTimerSchema = exports.permissionContractReferenceSchema = exports.navigationButtonSchema = exports.navigationSchema = exports.ToolBeltStateMachine = exports.removeUniversalViewOptions = exports.buildSkillViewLayout = exports.splitCardsIntoLayouts = exports.listUtil = exports.mapInteractor = exports.mapAssert = exports.renderUtil = exports.routerTestPatcher = exports.dialogTestPatcher = exports.confirmTestPatcher = exports.calendarSeeder = exports.interactionUtil = exports.chartAssert = exports.progressNavigatorAssert = exports.countdownTimerInteractor = exports.countdownTimerAssert = exports.calendarInteractor = exports.interactor = exports.normalizeScopeFromVc = exports.autocompleteInteractor = exports.formAssert = exports.autocompleteAssert = void 0;
|
|
24
24
|
__exportStar(require("./constants"), exports);
|
|
25
25
|
__exportStar(require("./types/heartwood.types"), exports);
|
|
26
26
|
__exportStar(require("./utilities/removeUniversalViewOptions"), exports);
|
|
@@ -76,6 +76,9 @@ __exportStar(require("./viewControllers/progressNavigator/ProgressNavigator.vc")
|
|
|
76
76
|
var Pager_vc_1 = require("./viewControllers/pagers/Pager.vc");
|
|
77
77
|
Object.defineProperty(exports, "PagerViewController", { enumerable: true, get: function () { return __importDefault(Pager_vc_1).default; } });
|
|
78
78
|
__exportStar(require("./viewControllers/pagers/Pager.vc"), exports);
|
|
79
|
+
var WebRtcPlayer_vc_1 = require("./viewControllers/webRtcStreaming/WebRtcPlayer.vc");
|
|
80
|
+
Object.defineProperty(exports, "WebRtcPlayerViewController", { enumerable: true, get: function () { return __importDefault(WebRtcPlayer_vc_1).default; } });
|
|
81
|
+
__exportStar(require("./viewControllers/webRtcStreaming/WebRtcPlayer.vc"), exports);
|
|
79
82
|
/**
|
|
80
83
|
* @deprecated SwipeViewControllerImpl->SwipeCardViewControllerImpl
|
|
81
84
|
*/
|
|
@@ -298,6 +301,8 @@ var polarAreaDataItem_schema_1 = require("./.spruce/schemas/heartwoodViewControl
|
|
|
298
301
|
Object.defineProperty(exports, "polarAreaDataItemSchema", { enumerable: true, get: function () { return __importDefault(polarAreaDataItem_schema_1).default; } });
|
|
299
302
|
var pager_schema_1 = require("./.spruce/schemas/heartwoodViewControllers/v2021_02_11/pager.schema");
|
|
300
303
|
Object.defineProperty(exports, "pagerSchema", { enumerable: true, get: function () { return __importDefault(pager_schema_1).default; } });
|
|
304
|
+
var webRtcPlayer_schema_1 = require("./.spruce/schemas/heartwoodViewControllers/v2021_02_11/webRtcPlayer.schema");
|
|
305
|
+
Object.defineProperty(exports, "webRtcPlayerSchema", { enumerable: true, get: function () { return __importDefault(webRtcPlayer_schema_1).default; } });
|
|
301
306
|
var ViewControllerExporter_1 = require("./viewControllers/ViewControllerExporter");
|
|
302
307
|
Object.defineProperty(exports, "ViewControllerExporter", { enumerable: true, get: function () { return __importDefault(ViewControllerExporter_1).default; } });
|
|
303
308
|
var ViewControllerImporter_1 = require("./viewControllers/ViewControllerImporter");
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
id: string;
|
|
3
|
+
fields: {
|
|
4
|
+
id: {
|
|
5
|
+
type: "id";
|
|
6
|
+
};
|
|
7
|
+
controller: {
|
|
8
|
+
type: "raw";
|
|
9
|
+
options: {
|
|
10
|
+
valueType: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
streamer: {
|
|
14
|
+
type: "raw";
|
|
15
|
+
options: {
|
|
16
|
+
valueType: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
4
|
+
exports.default = (0, schema_1.buildSchema)({
|
|
5
|
+
id: 'webRtcPlayer',
|
|
6
|
+
fields: {
|
|
7
|
+
id: {
|
|
8
|
+
type: 'id',
|
|
9
|
+
},
|
|
10
|
+
controller: {
|
|
11
|
+
type: 'raw',
|
|
12
|
+
options: {
|
|
13
|
+
valueType: 'HeartwoodTypes.ViewController<HeartwoodTypes.WebRtcPlayer>',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
streamer: {
|
|
17
|
+
type: 'raw',
|
|
18
|
+
options: {
|
|
19
|
+
valueType: 'HeartwoodTypes.WebRtcStreamer',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -6,6 +6,7 @@ export default class MocRtcPeerConnection implements RTCPeerConnection {
|
|
|
6
6
|
private lastAddedEventListener?;
|
|
7
7
|
constructor(options?: RTCConfiguration);
|
|
8
8
|
assertGeneratedOfferEquals(offer: RTCSessionDescriptionInit): void;
|
|
9
|
+
assertGeneratedOfferSdpEquals(sdp: string): void;
|
|
9
10
|
assertCreatedWithOptions(expected: {
|
|
10
11
|
sdpSemantics: string;
|
|
11
12
|
iceServers: never[];
|
|
@@ -42,7 +43,7 @@ export default class MocRtcPeerConnection implements RTCPeerConnection {
|
|
|
42
43
|
addTrack(_track: unknown, ..._streams: unknown[]): RTCRtpSender;
|
|
43
44
|
addTransceiver(_trackOrKind: unknown, _init?: unknown): RTCRtpTransceiver;
|
|
44
45
|
close(): void;
|
|
45
|
-
createAnswer(_successCallback?: unknown, _failureCallback?: unknown): Promise<
|
|
46
|
+
createAnswer(_successCallback?: unknown, _failureCallback?: unknown): Promise<any>;
|
|
46
47
|
createDataChannel(_label: unknown, _dataChannelDict?: unknown): RTCDataChannel;
|
|
47
48
|
createOffer(options?: RTCOfferOptions): Promise<any>;
|
|
48
49
|
getConfiguration(): RTCConfiguration;
|
|
@@ -33,6 +33,9 @@ class MocRtcPeerConnection {
|
|
|
33
33
|
assertGeneratedOfferEquals(offer) {
|
|
34
34
|
test_utils_1.assert.isEqualDeep(offer, this.offer, 'Did not return the generated offer');
|
|
35
35
|
}
|
|
36
|
+
assertGeneratedOfferSdpEquals(sdp) {
|
|
37
|
+
test_utils_1.assert.isEqualDeep(this.offer.sdp, sdp, 'Did not return the generated offer sdp');
|
|
38
|
+
}
|
|
36
39
|
assertCreatedWithOptions(expected) {
|
|
37
40
|
test_utils_1.assert.isEqualDeep(this.constructorOptions, expected, 'Did not pass default options to peer connection');
|
|
38
41
|
}
|
|
@@ -63,8 +66,7 @@ class MocRtcPeerConnection {
|
|
|
63
66
|
close() {
|
|
64
67
|
throw new Error('Method not implemented.');
|
|
65
68
|
}
|
|
66
|
-
|
|
67
|
-
createAnswer(_successCallback, _failureCallback) {
|
|
69
|
+
async createAnswer(_successCallback, _failureCallback) {
|
|
68
70
|
return {};
|
|
69
71
|
}
|
|
70
72
|
createDataChannel(_label, _dataChannelDict) {
|
|
@@ -42,7 +42,7 @@ import ToolBeltViewController, { ToolBeltViewControllerOptions } from '../viewCo
|
|
|
42
42
|
import ViewControllerFactory from '../viewControllers/ViewControllerFactory';
|
|
43
43
|
export * from './calendar.types';
|
|
44
44
|
import '@sprucelabs/mercury-core-events';
|
|
45
|
-
import
|
|
45
|
+
import WebRtcPlayerViewController, { WebRtcPlayerOptions } from '../viewControllers/webRtcStreaming/WebRtcPlayer.vc';
|
|
46
46
|
export { default as MapViewController } from '../viewControllers/Map.vc';
|
|
47
47
|
export type ErrorHandler = (message: string) => void;
|
|
48
48
|
type Person = SpruceSchemas.Spruce.v2020_07_22.Person;
|
|
@@ -250,6 +250,7 @@ export type LineGraph = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.LineG
|
|
|
250
250
|
export type ChartDataSet = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ChartDataSet;
|
|
251
251
|
export type ChartDataPoint = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ChartDataPoint;
|
|
252
252
|
export type Form<S extends Schema = any> = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Form<S>;
|
|
253
|
+
export type WebRtcPlayer = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.WebRtcPlayer;
|
|
253
254
|
export type NavigationRoute = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationRoute;
|
|
254
255
|
export type LayoutStyle = NonNullable<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.SkillView['layout']>;
|
|
255
256
|
export type ListColumnWidth = NonNullable<List['columnWidths']>[number];
|
|
@@ -385,7 +386,7 @@ export interface ViewControllerMap {
|
|
|
385
386
|
'bar-chart': BarChartViewController;
|
|
386
387
|
'line-graph': LineGraphViewController;
|
|
387
388
|
'lock-screen': LockScreenSkillViewController;
|
|
388
|
-
'web-rtc-
|
|
389
|
+
'web-rtc-player': WebRtcPlayerViewController;
|
|
389
390
|
}
|
|
390
391
|
export interface ViewControllerOptionsMap {
|
|
391
392
|
form: FormViewControllerOptions<any>;
|
|
@@ -430,7 +431,7 @@ export interface ViewControllerOptionsMap {
|
|
|
430
431
|
'bar-chart': BarChartViewControllerOptions;
|
|
431
432
|
'line-graph': LineGraphViewControllerOptions;
|
|
432
433
|
'lock-screen': LockScreenSkillViewControllerOptions;
|
|
433
|
-
'web-rtc-
|
|
434
|
+
'web-rtc-player': WebRtcPlayerOptions;
|
|
434
435
|
}
|
|
435
436
|
export interface SkillViewControllerMap {
|
|
436
437
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbstractViewController } from '../..';
|
|
2
|
+
import { ViewControllerOptions, WebRtcPlayer } from '../../types/heartwood.types';
|
|
3
|
+
import { WebRtcStreamer } from '../../webRtcStreaming/WebRtcStreamer';
|
|
4
|
+
export default class WebRtcPlayerViewController extends AbstractViewController<WebRtcPlayer> {
|
|
5
|
+
static id: string;
|
|
6
|
+
private streamer?;
|
|
7
|
+
constructor(options: ViewControllerOptions & WebRtcPlayerOptions);
|
|
8
|
+
setStreamer(streamer: WebRtcStreamer): void;
|
|
9
|
+
createOffer(offerOptions: RTCOfferOptions): Promise<string>;
|
|
10
|
+
setAnswer(answerSdp: string): Promise<void>;
|
|
11
|
+
render(): WebRtcPlayer;
|
|
12
|
+
}
|
|
13
|
+
export interface WebRtcPlayerOptions extends WebRtcPlayer {
|
|
14
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
7
|
+
const __1 = require("../..");
|
|
8
|
+
const SpruceError_1 = __importDefault(require("../../errors/SpruceError"));
|
|
9
|
+
class WebRtcPlayerViewController extends __1.AbstractViewController {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
super(options);
|
|
12
|
+
const { streamer } = options;
|
|
13
|
+
this.streamer = streamer ?? undefined;
|
|
14
|
+
}
|
|
15
|
+
setStreamer(streamer) {
|
|
16
|
+
(0, schema_1.assertOptions)({ streamer }, ['streamer']);
|
|
17
|
+
this.streamer = streamer;
|
|
18
|
+
this.triggerRender();
|
|
19
|
+
}
|
|
20
|
+
async createOffer(offerOptions) {
|
|
21
|
+
const { offerSdp, streamer } = await __1.WebRtcConnection.createOffer({
|
|
22
|
+
offerOptions,
|
|
23
|
+
});
|
|
24
|
+
this.setStreamer(streamer);
|
|
25
|
+
return offerSdp.sdp;
|
|
26
|
+
}
|
|
27
|
+
async setAnswer(answerSdp) {
|
|
28
|
+
if (!this.streamer) {
|
|
29
|
+
throw new SpruceError_1.default({
|
|
30
|
+
code: 'DID_NOT_GENERATE_OFFER',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
await this.streamer.setAnswer(answerSdp);
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return {
|
|
37
|
+
streamer: this.streamer,
|
|
38
|
+
controller: this,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
WebRtcPlayerViewController.id = 'web-rtc-player-card';
|
|
43
|
+
exports.default = WebRtcPlayerViewController;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MockRtcPeerConnection from '../tests/MockRtcPeerConnection';
|
|
2
|
+
import { WebRtcStreamer } from './WebRtcStreamer';
|
|
2
3
|
export default class WebRtcConnection {
|
|
3
|
-
static get RTCPeerConnection():
|
|
4
|
-
|
|
5
|
-
prototype: RTCPeerConnection;
|
|
6
|
-
generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise<RTCCertificate>;
|
|
7
|
-
};
|
|
8
|
-
static set RTCPeerConnection(value: {
|
|
9
|
-
new (configuration?: RTCConfiguration): RTCPeerConnection;
|
|
10
|
-
prototype: RTCPeerConnection;
|
|
11
|
-
generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise<RTCCertificate>;
|
|
12
|
-
});
|
|
4
|
+
static get RTCPeerConnection(): new (config: RTCConfiguration) => RTCPeerConnection | MockRtcPeerConnection;
|
|
5
|
+
static set RTCPeerConnection(value: new (config: RTCConfiguration) => RTCPeerConnection | MockRtcPeerConnection);
|
|
13
6
|
static createOffer(options: WebRtcVcPluginCreateOfferOptions): Promise<{
|
|
14
7
|
offerSdp: RTCSessionDescriptionInit;
|
|
15
|
-
streamer:
|
|
8
|
+
streamer: WebRtcStreamer;
|
|
16
9
|
}>;
|
|
17
10
|
}
|
|
18
11
|
export interface WebRtcVcPluginCreateOfferOptions {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export default class WebRtcStreamerImpl {
|
|
1
|
+
export default class WebRtcStreamerImpl implements WebRtcStreamer {
|
|
2
2
|
private connection;
|
|
3
|
+
static Class?: new (connection: RTCPeerConnection) => WebRtcStreamer;
|
|
3
4
|
protected constructor(connection: RTCPeerConnection);
|
|
4
|
-
static Streamer(connection: RTCPeerConnection):
|
|
5
|
+
static Streamer(connection: RTCPeerConnection): WebRtcStreamer;
|
|
5
6
|
setAnswer(answerSdp: string): Promise<void>;
|
|
6
7
|
onTrack(cb: (event: RTCTrackEvent) => void): void;
|
|
7
8
|
}
|
|
@@ -6,7 +6,7 @@ class WebRtcStreamerImpl {
|
|
|
6
6
|
this.connection = connection;
|
|
7
7
|
}
|
|
8
8
|
static Streamer(connection) {
|
|
9
|
-
return new
|
|
9
|
+
return new (this.Class ?? this)(connection);
|
|
10
10
|
}
|
|
11
11
|
async setAnswer(answerSdp) {
|
|
12
12
|
(0, schema_1.assertOptions)({ answerSdp }, ['answerSdp']);
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CardViewControllerImpl } from '../..';
|
|
2
|
-
import { Card, ViewControllerOptions } from '../../types/heartwood.types';
|
|
3
|
-
import { WebRtcStreamer } from '../../webRtcStreaming/WebRtcStreamer';
|
|
4
|
-
export default class WebRtcStreamingCardViewController extends CardViewControllerImpl {
|
|
5
|
-
static id: string;
|
|
6
|
-
constructor(options: ViewControllerOptions & WebRtcStreamingCardViewControllerOptions);
|
|
7
|
-
setStreamer(streamer: WebRtcStreamer, sectionIdx?: number): void;
|
|
8
|
-
}
|
|
9
|
-
export interface WebRtcStreamingCardViewControllerOptions extends Card {
|
|
10
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { assertOptions } from '@sprucelabs/schema';
|
|
2
|
-
import { CardViewControllerImpl } from '../../index.js';
|
|
3
|
-
class WebRtcStreamingCardViewController extends CardViewControllerImpl {
|
|
4
|
-
constructor(options) {
|
|
5
|
-
super(options);
|
|
6
|
-
}
|
|
7
|
-
setStreamer(streamer, sectionIdx = 0) {
|
|
8
|
-
assertOptions({ streamer }, ['streamer']);
|
|
9
|
-
if (this.getTotalSections() === 0) {
|
|
10
|
-
this.addSection({
|
|
11
|
-
webRtcStreamer: streamer,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
this.updateSection(sectionIdx, {
|
|
16
|
-
webRtcStreamer: streamer,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
WebRtcStreamingCardViewController.id = 'web-rtc-streaming-card';
|
|
22
|
-
export default WebRtcStreamingCardViewController;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CardViewControllerImpl } from '../..';
|
|
2
|
-
import { Card, ViewControllerOptions } from '../../types/heartwood.types';
|
|
3
|
-
import { WebRtcStreamer } from '../../webRtcStreaming/WebRtcStreamer';
|
|
4
|
-
export default class WebRtcStreamingCardViewController extends CardViewControllerImpl {
|
|
5
|
-
static id: string;
|
|
6
|
-
constructor(options: ViewControllerOptions & WebRtcStreamingCardViewControllerOptions);
|
|
7
|
-
setStreamer(streamer: WebRtcStreamer, sectionIdx?: number): void;
|
|
8
|
-
}
|
|
9
|
-
export interface WebRtcStreamingCardViewControllerOptions extends Card {
|
|
10
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schema_1 = require("@sprucelabs/schema");
|
|
4
|
-
const __1 = require("../..");
|
|
5
|
-
class WebRtcStreamingCardViewController extends __1.CardViewControllerImpl {
|
|
6
|
-
constructor(options) {
|
|
7
|
-
super(options);
|
|
8
|
-
}
|
|
9
|
-
setStreamer(streamer, sectionIdx = 0) {
|
|
10
|
-
(0, schema_1.assertOptions)({ streamer }, ['streamer']);
|
|
11
|
-
if (this.getTotalSections() === 0) {
|
|
12
|
-
this.addSection({
|
|
13
|
-
webRtcStreamer: streamer,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
this.updateSection(sectionIdx, {
|
|
18
|
-
webRtcStreamer: streamer,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
WebRtcStreamingCardViewController.id = 'web-rtc-streaming-card';
|
|
24
|
-
exports.default = WebRtcStreamingCardViewController;
|