@videosdk.live/react-sdk 0.4.8 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +16 -12
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +16 -12
- package/dist/index.modern.js.map +1 -1
- package/dist/types/index.d.ts +5 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -456,7 +456,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
|
456
456
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MeetingProviderContex.Consumer, null, children));
|
|
457
457
|
};
|
|
458
458
|
|
|
459
|
-
var version = "0.4.
|
|
459
|
+
var version = "0.4.9";
|
|
460
460
|
|
|
461
461
|
var MeetingProvider = function MeetingProvider(_ref) {
|
|
462
462
|
var children = _ref.children,
|
|
@@ -2559,30 +2559,33 @@ var VideoSDKPlayer = forwardRef(function (_ref5, ref) {
|
|
|
2559
2559
|
_ref5$classNameVideo = _ref5.classNameVideo,
|
|
2560
2560
|
classNameVideo = _ref5$classNameVideo === void 0 ? '' : _ref5$classNameVideo,
|
|
2561
2561
|
_ref5$videoStyle = _ref5.videoStyle,
|
|
2562
|
-
videoStyle = _ref5$videoStyle === void 0 ? {} : _ref5$videoStyle
|
|
2562
|
+
videoStyle = _ref5$videoStyle === void 0 ? {} : _ref5$videoStyle,
|
|
2563
|
+
videoRef = _ref5.videoRef;
|
|
2563
2564
|
var _useParticipant2 = useParticipant(participantId),
|
|
2564
2565
|
webcamOn = _useParticipant2.webcamOn,
|
|
2565
2566
|
webcamStream = _useParticipant2.webcamStream,
|
|
2566
2567
|
isLocal = _useParticipant2.isLocal,
|
|
2567
2568
|
screenShareStream = _useParticipant2.screenShareStream,
|
|
2568
2569
|
screenShareOn = _useParticipant2.screenShareOn;
|
|
2569
|
-
var
|
|
2570
|
+
var internalRef = useRef(null);
|
|
2571
|
+
var finalVideoRef = videoRef || internalRef;
|
|
2570
2572
|
useEffect(function () {
|
|
2571
2573
|
var stream = type === 'share' ? screenShareStream : webcamStream;
|
|
2572
2574
|
var isOn = type === 'share' ? screenShareOn : webcamOn;
|
|
2573
|
-
if (
|
|
2575
|
+
if (finalVideoRef.current) {
|
|
2574
2576
|
if (isOn && stream) {
|
|
2575
2577
|
var mediaStream = new MediaStream();
|
|
2576
2578
|
mediaStream.addTrack(stream.track);
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2579
|
+
finalVideoRef.current.setAttribute('muted', '');
|
|
2580
|
+
finalVideoRef.current.srcObject = mediaStream;
|
|
2581
|
+
finalVideoRef.current.setAttribute('playsinline', '');
|
|
2582
|
+
finalVideoRef.current.setAttribute('x5-playsinline', '');
|
|
2583
|
+
finalVideoRef.current.setAttribute('webkit-playsinline', '');
|
|
2584
|
+
finalVideoRef.current.play()["catch"](function (error) {
|
|
2585
|
+
return console.error('finalVideoRef.current.play() failed', error);
|
|
2583
2586
|
});
|
|
2584
2587
|
} else {
|
|
2585
|
-
|
|
2588
|
+
finalVideoRef.current.srcObject = null;
|
|
2586
2589
|
}
|
|
2587
2590
|
}
|
|
2588
2591
|
}, [type].concat(type === 'share' ? [screenShareOn, screenShareStream] : type === 'video' ? [webcamOn, webcamStream] : []));
|
|
@@ -2596,9 +2599,10 @@ var VideoSDKPlayer = forwardRef(function (_ref5, ref) {
|
|
|
2596
2599
|
}, /*#__PURE__*/React.createElement("video", {
|
|
2597
2600
|
width: "100%",
|
|
2598
2601
|
height: "100%",
|
|
2599
|
-
ref:
|
|
2602
|
+
ref: finalVideoRef,
|
|
2600
2603
|
autoPlay: true,
|
|
2601
2604
|
className: classNameVideo,
|
|
2605
|
+
muted: true,
|
|
2602
2606
|
style: isLocal && type !== 'share' ? _extends({
|
|
2603
2607
|
transform: 'scaleX(-1)',
|
|
2604
2608
|
WebkitTransform: 'scaleX(-1)'
|