@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.js
CHANGED
|
@@ -458,7 +458,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
|
458
458
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MeetingProviderContex.Consumer, null, children));
|
|
459
459
|
};
|
|
460
460
|
|
|
461
|
-
var version = "0.4.
|
|
461
|
+
var version = "0.4.9";
|
|
462
462
|
|
|
463
463
|
var MeetingProvider = function MeetingProvider(_ref) {
|
|
464
464
|
var children = _ref.children,
|
|
@@ -2561,30 +2561,33 @@ var VideoSDKPlayer = React.forwardRef(function (_ref5, ref) {
|
|
|
2561
2561
|
_ref5$classNameVideo = _ref5.classNameVideo,
|
|
2562
2562
|
classNameVideo = _ref5$classNameVideo === void 0 ? '' : _ref5$classNameVideo,
|
|
2563
2563
|
_ref5$videoStyle = _ref5.videoStyle,
|
|
2564
|
-
videoStyle = _ref5$videoStyle === void 0 ? {} : _ref5$videoStyle
|
|
2564
|
+
videoStyle = _ref5$videoStyle === void 0 ? {} : _ref5$videoStyle,
|
|
2565
|
+
videoRef = _ref5.videoRef;
|
|
2565
2566
|
var _useParticipant2 = useParticipant(participantId),
|
|
2566
2567
|
webcamOn = _useParticipant2.webcamOn,
|
|
2567
2568
|
webcamStream = _useParticipant2.webcamStream,
|
|
2568
2569
|
isLocal = _useParticipant2.isLocal,
|
|
2569
2570
|
screenShareStream = _useParticipant2.screenShareStream,
|
|
2570
2571
|
screenShareOn = _useParticipant2.screenShareOn;
|
|
2571
|
-
var
|
|
2572
|
+
var internalRef = React.useRef(null);
|
|
2573
|
+
var finalVideoRef = videoRef || internalRef;
|
|
2572
2574
|
React.useEffect(function () {
|
|
2573
2575
|
var stream = type === 'share' ? screenShareStream : webcamStream;
|
|
2574
2576
|
var isOn = type === 'share' ? screenShareOn : webcamOn;
|
|
2575
|
-
if (
|
|
2577
|
+
if (finalVideoRef.current) {
|
|
2576
2578
|
if (isOn && stream) {
|
|
2577
2579
|
var mediaStream = new MediaStream();
|
|
2578
2580
|
mediaStream.addTrack(stream.track);
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2581
|
+
finalVideoRef.current.setAttribute('muted', '');
|
|
2582
|
+
finalVideoRef.current.srcObject = mediaStream;
|
|
2583
|
+
finalVideoRef.current.setAttribute('playsinline', '');
|
|
2584
|
+
finalVideoRef.current.setAttribute('x5-playsinline', '');
|
|
2585
|
+
finalVideoRef.current.setAttribute('webkit-playsinline', '');
|
|
2586
|
+
finalVideoRef.current.play()["catch"](function (error) {
|
|
2587
|
+
return console.error('finalVideoRef.current.play() failed', error);
|
|
2585
2588
|
});
|
|
2586
2589
|
} else {
|
|
2587
|
-
|
|
2590
|
+
finalVideoRef.current.srcObject = null;
|
|
2588
2591
|
}
|
|
2589
2592
|
}
|
|
2590
2593
|
}, [type].concat(type === 'share' ? [screenShareOn, screenShareStream] : type === 'video' ? [webcamOn, webcamStream] : []));
|
|
@@ -2598,9 +2601,10 @@ var VideoSDKPlayer = React.forwardRef(function (_ref5, ref) {
|
|
|
2598
2601
|
}, /*#__PURE__*/React__default.createElement("video", {
|
|
2599
2602
|
width: "100%",
|
|
2600
2603
|
height: "100%",
|
|
2601
|
-
ref:
|
|
2604
|
+
ref: finalVideoRef,
|
|
2602
2605
|
autoPlay: true,
|
|
2603
2606
|
className: classNameVideo,
|
|
2607
|
+
muted: true,
|
|
2604
2608
|
style: isLocal && type !== 'share' ? _extends({
|
|
2605
2609
|
transform: 'scaleX(-1)',
|
|
2606
2610
|
WebkitTransform: 'scaleX(-1)'
|