@tellescope/video-chat 0.0.12 → 0.0.16
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/lib/cjs/controls.d.ts +3 -0
- package/lib/cjs/controls.d.ts.map +1 -0
- package/lib/cjs/controls.js +23 -0
- package/lib/cjs/controls.js.map +1 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/index.native.d.ts +1 -0
- package/lib/cjs/index.native.d.ts.map +1 -1
- package/lib/cjs/index.native.js +1 -0
- package/lib/cjs/index.native.js.map +1 -1
- package/lib/cjs/native/RNVideoRenderView.d.ts +11 -0
- package/lib/cjs/native/RNVideoRenderView.d.ts.map +1 -0
- package/lib/cjs/native/RNVideoRenderView.js +62 -0
- package/lib/cjs/native/RNVideoRenderView.js.map +1 -0
- package/lib/cjs/native/bridge.d.ts +36 -0
- package/lib/cjs/native/bridge.d.ts.map +1 -0
- package/lib/cjs/native/bridge.js +59 -0
- package/lib/cjs/native/bridge.js.map +1 -0
- package/lib/cjs/video.d.ts +11 -3
- package/lib/cjs/video.d.ts.map +1 -1
- package/lib/cjs/video.js +32 -5
- package/lib/cjs/video.js.map +1 -1
- package/lib/cjs/video.native.d.ts +6 -1
- package/lib/cjs/video.native.d.ts.map +1 -1
- package/lib/cjs/video.native.js +78 -33
- package/lib/cjs/video.native.js.map +1 -1
- package/lib/esm/components.d.ts +1 -0
- package/lib/esm/components.d.ts.map +1 -0
- package/lib/esm/components.js +3 -0
- package/lib/esm/components.js.map +1 -0
- package/lib/esm/controls.d.ts +3 -0
- package/lib/esm/controls.d.ts.map +1 -0
- package/lib/esm/controls.js +15 -0
- package/lib/esm/controls.js.map +1 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/index.native.d.ts +1 -0
- package/lib/esm/index.native.d.ts.map +1 -1
- package/lib/esm/index.native.js +1 -0
- package/lib/esm/index.native.js.map +1 -1
- package/lib/esm/native/RNVideoRenderView.d.ts +11 -0
- package/lib/esm/native/RNVideoRenderView.d.ts.map +1 -0
- package/lib/esm/native/RNVideoRenderView.js +56 -0
- package/lib/esm/native/RNVideoRenderView.js.map +1 -0
- package/lib/esm/native/bridge.d.ts +36 -0
- package/lib/esm/native/bridge.d.ts.map +1 -0
- package/lib/esm/native/bridge.js +55 -0
- package/lib/esm/native/bridge.js.map +1 -0
- package/lib/esm/video.d.ts +11 -3
- package/lib/esm/video.d.ts.map +1 -1
- package/lib/esm/video.js +30 -6
- package/lib/esm/video.js.map +1 -1
- package/lib/esm/video.native.d.ts +6 -1
- package/lib/esm/video.native.d.ts.map +1 -1
- package/lib/esm/video.native.js +77 -34
- package/lib/esm/video.native.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/controls.tsx +33 -0
- package/src/index.native.ts +2 -1
- package/src/index.ts +2 -1
- package/src/native/RNVideoRenderView.tsx +31 -0
- package/src/native/bridge.ts +60 -0
- package/src/video.native.tsx +113 -52
- package/src/video.tsx +39 -14
- package/lib/cjs/chat.d.ts +0 -69
- package/lib/cjs/chat.d.ts.map +0 -1
- package/lib/cjs/chat.js +0 -171
- package/lib/cjs/chat.js.map +0 -1
- package/lib/esm/chat.d.ts +0 -69
- package/lib/esm/chat.d.ts.map +0 -1
- package/lib/esm/chat.js +0 -160
- package/lib/esm/chat.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/controls.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,WAAW,mBAQvB,CAAA;AAED,eAAO,MAAM,gBAAgB,mBAQ5B,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
exports.MicrophoneToggle = exports.VideoToggle = void 0;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
// components that work with web or native
|
|
9
|
+
var react_1 = __importDefault(require("react"));
|
|
10
|
+
var mui_1 = require("@tellescope/react-components/lib/esm/mui");
|
|
11
|
+
var controls_1 = require("@tellescope/react-components/lib/esm/controls");
|
|
12
|
+
var video_1 = require("./video");
|
|
13
|
+
var VideoToggle = function () {
|
|
14
|
+
var _a = react_1.default.useContext(video_1.CurrentCallContext), toggleVideo = _a.toggleVideo, videoIsEnabled = _a.videoIsEnabled;
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(controls_1.LabeledIconButton, { Icon: videoIsEnabled ? mui_1.VideoIcon : mui_1.VideoOffIcon, onClick: toggleVideo, label: videoIsEnabled ? "Turn Camera Off" : "Turn Camera On" }, void 0));
|
|
16
|
+
};
|
|
17
|
+
exports.VideoToggle = VideoToggle;
|
|
18
|
+
var MicrophoneToggle = function () {
|
|
19
|
+
var _a = react_1.default.useContext(video_1.CurrentCallContext), microphoneIsEnabled = _a.microphoneIsEnabled, toggleMicrophone = _a.toggleMicrophone;
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(controls_1.LabeledIconButton, { Icon: microphoneIsEnabled ? mui_1.MicrophoneIcon : mui_1.MicrophoneOffIcon, onClick: toggleMicrophone, label: microphoneIsEnabled ? "Turn Microphone Off" : "Turn Microphone On" }, void 0));
|
|
21
|
+
};
|
|
22
|
+
exports.MicrophoneToggle = MicrophoneToggle;
|
|
23
|
+
//# sourceMappingURL=controls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls.js","sourceRoot":"","sources":["../../src/controls.tsx"],"names":[],"mappings":";;;;;;;AAAA,0CAA0C;AAC1C,gDAAyB;AAEzB,gEAKiD;AACjD,0EAAiF;AACjF,iCAEgB;AAET,IAAM,WAAW,GAAG;IACnB,IAAA,KAAkC,eAAK,CAAC,UAAU,CAAC,0BAAkB,CAAC,EAApE,WAAW,iBAAA,EAAE,cAAc,oBAAyC,CAAA;IAE5E,OAAO,CACL,uBAAC,4BAAiB,IAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,eAAS,CAAC,CAAC,CAAC,kBAAY,EAAE,OAAO,EAAE,WAAW,EACtF,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,gBAAgB,WAC5D,CACH,CAAA;AACH,CAAC,CAAA;AARY,QAAA,WAAW,eAQvB;AAEM,IAAM,gBAAgB,GAAG;IACxB,IAAA,KAA4C,eAAK,CAAC,UAAU,CAAC,0BAAkB,CAAC,EAA9E,mBAAmB,yBAAA,EAAE,gBAAgB,sBAAyC,CAAA;IAEtF,OAAO,CACL,uBAAC,4BAAiB,IAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,oBAAc,CAAC,CAAC,CAAC,uBAAiB,EAAE,OAAO,EAAE,gBAAgB,EAC1G,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,oBAAoB,WACzE,CACH,CAAA;AACH,CAAC,CAAA;AARY,QAAA,gBAAgB,oBAQ5B"}
|
package/lib/cjs/index.d.ts
CHANGED
package/lib/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAA"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -11,4 +11,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./video"), exports);
|
|
14
|
+
__exportStar(require("./controls"), exports);
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA0B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../src/index.native.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../src/index.native.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA"}
|
package/lib/cjs/index.native.js
CHANGED
|
@@ -11,4 +11,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./video"), exports);
|
|
14
|
+
__exportStar(require("./controls"), exports);
|
|
14
15
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../src/index.native.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAuB"}
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../src/index.native.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAuB;AACvB,6CAA0B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
export declare class RNVideoView extends React.Component<{
|
|
4
|
+
tileId: number;
|
|
5
|
+
style?: ViewStyle;
|
|
6
|
+
}> {
|
|
7
|
+
componentDidMount(): void;
|
|
8
|
+
componentWillUnmount(): void;
|
|
9
|
+
render(): JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=RNVideoRenderView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RNVideoRenderView.d.ts","sourceRoot":"","sources":["../../../src/native/RNVideoRenderView.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0C,SAAS,EAAE,MAAM,cAAc,CAAC;AAGjF,qBAAa,WAAY,SAAQ,KAAK,CAAC,SAAS,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;IACrF,iBAAiB;IAUjB,oBAAoB;IAIpB,MAAM;CAGP"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.RNVideoView = void 0;
|
|
33
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
34
|
+
var react_1 = __importDefault(require("react"));
|
|
35
|
+
var react_native_1 = require("react-native");
|
|
36
|
+
var bridge_1 = require("./bridge");
|
|
37
|
+
var RNVideoView = /** @class */ (function (_super) {
|
|
38
|
+
__extends(RNVideoView, _super);
|
|
39
|
+
function RNVideoView() {
|
|
40
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
41
|
+
}
|
|
42
|
+
RNVideoView.prototype.componentDidMount = function () {
|
|
43
|
+
var _this = this;
|
|
44
|
+
// we need to delay the bind video
|
|
45
|
+
// Because "componentDidMount" will be called "immediately after the initial rendering occurs"
|
|
46
|
+
// This is *before* RCTUIManager add this view to register (so that viewForReactTag() can return a view)
|
|
47
|
+
// So we need to dispatch bindVideoView after this function complete
|
|
48
|
+
setTimeout(function () {
|
|
49
|
+
bridge_1.NativeFunction.bindVideoView((0, react_native_1.findNodeHandle)(_this), _this.props.tileId);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
RNVideoView.prototype.componentWillUnmount = function () {
|
|
53
|
+
bridge_1.NativeFunction.unbindVideoView(this.props.tileId);
|
|
54
|
+
};
|
|
55
|
+
RNVideoView.prototype.render = function () {
|
|
56
|
+
return (0, jsx_runtime_1.jsx)(RNVideoRenderViewNative, __assign({}, this.props), void 0);
|
|
57
|
+
};
|
|
58
|
+
return RNVideoView;
|
|
59
|
+
}(react_1.default.Component));
|
|
60
|
+
exports.RNVideoView = RNVideoView;
|
|
61
|
+
var RNVideoRenderViewNative = (0, react_native_1.requireNativeComponent)('RNVideoView');
|
|
62
|
+
//# sourceMappingURL=RNVideoRenderView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RNVideoRenderView.js","sourceRoot":"","sources":["../../../src/native/RNVideoRenderView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,gDAA0B;AAC1B,6CAAiF;AACjF,mCAA0C;AAE1C;IAAiC,+BAAsD;IAAvF;;IAkBA,CAAC;IAjBC,uCAAiB,GAAjB;QAAA,iBAQC;QAPC,mCAAmC;QACnC,8FAA8F;QAC9F,wGAAwG;QACxG,oEAAoE;QACpE,UAAU,CAAC;YACT,uBAAc,CAAC,aAAa,CAAC,IAAA,6BAAc,EAAC,KAAI,CAAC,EAAE,KAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,0CAAoB,GAApB;QACE,uBAAc,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAED,4BAAM,GAAN;QACE,OAAO,uBAAC,uBAAuB,eAAK,IAAI,CAAC,KAAK,UAAI,CAAC;IACrD,CAAC;IACH,kBAAC;AAAD,CAAC,AAlBD,CAAiC,eAAK,CAAC,SAAS,GAkB/C;AAlBY,kCAAW;AAoBxB,IAAM,uBAAuB,GAAG,IAAA,qCAAsB,EAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { NativeEventEmitter } from 'react-native';
|
|
2
|
+
export declare const MobileSDKEvent: {
|
|
3
|
+
OnMeetingStart: string;
|
|
4
|
+
OnMeetingEnd: string;
|
|
5
|
+
OnAttendeesJoin: string;
|
|
6
|
+
OnAttendeesLeave: string;
|
|
7
|
+
OnAttendeesMute: string;
|
|
8
|
+
OnAttendeesUnmute: string;
|
|
9
|
+
OnAddVideoTile: string;
|
|
10
|
+
OnRemoveVideoTile: string;
|
|
11
|
+
OnError: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const MeetingError: {
|
|
14
|
+
OnMaximumConcurrentVideoReached: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function getSDKEventEmitter(): NativeEventEmitter;
|
|
17
|
+
/**
|
|
18
|
+
* These are functions available for React native to call on native
|
|
19
|
+
* i.e. React Native -> Native
|
|
20
|
+
*
|
|
21
|
+
* NativeModules.NativeMobileSDKBridge.startMeeting(meetingId, userName)
|
|
22
|
+
* NativeModules.NativeMobileSDKBridge.stopMeeting()
|
|
23
|
+
* NativeModules.NativeMobileSDKBridge.setMute(isMute) -> boolean
|
|
24
|
+
* NativeModules.NativeMobileSDKBridge.setCameraOn(isOn) -> boolean
|
|
25
|
+
* NativeModules.NativeMobileSDKBridge.bindVideoView(reactTagId, tileId)
|
|
26
|
+
* NativeModules.NativeMobileSDKBridge.unbindVideoView(reactTagId, tileId)
|
|
27
|
+
*/
|
|
28
|
+
export declare const NativeFunction: {
|
|
29
|
+
startMeeting: any;
|
|
30
|
+
stopMeeting: any;
|
|
31
|
+
setMute: any;
|
|
32
|
+
setCameraOn: any;
|
|
33
|
+
bindVideoView: any;
|
|
34
|
+
unbindVideoView: any;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../../src/native/bridge.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAgBjE,eAAO,MAAM,cAAc;;;;;;;;;;CAU1B,CAAA;AAED,eAAO,MAAM,YAAY;;CAExB,CAAA;AAED,wBAAgB,kBAAkB,uBAEjC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc;;;;;;;CAO1B,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
* SPDX-License-Identifier: MIT-0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.NativeFunction = exports.getSDKEventEmitter = exports.MeetingError = exports.MobileSDKEvent = void 0;
|
|
8
|
+
var react_native_1 = require("react-native");
|
|
9
|
+
/**
|
|
10
|
+
* These are the function that will be called from native side
|
|
11
|
+
* i.e. Native -> React Native
|
|
12
|
+
*
|
|
13
|
+
* NativeEventEmitter.onMeetingStart(meetingName)
|
|
14
|
+
* NativeEventEmitter.onMeetingEnd()
|
|
15
|
+
* NativeEventEmitter.onAttendeesJoin(attendeeInfo)
|
|
16
|
+
* NativeEventEmitter.onAttendeesLeave(attendeeInfo)
|
|
17
|
+
* NativeEventEmitter.onAddVideoTile(tileState)
|
|
18
|
+
* NativeEventEmitter.onRemoveVideoTile(tileState)
|
|
19
|
+
* NativeEventEmitter.onError(errorMessage)
|
|
20
|
+
*/
|
|
21
|
+
var _eventEmitter = new react_native_1.NativeEventEmitter(react_native_1.NativeModules.NativeMobileSDKBridge);
|
|
22
|
+
exports.MobileSDKEvent = {
|
|
23
|
+
OnMeetingStart: 'OnMeetingStart',
|
|
24
|
+
OnMeetingEnd: 'OnMeetingEnd',
|
|
25
|
+
OnAttendeesJoin: 'OnAttendeesJoin',
|
|
26
|
+
OnAttendeesLeave: 'OnAttendeesLeave',
|
|
27
|
+
OnAttendeesMute: 'OnAttendeesMute',
|
|
28
|
+
OnAttendeesUnmute: 'OnAttendeesUnmute',
|
|
29
|
+
OnAddVideoTile: 'OnAddVideoTile',
|
|
30
|
+
OnRemoveVideoTile: 'OnRemoveVideoTile',
|
|
31
|
+
OnError: 'OnError',
|
|
32
|
+
};
|
|
33
|
+
exports.MeetingError = {
|
|
34
|
+
OnMaximumConcurrentVideoReached: "OnMaximumConcurrentVideoReached"
|
|
35
|
+
};
|
|
36
|
+
function getSDKEventEmitter() {
|
|
37
|
+
return _eventEmitter;
|
|
38
|
+
}
|
|
39
|
+
exports.getSDKEventEmitter = getSDKEventEmitter;
|
|
40
|
+
/**
|
|
41
|
+
* These are functions available for React native to call on native
|
|
42
|
+
* i.e. React Native -> Native
|
|
43
|
+
*
|
|
44
|
+
* NativeModules.NativeMobileSDKBridge.startMeeting(meetingId, userName)
|
|
45
|
+
* NativeModules.NativeMobileSDKBridge.stopMeeting()
|
|
46
|
+
* NativeModules.NativeMobileSDKBridge.setMute(isMute) -> boolean
|
|
47
|
+
* NativeModules.NativeMobileSDKBridge.setCameraOn(isOn) -> boolean
|
|
48
|
+
* NativeModules.NativeMobileSDKBridge.bindVideoView(reactTagId, tileId)
|
|
49
|
+
* NativeModules.NativeMobileSDKBridge.unbindVideoView(reactTagId, tileId)
|
|
50
|
+
*/
|
|
51
|
+
exports.NativeFunction = {
|
|
52
|
+
startMeeting: react_native_1.NativeModules.NativeMobileSDKBridge.startMeeting,
|
|
53
|
+
stopMeeting: react_native_1.NativeModules.NativeMobileSDKBridge.stopMeeting,
|
|
54
|
+
setMute: react_native_1.NativeModules.NativeMobileSDKBridge.setMute,
|
|
55
|
+
setCameraOn: react_native_1.NativeModules.NativeMobileSDKBridge.setCameraOn,
|
|
56
|
+
bindVideoView: react_native_1.NativeModules.NativeMobileSDKBridge.bindVideoView,
|
|
57
|
+
unbindVideoView: react_native_1.NativeModules.NativeMobileSDKBridge.unbindVideoView,
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../../src/native/bridge.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6CAAiE;AAEjE;;;;;;;;;;;GAWG;AACH,IAAM,aAAa,GAAG,IAAI,iCAAkB,CAAC,4BAAa,CAAC,qBAAqB,CAAC,CAAC;AAErE,QAAA,cAAc,GAAG;IAC5B,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;IAC5B,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,eAAe,EAAE,iBAAiB;IAClC,iBAAiB,EAAE,mBAAmB;IACtC,cAAc,EAAE,gBAAgB;IAChC,iBAAiB,EAAE,mBAAmB;IACtC,OAAO,EAAE,SAAS;CACnB,CAAA;AAEY,QAAA,YAAY,GAAG;IAC1B,+BAA+B,EAAE,iCAAiC;CACnE,CAAA;AAED,SAAgB,kBAAkB;IAChC,OAAO,aAAa,CAAC;AACvB,CAAC;AAFD,gDAEC;AAED;;;;;;;;;;GAUG;AACU,QAAA,cAAc,GAAG;IAC5B,YAAY,EAAE,4BAAa,CAAC,qBAAqB,CAAC,YAAY;IAC9D,WAAW,EAAE,4BAAa,CAAC,qBAAqB,CAAC,WAAW;IAC5D,OAAO,EAAE,4BAAa,CAAC,qBAAqB,CAAC,OAAO;IACpD,WAAW,EAAE,4BAAa,CAAC,qBAAqB,CAAC,WAAW;IAC5D,aAAa,EAAE,4BAAa,CAAC,qBAAqB,CAAC,aAAa;IAChE,eAAe,EAAE,4BAAa,CAAC,qBAAqB,CAAC,eAAe;CACrE,CAAA"}
|
package/lib/cjs/video.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
2
|
import { UserIdentity } from "@tellescope/types-utilities";
|
|
3
3
|
import { AttendeeInfo, MeetingInfo } from '@tellescope/types-models';
|
|
4
4
|
import { darkTheme, VideoTileGrid } from 'amazon-chime-sdk-component-library-react';
|
|
@@ -11,9 +11,12 @@ export declare const CurrentCallContext: React.Context<{
|
|
|
11
11
|
setMeeting: (m: MeetingInfo | undefined) => void;
|
|
12
12
|
videoIsEnabled: boolean;
|
|
13
13
|
toggleVideo: () => Promise<void>;
|
|
14
|
+
microphoneIsEnabled: boolean;
|
|
15
|
+
toggleMicrophone: () => Promise<void>;
|
|
14
16
|
attendees: AttendeeDisplayInfo[];
|
|
15
|
-
shareScreenId:
|
|
16
|
-
|
|
17
|
+
shareScreenId: number | null;
|
|
18
|
+
localTileId: number | null;
|
|
19
|
+
videoTiles: (number)[];
|
|
17
20
|
}>;
|
|
18
21
|
export interface VideoProps {
|
|
19
22
|
children?: React.ReactNode;
|
|
@@ -42,5 +45,10 @@ export declare const useJoinVideoCall: () => {
|
|
|
42
45
|
}) => Promise<void>;
|
|
43
46
|
};
|
|
44
47
|
export declare type JoinVideoCallReturnType = ReturnType<typeof useJoinVideoCall>;
|
|
48
|
+
export interface VideoViewProps {
|
|
49
|
+
style?: CSSProperties;
|
|
50
|
+
}
|
|
51
|
+
export declare const SelfView: ({ style }: VideoViewProps) => JSX.Element;
|
|
52
|
+
export declare const useRemoteViews: ({ style }: VideoViewProps) => JSX.Element[];
|
|
45
53
|
export { VideoTileGrid };
|
|
46
54
|
//# sourceMappingURL=video.d.ts.map
|
package/lib/cjs/video.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/video.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/video.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAyB,aAAa,EAAY,MAAM,OAAO,CAAA;AAM7E,OAAO,EACL,YAAY,EACb,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,YAAY,EACZ,WAAW,EACZ,MAAM,0BAA0B,CAAA;AAIjC,OAAO,EAEL,SAAS,EAGT,aAAa,EAed,MAAM,0CAA0C,CAAC;AAGlD,oBAAY,mBAAm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
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69
|
-
exports.VideoTileGrid = exports.useJoinVideoCall = exports.useStartVideoCall = exports.WithVideo = exports.CurrentCallContext = void 0;
|
|
69
|
+
exports.VideoTileGrid = exports.useRemoteViews = exports.SelfView = exports.useJoinVideoCall = exports.useStartVideoCall = exports.WithVideo = exports.CurrentCallContext = void 0;
|
|
70
70
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
71
71
|
var react_1 = __importStar(require("react"));
|
|
72
72
|
var authentication_1 = require("@tellescope/react-components/lib/esm/authentication");
|
|
@@ -77,19 +77,32 @@ Object.defineProperty(exports, "VideoTileGrid", { enumerable: true, get: functio
|
|
|
77
77
|
amazon_chime_sdk_component_library_react_1.VideoTileGrid; } });
|
|
78
78
|
exports.CurrentCallContext = react_1.default.createContext({});
|
|
79
79
|
var WithContext = function (_a) {
|
|
80
|
-
var _b;
|
|
81
80
|
var children = _a.children;
|
|
82
|
-
var
|
|
83
|
-
var
|
|
81
|
+
var _b = (0, react_1.useState)(undefined), meeting = _b[0], setMeeting = _b[1];
|
|
82
|
+
var _c = (0, amazon_chime_sdk_component_library_react_1.useLocalVideo)(), toggleVideo = _c.toggleVideo, videoIsEnabled = _c.isVideoEnabled, localTileId = _c.tileId;
|
|
84
83
|
var roster = (0, amazon_chime_sdk_component_library_react_1.useRosterState)().roster;
|
|
85
84
|
var tileId = (0, amazon_chime_sdk_component_library_react_1.useContentShareState)().tileId;
|
|
86
85
|
var tiles = (0, amazon_chime_sdk_component_library_react_1.useRemoteVideoTileState)().tiles;
|
|
86
|
+
var _d = (0, amazon_chime_sdk_component_library_react_1.useToggleLocalMute)(), muted = _d.muted, toggleMute = _d.toggleMute;
|
|
87
87
|
var attendees = [];
|
|
88
88
|
for (var attendeeId in roster) {
|
|
89
89
|
var externalUserId = roster[attendeeId].externalUserId;
|
|
90
90
|
attendees.push({ attendeeId: attendeeId, externalUserId: externalUserId });
|
|
91
91
|
}
|
|
92
|
-
return ((0, jsx_runtime_1.jsx)(exports.CurrentCallContext.Provider, __assign({ value: {
|
|
92
|
+
return ((0, jsx_runtime_1.jsx)(exports.CurrentCallContext.Provider, __assign({ value: {
|
|
93
|
+
attendees: attendees,
|
|
94
|
+
localTileId: localTileId,
|
|
95
|
+
videoTiles: tiles,
|
|
96
|
+
shareScreenId: tileId,
|
|
97
|
+
meeting: meeting,
|
|
98
|
+
setMeeting: setMeeting,
|
|
99
|
+
videoIsEnabled: videoIsEnabled,
|
|
100
|
+
toggleVideo: toggleVideo,
|
|
101
|
+
microphoneIsEnabled: !muted,
|
|
102
|
+
toggleMicrophone: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
103
|
+
return [2 /*return*/, toggleMute()];
|
|
104
|
+
}); }); },
|
|
105
|
+
} }, { children: children }), void 0));
|
|
93
106
|
};
|
|
94
107
|
var WithVideo = function (_a) {
|
|
95
108
|
var children = _a.children, _b = _a.theme, theme = _b === void 0 ? amazon_chime_sdk_component_library_react_1.darkTheme : _b;
|
|
@@ -198,4 +211,18 @@ var useJoinVideoCall = function () {
|
|
|
198
211
|
return { meeting: meeting, videoIsEnabled: videoIsEnabled, toggleVideo: toggleVideo, joinMeeting: joinMeeting };
|
|
199
212
|
};
|
|
200
213
|
exports.useJoinVideoCall = useJoinVideoCall;
|
|
214
|
+
var SelfView = function (_a) {
|
|
215
|
+
var style = _a.style;
|
|
216
|
+
return (0, jsx_runtime_1.jsx)("div", __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(amazon_chime_sdk_component_library_react_1.LocalVideo, {}, void 0) }), void 0);
|
|
217
|
+
};
|
|
218
|
+
exports.SelfView = SelfView;
|
|
219
|
+
var useRemoteViews = function (_a) {
|
|
220
|
+
var style = _a.style;
|
|
221
|
+
var _b = react_1.default.useContext(exports.CurrentCallContext), localTileId = _b.localTileId, videoTiles = _b.videoTiles;
|
|
222
|
+
var nonLocal = videoTiles.filter(function (v) { return v !== localTileId; });
|
|
223
|
+
return nonLocal.map(function (tileId) {
|
|
224
|
+
return (0, jsx_runtime_1.jsx)(amazon_chime_sdk_component_library_react_1.RemoteVideo, { style: style, tileId: tileId }, void 0);
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
exports.useRemoteViews = useRemoteViews;
|
|
201
228
|
//# sourceMappingURL=video.js.map
|
package/lib/cjs/video.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.js","sourceRoot":"","sources":["../../src/video.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6E;AAE7E,sFAE4D;
|
|
1
|
+
{"version":3,"file":"video.js","sourceRoot":"","sources":["../../src/video.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6E;AAE7E,sFAE4D;AAW5D,uDAAkD;AAClD,qGAoBkD;AA0IzC;IA1JP,cAAc;IACd,wDAAa,OAyJO;AArIT,QAAA,kBAAkB,GAAG,eAAK,CAAC,aAAa,CAAC,EAOrD,CAAC,CAAA;AAKF,IAAM,WAAW,GAAG,UAAC,EAA4C;QAA1C,QAAQ,cAAA;IACvB,IAAA,KAAwB,IAAA,gBAAQ,EAAC,SAAoC,CAAC,EAArE,OAAO,QAAA,EAAE,UAAU,QAAkD,CAAA;IACtE,IAAA,KAAuE,IAAA,wDAAa,GAAE,EAApF,WAAW,iBAAA,EAAkB,cAAc,oBAAA,EAAU,WAAW,YAAoB,CAAC;IACrF,IAAA,MAAM,GAAK,IAAA,yDAAc,GAAE,OAArB,CAAqB;IAC3B,IAAA,MAAM,GAAK,IAAA,+DAAoB,GAAE,OAA3B,CAA2B;IACjC,IAAA,KAAK,GAAK,IAAA,kEAAuB,GAAE,MAA9B,C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AAC,WAAW,CAAC,OAAO,CAAC,CAAA;;;;SAChC,CAAA;IAED,OAAO,EAAE,OAAO,SAAA,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,aAAA,EAAE,WAAW,aAAA,EAAE,CAAA;AAC9E,CAAC,CAAA;AAXY,QAAA,gBAAgB,oBAW5B;AAMM,IAAM,QAAQ,GAAG,UAAC,EAAyB;QAAvB,KAAK,WAAA;IAAuB,OAAA,yCAAK,KAAK,EAAE,KAAK,gBAAE,uBAAC,qDAAU,aAAE,YAAM;AAAtC,CAAsC,CAAA;AAAhF,QAAA,QAAQ,YAAwE;AAEtF,IAAM,cAAc,GAAG,UAAC,EAA0B;QAAxB,KAAK,WAAA;IAC9B,IAAA,KAA8B,eAAK,CAAC,UAAU,CAAC,0BAAkB,CAAC,EAAhE,WAAW,iBAAA,EAAE,UAAU,gBAAyC,CAAA;IACxE,IAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,WAAW,EAAjB,CAAiB,CAAC,CAAA;IAE1D,OAAO,QAAQ,CAAC,GAAG,CAAC,UAAA,MAAM;QACxB,OAAA,uBAAC,sDAAW,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,WAAI;IAA7C,CAA6C,CAC9C,CAAA;AACH,CAAC,CAAA;AAPY,QAAA,cAAc,kBAO1B"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { JoinVideoCallReturnType, StartVideoCallReturnType, VideoProps, VideoViewProps } from "./video.js";
|
|
2
3
|
export declare const WithVideo: ({ children }: VideoProps) => JSX.Element;
|
|
4
|
+
export declare const useRemoteViews: ({ style }: {
|
|
5
|
+
style: React.CSSProperties;
|
|
6
|
+
}) => JSX.Element[];
|
|
7
|
+
export declare const SelfView: ({ style }: VideoViewProps) => JSX.Element | null;
|
|
3
8
|
export declare const useStartVideoCall: () => StartVideoCallReturnType;
|
|
4
9
|
export declare const useJoinVideoCall: () => JoinVideoCallReturnType;
|
|
5
10
|
export declare const VideoTileGrid: () => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.native.d.ts","sourceRoot":"","sources":["../../src/video.native.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"video.native.d.ts","sourceRoot":"","sources":["../../src/video.native.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAuD,MAAM,OAAO,CAAA;AAsB3E,OAAO,EAEL,uBAAuB,EACvB,wBAAwB,EACxB,UAAU,EAEV,cAAc,EACf,MAAM,YAAY,CAAA;AAenB,eAAO,MAAM,SAAS,iBAAmB,UAAU,gBA6GlD,CAAA;AAGD,eAAO,MAAM,cAAc;WAAyB,MAAM,aAAa;mBAOtE,CAAA;AAED,eAAO,MAAM,QAAQ,cAAgB,cAAc,uBAOlD,CAAA;AAED,eAAO,MAAM,iBAAiB,QAAO,wBAqDpC,CAAA;AAED,eAAO,MAAM,gBAAgB,QAAO,uBAQnC,CAAA;AACD,eAAO,MAAM,aAAa,mBAgDzB,CAAA"}
|
package/lib/cjs/video.native.js
CHANGED
|
@@ -75,7 +75,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
75
75
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
76
76
|
};
|
|
77
77
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
|
-
exports.VideoTileGrid = exports.useJoinVideoCall = exports.useStartVideoCall = exports.WithVideo = void 0;
|
|
78
|
+
exports.VideoTileGrid = exports.useJoinVideoCall = exports.useStartVideoCall = exports.SelfView = exports.useRemoteViews = exports.WithVideo = void 0;
|
|
79
79
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
80
80
|
// logic pulled + refactored from
|
|
81
81
|
// https://github.com/aws-samples/amazon-chime-react-native-demo/blob/master/src/containers/Meeting.js
|
|
@@ -87,7 +87,8 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
87
87
|
var react_1 = __importStar(require("react"));
|
|
88
88
|
var react_native_1 = require("react-native");
|
|
89
89
|
var authentication_1 = require("@tellescope/react-components/lib/esm/authentication");
|
|
90
|
-
var
|
|
90
|
+
var layout_1 = require("@tellescope/react-components/lib/esm/layout");
|
|
91
|
+
var mui_native_1 = require("@tellescope/react-components/lib/esm/mui.native");
|
|
91
92
|
var video_js_1 = require("./video.js");
|
|
92
93
|
var bridge_1 = require("./native/bridge");
|
|
93
94
|
var RNVideoRenderView_1 = require("./native/RNVideoRenderView");
|
|
@@ -96,28 +97,44 @@ var WithVideo = function (_a) {
|
|
|
96
97
|
var _b = (0, react_1.useState)(undefined), meeting = _b[0], setMeeting = _b[1];
|
|
97
98
|
var _c = (0, react_1.useState)(false), inMeeting = _c[0], setInMeeting = _c[1];
|
|
98
99
|
var _d = (0, react_1.useState)(false), isLoading = _d[0], setIsLoading = _d[1];
|
|
99
|
-
var _e = (0, react_1.useState)(false),
|
|
100
|
-
var _f = (0, react_1.useState)(
|
|
101
|
-
var _g = (0, react_1.useState)(
|
|
102
|
-
var _h = (0, react_1.useState)(
|
|
103
|
-
var
|
|
100
|
+
var _e = (0, react_1.useState)(false), muted = _e[0], setMuted = _e[1];
|
|
101
|
+
var _f = (0, react_1.useState)(false), videoIsEnabled = _f[0], setVideoIsEnabled = _f[1];
|
|
102
|
+
var _g = (0, react_1.useState)([]), videoTiles = _g[0], setVideoTiles = _g[1];
|
|
103
|
+
var _h = (0, react_1.useState)(null), localTileId = _h[0], setLocalTileId = _h[1];
|
|
104
|
+
var _j = (0, react_1.useState)(null), screenShareTile = _j[0], setScreenShareTile = _j[1];
|
|
105
|
+
var _k = (0, react_1.useState)([]), attendees = _k[0], setAttendees = _k[1];
|
|
106
|
+
var toggleVideo = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
+
return __generator(this, function (_a) {
|
|
108
|
+
bridge_1.NativeFunction.setCameraOn(!videoIsEnabled);
|
|
109
|
+
setVideoIsEnabled(function (v) { return !v; });
|
|
110
|
+
return [2 /*return*/];
|
|
111
|
+
});
|
|
112
|
+
}); };
|
|
113
|
+
var toggleMic = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
114
|
+
return __generator(this, function (_a) {
|
|
115
|
+
bridge_1.NativeFunction.setMute(!muted);
|
|
116
|
+
setMuted(function (m) { return !m; });
|
|
117
|
+
return [2 /*return*/];
|
|
118
|
+
});
|
|
119
|
+
}); };
|
|
104
120
|
var emitter = (0, bridge_1.getSDKEventEmitter)();
|
|
105
121
|
(0, react_1.useEffect)(function () {
|
|
106
122
|
var startSubscription = emitter.addListener(bridge_1.MobileSDKEvent.OnMeetingStart, function () {
|
|
107
123
|
setInMeeting(true);
|
|
108
124
|
setIsLoading(false);
|
|
109
125
|
});
|
|
110
|
-
|
|
111
|
-
|
|
126
|
+
// called when user clicks Leave Meeting or meeting is ended by host
|
|
127
|
+
var endSubscription = emitter.addListener(bridge_1.MobileSDKEvent.OnMeetingEnd, function (a) {
|
|
128
|
+
setInMeeting(false);
|
|
112
129
|
setIsLoading(false);
|
|
113
130
|
});
|
|
114
|
-
var joinSubscription = emitter.addListener(bridge_1.MobileSDKEvent.OnAttendeesJoin, function (
|
|
115
|
-
var attendeeId =
|
|
131
|
+
var joinSubscription = emitter.addListener(bridge_1.MobileSDKEvent.OnAttendeesJoin, function (added) {
|
|
132
|
+
var attendeeId = added.attendeeId, externalUserId = added.externalUserId;
|
|
116
133
|
setAttendees(function (as) { return !as.find(function (a) { return a.attendeeId === attendeeId; })
|
|
117
134
|
? __spreadArray([{ attendeeId: attendeeId, externalUserId: externalUserId, muted: false }], as, true) : as; });
|
|
118
135
|
});
|
|
119
|
-
var leaveSubscription = emitter.addListener(bridge_1.MobileSDKEvent.OnAttendeesLeave, function (
|
|
120
|
-
var attendeeId =
|
|
136
|
+
var leaveSubscription = emitter.addListener(bridge_1.MobileSDKEvent.OnAttendeesLeave, function (leaving) {
|
|
137
|
+
var attendeeId = leaving.attendeeId;
|
|
121
138
|
setAttendees(function (as) { return as.filter(function (a) { return a.attendeeId !== attendeeId; }); });
|
|
122
139
|
});
|
|
123
140
|
var errorSubscription = emitter.addListener(bridge_1.MobileSDKEvent.OnError, function (message) {
|
|
@@ -134,12 +151,15 @@ var WithVideo = function (_a) {
|
|
|
134
151
|
setScreenShareTile(tileState.tileId);
|
|
135
152
|
return;
|
|
136
153
|
}
|
|
137
|
-
|
|
154
|
+
if (tileState.isLocal) {
|
|
155
|
+
setLocalTileId(tileState.tileId);
|
|
156
|
+
}
|
|
157
|
+
setVideoTiles(function (v) { return __spreadArray(__spreadArray([], v, true), [tileState.tileId], false); });
|
|
138
158
|
setVideoIsEnabled(function (v) { return tileState.isLocal ? true : v; });
|
|
139
159
|
});
|
|
140
160
|
var removeVideoSubscription = emitter.addListener(bridge_1.MobileSDKEvent.OnRemoveVideoTile, function (tileState) {
|
|
141
161
|
if (tileState.isScreenShare) {
|
|
142
|
-
setScreenShareTile(
|
|
162
|
+
setScreenShareTile(null);
|
|
143
163
|
return;
|
|
144
164
|
}
|
|
145
165
|
setVideoTiles(function (vs) { return vs.filter(function (v) { return v !== tileState.tileId; }); });
|
|
@@ -157,9 +177,36 @@ var WithVideo = function (_a) {
|
|
|
157
177
|
removeVideoSubscription.remove();
|
|
158
178
|
};
|
|
159
179
|
}, [emitter]);
|
|
160
|
-
return ((0, jsx_runtime_1.jsx)(video_js_1.CurrentCallContext.Provider, __assign({ value: {
|
|
180
|
+
return ((0, jsx_runtime_1.jsx)(video_js_1.CurrentCallContext.Provider, __assign({ value: {
|
|
181
|
+
attendees: attendees,
|
|
182
|
+
localTileId: localTileId,
|
|
183
|
+
videoTiles: videoTiles,
|
|
184
|
+
meeting: meeting,
|
|
185
|
+
shareScreenId: screenShareTile,
|
|
186
|
+
setMeeting: setMeeting,
|
|
187
|
+
videoIsEnabled: videoIsEnabled,
|
|
188
|
+
toggleVideo: toggleVideo,
|
|
189
|
+
microphoneIsEnabled: !muted,
|
|
190
|
+
toggleMicrophone: toggleMic,
|
|
191
|
+
} }, { children: children }), void 0));
|
|
161
192
|
};
|
|
162
193
|
exports.WithVideo = WithVideo;
|
|
194
|
+
var useRemoteViews = function (_a) {
|
|
195
|
+
var style = _a.style;
|
|
196
|
+
var _b = react_1.default.useContext(video_js_1.CurrentCallContext), localTileId = _b.localTileId, videoTiles = _b.videoTiles;
|
|
197
|
+
var nonLocal = videoTiles.filter(function (v) { return v !== localTileId; });
|
|
198
|
+
return nonLocal.map(function (tileId) { var _a; return (0, jsx_runtime_1.jsx)(RNVideoRenderView_1.RNVideoView, { style: (_a = (0, mui_native_1.convert_CSS_to_RNStyles)(style)) !== null && _a !== void 0 ? _a : styles.video, tileId: tileId }, void 0); });
|
|
199
|
+
};
|
|
200
|
+
exports.useRemoteViews = useRemoteViews;
|
|
201
|
+
var SelfView = function (_a) {
|
|
202
|
+
var _b;
|
|
203
|
+
var style = _a.style;
|
|
204
|
+
var localTileId = react_1.default.useContext(video_js_1.CurrentCallContext).localTileId;
|
|
205
|
+
if (!localTileId)
|
|
206
|
+
return null;
|
|
207
|
+
return ((0, jsx_runtime_1.jsx)(RNVideoRenderView_1.RNVideoView, { style: (_b = (0, mui_native_1.convert_CSS_to_RNStyles)(style)) !== null && _b !== void 0 ? _b : styles.video, tileId: localTileId }, void 0));
|
|
208
|
+
};
|
|
209
|
+
exports.SelfView = SelfView;
|
|
163
210
|
var useStartVideoCall = function () {
|
|
164
211
|
var session = (0, authentication_1.useSession)();
|
|
165
212
|
var _a = react_1.default.useContext(video_js_1.CurrentCallContext), meeting = _a.meeting, setMeeting = _a.setMeeting, videoIsEnabled = _a.videoIsEnabled, toggleVideo = _a.toggleVideo;
|
|
@@ -228,7 +275,16 @@ var useStartVideoCall = function () {
|
|
|
228
275
|
}
|
|
229
276
|
});
|
|
230
277
|
}); };
|
|
231
|
-
return {
|
|
278
|
+
return {
|
|
279
|
+
meeting: meeting,
|
|
280
|
+
videoIsEnabled: videoIsEnabled,
|
|
281
|
+
starting: starting,
|
|
282
|
+
ending: ending,
|
|
283
|
+
toggleVideo: toggleVideo,
|
|
284
|
+
createAndStartMeeting: createAndStartMeeting,
|
|
285
|
+
addAttendees: addAttendees,
|
|
286
|
+
endMeeting: endMeeting,
|
|
287
|
+
};
|
|
232
288
|
};
|
|
233
289
|
exports.useStartVideoCall = useStartVideoCall;
|
|
234
290
|
var useJoinVideoCall = function () {
|
|
@@ -245,24 +301,13 @@ exports.useJoinVideoCall = useJoinVideoCall;
|
|
|
245
301
|
var VideoTileGrid = function () {
|
|
246
302
|
var _a = (0, react_1.useContext)(video_js_1.CurrentCallContext),
|
|
247
303
|
// attendees,
|
|
248
|
-
|
|
249
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
304
|
+
videoTiles = _a.videoTiles, toggleVideo = _a.toggleVideo;
|
|
305
|
+
return ((0, jsx_runtime_1.jsxs)(layout_1.Flex, __assign({ column: true, justifyContent: "space-between", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, __assign({ style: styles.videoContainer }, { children: videoTiles.length > 0 ? videoTiles.map(function (tileId) {
|
|
250
306
|
return (0, jsx_runtime_1.jsx)(RNVideoRenderView_1.RNVideoView, { style: styles.video, tileId: tileId }, tileId);
|
|
251
|
-
}) : (0, jsx_runtime_1.jsx)(
|
|
252
|
-
(0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, __assign({ style: styles.title }, { children: "Screen Share" }), void 0), (0, jsx_runtime_1.jsx)(react_native_1.View, __assign({ style: styles.videoContainer }, { children: (0, jsx_runtime_1.jsx)(RNVideoRenderView_1.RNVideoView, { style: styles.screenShare, tileId: shareScreenId }, shareScreenId) }), void 0)] }, void 0), (0, jsx_runtime_1.jsx)(react_native_1.Text, __assign({ style: styles.title }, { children: "Attendee" }), void 0)] }), void 0));
|
|
307
|
+
}) : (0, jsx_runtime_1.jsx)(mui_native_1.Typography, __assign({ style: styles.subtitle }, { children: "No one is sharing video at this moment" }), void 0) }), void 0), (0, jsx_runtime_1.jsxs)(layout_1.Flex, __assign({ justifyContent: "space-between", style: { height: '5%' } }, { children: [(0, jsx_runtime_1.jsx)(mui_native_1.Button, __assign({ onPress: toggleVideo }, { children: "Toggle Video" }), void 0), (0, jsx_runtime_1.jsx)(mui_native_1.Button, __assign({ onPress: function () { return bridge_1.NativeFunction.stopMeeting(); } }, { children: " Leave Meeting " }), void 0)] }), void 0)] }), void 0));
|
|
253
308
|
};
|
|
254
309
|
exports.VideoTileGrid = VideoTileGrid;
|
|
255
310
|
var styles = react_native_1.StyleSheet.create({
|
|
256
|
-
container: {
|
|
257
|
-
justifyContent: 'center',
|
|
258
|
-
alignItems: 'center',
|
|
259
|
-
height: '95%',
|
|
260
|
-
backgroundColor: 'white'
|
|
261
|
-
},
|
|
262
|
-
buttonContainer: {
|
|
263
|
-
flexDirection: 'row',
|
|
264
|
-
justifyContent: 'space-between',
|
|
265
|
-
},
|
|
266
311
|
title: {
|
|
267
312
|
fontSize: 30,
|
|
268
313
|
fontWeight: '700'
|
|
@@ -276,6 +321,7 @@ var styles = react_native_1.StyleSheet.create({
|
|
|
276
321
|
flexDirection: 'row',
|
|
277
322
|
justifyContent: 'space-around',
|
|
278
323
|
width: '100%',
|
|
324
|
+
height: '95%',
|
|
279
325
|
// This is an existing React Native issue:
|
|
280
326
|
// When you create a native android component
|
|
281
327
|
// that use GLSurfaceView (We use this internally), the entire screen will
|
|
@@ -283,8 +329,7 @@ var styles = react_native_1.StyleSheet.create({
|
|
|
283
329
|
overflow: 'hidden'
|
|
284
330
|
},
|
|
285
331
|
video: {
|
|
286
|
-
width: '
|
|
287
|
-
margin: '1%',
|
|
332
|
+
width: '100%',
|
|
288
333
|
aspectRatio: 16 / 9,
|
|
289
334
|
},
|
|
290
335
|
screenShare: {
|