@stream-io/video-react-native-sdk 0.7.9 → 0.7.11

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.
Files changed (24) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +4 -4
  3. package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamPlayer.js +40 -0
  4. package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamPlayer.js.map +1 -0
  5. package/dist/commonjs/components/Livestream/LivestreamPlayer/index.js +17 -0
  6. package/dist/commonjs/components/Livestream/LivestreamPlayer/index.js.map +1 -0
  7. package/dist/commonjs/version.js +1 -1
  8. package/dist/commonjs/version.js.map +1 -1
  9. package/dist/module/components/Livestream/LivestreamPlayer/LivestreamPlayer.js +31 -0
  10. package/dist/module/components/Livestream/LivestreamPlayer/LivestreamPlayer.js.map +1 -0
  11. package/dist/module/components/Livestream/LivestreamPlayer/index.js +2 -0
  12. package/dist/module/components/Livestream/LivestreamPlayer/index.js.map +1 -0
  13. package/dist/module/version.js +1 -1
  14. package/dist/module/version.js.map +1 -1
  15. package/dist/typescript/components/Livestream/LivestreamPlayer/LivestreamPlayer.d.ts +19 -0
  16. package/dist/typescript/components/Livestream/LivestreamPlayer/LivestreamPlayer.d.ts.map +1 -0
  17. package/dist/typescript/components/Livestream/LivestreamPlayer/index.d.ts +2 -0
  18. package/dist/typescript/components/Livestream/LivestreamPlayer/index.d.ts.map +1 -0
  19. package/dist/typescript/version.d.ts +1 -1
  20. package/dist/typescript/version.d.ts.map +1 -1
  21. package/package.json +3 -3
  22. package/src/components/Livestream/LivestreamPlayer/LivestreamPlayer.tsx +59 -0
  23. package/src/components/Livestream/LivestreamPlayer/index.ts +1 -0
  24. package/src/version.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.7.11](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.7.10...@stream-io/video-react-native-sdk-0.7.11) (2024-05-27)
