@100mslive/react-native-room-kit
Version:
100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.
33 lines • 1.29 kB
JavaScript
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
import * as React from 'react';
import { StyleSheet } from 'react-native';
import { useSelector } from 'react-redux';
import { HMSVideoViewMode } from '@100mslive/react-native-hms';
import { useHMSInstance } from '../hooks-util';
export const HMSVideoView = ({
trackId,
style,
...restProps
}) => {
const hmsInstance = useHMSInstance();
const HmsView = hmsInstance.HmsView;
const mirrorCamera = useSelector(state => state.app.joinConfig.mirrorCamera);
const autoSimulcast = useSelector(state => state.app.joinConfig.autoSimulcast);
return /*#__PURE__*/React.createElement(HmsView, _extends({}, restProps, {
trackId: trackId,
key: trackId,
mirror: restProps.mirror ?? mirrorCamera,
autoSimulcast: restProps.autoSimulcast ?? autoSimulcast,
scaleType: restProps.scaleType ?? HMSVideoViewMode.ASPECT_FILL,
style: {
...styles.hmsView,
...style
}
}));
};
const styles = StyleSheet.create({
hmsView: {
flex: 1
}
});
//# sourceMappingURL=HMSVideoView.js.map