@whereby.com/browser-sdk 2.0.0-alpha25 → 2.0.0-alpha26

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.
@@ -570,10 +570,19 @@ export default class RoomConnection extends TypedEventTarget {
570
570
  reportedStreamResolutions.set(streamId, { width, height });
571
571
  }
572
572
  startScreenshare() {
573
- var _a;
573
+ var _a, _b;
574
574
  return __awaiter(this, void 0, void 0, function* () {
575
575
  const screenshareStream = this.localMedia.screenshareStream || (yield this.localMedia.startScreenshare());
576
- (_a = this.rtcManager) === null || _a === void 0 ? void 0 : _a.addNewStream(screenshareStream.id, screenshareStream, false, true);
576
+ const onEnded = () => {
577
+ this.stopScreenshare();
578
+ };
579
+ if ("oninactive" in screenshareStream) {
580
+ screenshareStream.addEventListener("inactive", onEnded);
581
+ }
582
+ else {
583
+ (_a = screenshareStream.getVideoTracks()[0]) === null || _a === void 0 ? void 0 : _a.addEventListener("ended", onEnded);
584
+ }
585
+ (_b = this.rtcManager) === null || _b === void 0 ? void 0 : _b.addNewStream(screenshareStream.id, screenshareStream, false, true);
577
586
  this.screenshares = [
578
587
  ...this.screenshares,
579
588
  {
@@ -2,6 +2,7 @@ import React from "react";
2
2
  interface VideoViewSelfProps {
3
3
  stream: MediaStream;
4
4
  muted?: boolean;
5
+ mirror?: boolean;
5
6
  style?: React.CSSProperties;
6
7
  onResize?: ({ width, height, stream }: {
7
8
  width: number;
@@ -10,5 +11,5 @@ interface VideoViewSelfProps {
10
11
  }) => void;
11
12
  }
12
13
  type VideoViewProps = VideoViewSelfProps & React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
13
- declare const _default: ({ muted, stream, onResize, ...rest }: VideoViewProps) => JSX.Element;
14
+ declare const _default: ({ muted, mirror, stream, onResize, ...rest }: VideoViewProps) => JSX.Element;
14
15
  export default _default;
@@ -2,7 +2,7 @@ import { __rest } from "tslib";
2
2
  import React, { useEffect, useRef } from "react";
3
3
  import debounce from "../utils/debounce";
4
4
  export default (_a) => {
5
- var { muted, stream, onResize } = _a, rest = __rest(_a, ["muted", "stream", "onResize"]);
5
+ var { muted, mirror = false, stream, onResize } = _a, rest = __rest(_a, ["muted", "mirror", "stream", "onResize"]);
6
6
  const videoEl = useRef(null);
7
7
  useEffect(() => {
8
8
  if (!videoEl.current || !onResize) {
@@ -33,5 +33,5 @@ export default (_a) => {
33
33
  videoEl.current.muted = Boolean(muted);
34
34
  }
35
35
  }, [muted, stream, videoEl]);
36
- return React.createElement("video", Object.assign({ ref: videoEl, autoPlay: true, playsInline: true }, rest));
36
+ return (React.createElement("video", Object.assign({ ref: videoEl, autoPlay: true, playsInline: true }, rest, { style: Object.assign({ transform: mirror ? "scaleX(-1)" : "none" }, rest.style) })));
37
37
  };
@@ -1943,7 +1943,7 @@ define("WherebyEmbed", {
1943
1943
  }
1944
1944
  Object.entries(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
1945
1945
  jsApi: true,
1946
- we: "2.0.0-alpha25",
1946
+ we: "2.0.0-alpha26",
1947
1947
  iframeSource: subdomain
1948
1948
  }, displayName && { displayName }), lang && { lang }), metadata && { metadata }), groups && { groups }), virtualBackgroundUrl && { virtualBackgroundUrl }), avatarUrl && { avatarUrl }), minimal != null && { embed: minimal }), boolAttrs.reduce(
1949
1949
  // add to URL if set in any way
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whereby.com/browser-sdk",
3
- "version": "2.0.0-alpha25",
3
+ "version": "2.0.0-alpha26",
4
4
  "description": "Modules for integration Whereby video in web apps",
5
5
  "author": "Whereby AS",
6
6
  "license": "MIT",
@@ -82,7 +82,7 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@swc/helpers": "^0.3.13",
85
- "@whereby/jslib-media": "whereby/jslib-media.git#0.2.2",
85
+ "@whereby/jslib-media": "whereby/jslib-media.git#1.3.1",
86
86
  "assert": "^2.0.0",
87
87
  "axios": "^1.2.3",
88
88
  "btoa": "^1.2.1",