6
+
7
+
8
+ ### Features
9
+
10
+ * **react-native:** add livestream player component ([#1373](https://github.com/GetStream/stream-video-js/issues/1373)) ([a821e23](https://github.com/GetStream/stream-video-js/commit/a821e2359ad6c3ff1535f971c1d644a0b35fff78))
11
+
12
+ ### [0.7.10](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.7.9...@stream-io/video-react-native-sdk-0.7.10) (2024-05-23)
13
+
14
+ ### Dependency Updates
15
+
16
+ * `@stream-io/video-client` updated to version `1.0.8`
17
+ * `@stream-io/video-react-bindings` updated to version `0.4.34`
5
18
  ### [0.7.9](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.7.8...@stream-io/video-react-native-sdk-0.7.9) (2024-05-22)
6
19
 
7
20
 
@@ -26,7 +26,7 @@ class StreamVideoReactNativeModule(reactContext: ReactApplicationContext) : Reac
26
26
 
27
27
  override fun initialize() {
28
28
  super.initialize()
29
- StreamVideoReactNative.pipListeners.add {isInPictureInPictureMode ->
29
+ StreamVideoReactNative.pipListeners.add { isInPictureInPictureMode ->
30
30
  reactApplicationContext.getJSModule(
31
31
  RCTDeviceEventEmitter::class.java
32
32
  ).emit(PIP_CHANGE_EVENT, isInPictureInPictureMode)
@@ -71,9 +71,9 @@ class StreamVideoReactNativeModule(reactContext: ReactApplicationContext) : Reac
71
71
  }
72
72
  }
73
73
 
74
- override fun onCatalystInstanceDestroy() {
75
- StreamVideoReactNative.pipListeners.clear()
76
- super.onCatalystInstanceDestroy()
74
+ override fun invalidate() {
75
+ StreamVideoReactNative.pipListeners.clear();
76
+ super.invalidate()
77
77
  }
78
78
 
79
79
  @ReactMethod
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LivestreamPlayer = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _ = require("..");
9
+ var _2 = require("../../..");
10
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ const LivestreamPlayer = ({
13
+ callType,
14
+ callId,
15
+ ViewerLivestream = _.ViewerLivestream
16
+ }) => {
17
+ const client = (0, _2.useStreamVideoClient)();
18
+ const call = (0, _react.useMemo)(() => client === null || client === void 0 ? void 0 : client.call(callType, callId), [callType, callId, client]);
19
+ (0, _react.useEffect)(() => {
20
+ if (!call) {
21
+ return;
22
+ }
23
+ call.join().catch(e => {
24
+ console.error('Failed to join call', e);
25
+ });
26
+ return () => {
27
+ call.leave().catch(e => {
28
+ console.error('Failed to leave call', e);
29
+ });
30
+ };
31
+ }, [call]);
32
+ if (!call) {
33
+ return null;
34
+ }
35
+ return /*#__PURE__*/_react.default.createElement(_2.StreamCall, {
36
+ call: call
37
+ }, /*#__PURE__*/_react.default.createElement(ViewerLivestream, null));
38
+ };
39
+ exports.LivestreamPlayer = LivestreamPlayer;
40
+ //# sourceMappingURL=LivestreamPlayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_","_2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","LivestreamPlayer","callType","callId","ViewerLivestream","DefaultViewerLivestream","client","useStreamVideoClient","useMemo","useEffect","join","catch","e","console","error","leave","createElement","StreamCall","exports"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamPlayer/LivestreamPlayer.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,CAAA,GAAAD,OAAA;AAIA,IAAAE,EAAA,GAAAF,OAAA;AAA4D,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAkBrD,MAAMW,gBAAgB,GAAGA,CAAC;EAC/BC,QAAQ;EACRC,MAAM;EACNC,gBAAgB,GAAGC;AACE,CAAC,KAAK;EAC3B,MAAMC,MAAM,GAAG,IAAAC,uBAAoB,EAAC,CAAC;EAErC,MAAMT,IAAI,GAAG,IAAAU,cAAO,EAClB,MAAMF,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAER,IAAI,CAACI,QAAQ,EAAEC,MAAM,CAAC,EACpC,CAACD,QAAQ,EAAEC,MAAM,EAAEG,MAAM,CAC3B,CAAC;EAED,IAAAG,gBAAS,EAAC,MAAM;IACd,IAAI,CAACX,IAAI,EAAE;MACT;IACF;IACAA,IAAI,CAACY,IAAI,CAAC,CAAC,CAACC,KAAK,CAAEC,CAAC,IAAK;MACvBC,OAAO,CAACC,KAAK,CAAC,qBAAqB,EAAEF,CAAC,CAAC;IACzC,CAAC,CAAC;IACF,OAAO,MAAM;MACXd,IAAI,CAACiB,KAAK,CAAC,CAAC,CAACJ,KAAK,CAAEC,CAAC,IAAK;QACxBC,OAAO,CAACC,KAAK,CAAC,sBAAsB,EAAEF,CAAC,CAAC;MAC1C,CAAC,CAAC;IACJ,CAAC;EACH,CAAC,EAAE,CAACd,IAAI,CAAC,CAAC;EAEV,IAAI,CAACA,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,oBACExB,MAAA,CAAAY,OAAA,CAAA8B,aAAA,CAACtC,EAAA,CAAAuC,UAAU;IAACnB,IAAI,EAAEA;EAAK,gBACrBxB,MAAA,CAAAY,OAAA,CAAA8B,aAAA,CAACZ,gBAAgB,MAAE,CACT,CAAC;AAEjB,CAAC;AAACc,OAAA,CAAAjB,gBAAA,GAAAA,gBAAA"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _LivestreamPlayer = require("./LivestreamPlayer");
7
+ Object.keys(_LivestreamPlayer).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _LivestreamPlayer[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _LivestreamPlayer[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_LivestreamPlayer","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamPlayer/index.ts"],"mappings":";;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,iBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,iBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,iBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- const version = exports.version = '0.7.9';
7
+ const version = exports.version = '0.7.11';
8
8
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,OAAO"}
1
+ {"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,QAAQ"}
@@ -0,0 +1,31 @@
1
+ import React, { useMemo, useEffect } from 'react';
2
+ import { ViewerLivestream as DefaultViewerLivestream } from '..';
3
+ import { StreamCall, useStreamVideoClient } from '../../..';
4
+ export const LivestreamPlayer = ({
5
+ callType,
6
+ callId,
7
+ ViewerLivestream = DefaultViewerLivestream
8
+ }) => {
9
+ const client = useStreamVideoClient();
10
+ const call = useMemo(() => client === null || client === void 0 ? void 0 : client.call(callType, callId), [callType, callId, client]);
11
+ useEffect(() => {
12
+ if (!call) {
13
+ return;
14
+ }
15
+ call.join().catch(e => {
16
+ console.error('Failed to join call', e);
17
+ });
18
+ return () => {
19
+ call.leave().catch(e => {
20
+ console.error('Failed to leave call', e);
21
+ });
22
+ };
23
+ }, [call]);
24
+ if (!call) {
25
+ return null;
26
+ }
27
+ return /*#__PURE__*/React.createElement(StreamCall, {
28
+ call: call
29
+ }, /*#__PURE__*/React.createElement(ViewerLivestream, null));
30
+ };
31
+ //# sourceMappingURL=LivestreamPlayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useMemo","useEffect","ViewerLivestream","DefaultViewerLivestream","StreamCall","useStreamVideoClient","LivestreamPlayer","callType","callId","client","call","join","catch","e","console","error","leave","createElement"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamPlayer/LivestreamPlayer.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,SAAS,QAAQ,OAAO;AACjD,SACEC,gBAAgB,IAAIC,uBAAuB,QAEtC,IAAI;AACX,SAASC,UAAU,EAAEC,oBAAoB,QAAQ,UAAU;AAkB3D,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,QAAQ;EACRC,MAAM;EACNN,gBAAgB,GAAGC;AACE,CAAC,KAAK;EAC3B,MAAMM,MAAM,GAAGJ,oBAAoB,CAAC,CAAC;EAErC,MAAMK,IAAI,GAAGV,OAAO,CAClB,MAAMS,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEC,IAAI,CAACH,QAAQ,EAAEC,MAAM,CAAC,EACpC,CAACD,QAAQ,EAAEC,MAAM,EAAEC,MAAM,CAC3B,CAAC;EAEDR,SAAS,CAAC,MAAM;IACd,IAAI,CAACS,IAAI,EAAE;MACT;IACF;IACAA,IAAI,CAACC,IAAI,CAAC,CAAC,CAACC,KAAK,CAAEC,CAAC,IAAK;MACvBC,OAAO,CAACC,KAAK,CAAC,qBAAqB,EAAEF,CAAC,CAAC;IACzC,CAAC,CAAC;IACF,OAAO,MAAM;MACXH,IAAI,CAACM,KAAK,CAAC,CAAC,CAACJ,KAAK,CAAEC,CAAC,IAAK;QACxBC,OAAO,CAACC,KAAK,CAAC,sBAAsB,EAAEF,CAAC,CAAC;MAC1C,CAAC,CAAC;IACJ,CAAC;EACH,CAAC,EAAE,CAACH,IAAI,CAAC,CAAC;EAEV,IAAI,CAACA,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,oBACEX,KAAA,CAAAkB,aAAA,CAACb,UAAU;IAACM,IAAI,EAAEA;EAAK,gBACrBX,KAAA,CAAAkB,aAAA,CAACf,gBAAgB,MAAE,CACT,CAAC;AAEjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './LivestreamPlayer';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamPlayer/index.ts"],"mappings":"AAAA,cAAc,oBAAoB"}
@@ -1,2 +1,2 @@
1
- export const version = '0.7.9';
1
+ export const version = '0.7.11';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,OAAO"}
1
+ {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,QAAQ"}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { ViewerLivestreamProps } from '..';
3
+ export type LivestreamPlayerProps = {
4
+ /**
5
+ * The call type. Usually `livestream`.
6
+ */
7
+ callType: string;
8
+ /**
9
+ * The call ID.
10
+ */
11
+ callId: string;
12
+ /**
13
+ * Component to override the ViewerLivestream component used under the hood.
14
+ * **Default** [ViewerLivestream](https://github.com/GetStream/stream-video-js/blob/main/packages/react-native-sdk/src/components/Livestream/ViewerLivestream/ViewerLivestream.tsx)
15
+ */
16
+ ViewerLivestream?: React.ComponentType<ViewerLivestreamProps>;
17
+ };
18
+ export declare const LivestreamPlayer: ({ callType, callId, ViewerLivestream, }: LivestreamPlayerProps) => React.JSX.Element | null;
19
+ //# sourceMappingURL=LivestreamPlayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LivestreamPlayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/Livestream/LivestreamPlayer/LivestreamPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAEL,qBAAqB,EACtB,MAAM,IAAI,CAAC;AAGZ,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;CAC/D,CAAC;AAEF,eAAO,MAAM,gBAAgB,4CAI1B,qBAAqB,6BA+BvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './LivestreamPlayer';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Livestream/LivestreamPlayer/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "0.7.9";
1
+ export declare const version = "0.7.11";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "module": "dist/module/index.js",
@@ -45,8 +45,8 @@
45
45
  "!**/.*"
46
46
  ],
47
47
  "dependencies": {
48
- "@stream-io/video-client": "^1.0.7",
49
- "@stream-io/video-react-bindings": "^0.4.33",
48
+ "@stream-io/video-client": "^1.0.8",
49
+ "@stream-io/video-react-bindings": "^0.4.34",
50
50
  "intl-pluralrules": "2.0.1",
51
51
  "lodash.merge": "^4.6.2",
52
52
  "react-native-url-polyfill": "1.3.0",
@@ -0,0 +1,59 @@
1
+ import React, { useMemo, useEffect } from 'react';
2
+ import {
3
+ ViewerLivestream as DefaultViewerLivestream,
4
+ ViewerLivestreamProps,
5
+ } from '..';
6
+ import { StreamCall, useStreamVideoClient } from '../../..';
7
+
8
+ export type LivestreamPlayerProps = {
9
+ /**
10
+ * The call type. Usually `livestream`.
11
+ */
12
+ callType: string;
13
+ /**
14
+ * The call ID.
15
+ */
16
+ callId: string;
17
+ /**
18
+ * Component to override the ViewerLivestream component used under the hood.
19
+ * **Default** [ViewerLivestream](https://github.com/GetStream/stream-video-js/blob/main/packages/react-native-sdk/src/components/Livestream/ViewerLivestream/ViewerLivestream.tsx)
20
+ */
21
+ ViewerLivestream?: React.ComponentType<ViewerLivestreamProps>;
22
+ };
23
+
24
+ export const LivestreamPlayer = ({
25
+ callType,
26
+ callId,
27
+ ViewerLivestream = DefaultViewerLivestream,
28
+ }: LivestreamPlayerProps) => {
29
+ const client = useStreamVideoClient();
30
+
31
+ const call = useMemo(
32
+ () => client?.call(callType, callId),
33
+ [callType, callId, client],
34
+ );
35
+
36
+ useEffect(() => {
37
+ if (!call) {
38
+ return;
39
+ }
40
+ call.join().catch((e) => {
41
+ console.error('Failed to join call', e);
42
+ });
43
+ return () => {
44
+ call.leave().catch((e) => {
45
+ console.error('Failed to leave call', e);
46
+ });
47
+ };
48
+ }, [call]);
49
+
50
+ if (!call) {
51
+ return null;
52
+ }
53
+
54
+ return (
55
+ <StreamCall call={call}>
56
+ <ViewerLivestream />
57
+ </StreamCall>
58
+ );
59
+ };
@@ -0,0 +1 @@
1
+ export * from './LivestreamPlayer';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '0.7.9';
1
+ export const version = '0.7.11';