@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.
@@ -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.8";
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 videoRef = useRef(null);
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 (videoRef.current) {
2575
+ if (finalVideoRef.current) {
2574
2576
  if (isOn && stream) {
2575
2577
  var mediaStream = new MediaStream();
2576
2578
  mediaStream.addTrack(stream.track);
2577
- videoRef.current.srcObject = mediaStream;
2578
- videoRef.current.setAttribute('playsinline', '');
2579
- videoRef.current.setAttribute('x5-playsinline', '');
2580
- videoRef.current.setAttribute('webkit-playsinline', '');
2581
- videoRef.current.play()["catch"](function (error) {
2582
- return console.error('videoRef.current.play() failed', error);
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
- videoRef.current.srcObject = null;
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: videoRef,
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)'