@class100/webrtc
Version:
TODO
30 lines • 1.5 kB
JavaScript
import React, { Component } from 'react';
import { RtcTypes } from '../common/Enums';
import AgoraWebView from './AgoraWebView';
import TRTCWebView from './TRTCWebView';
export default class RtcLocalView extends Component {
render() {
var _a, _b, _c, _d;
const { rtcType, localStream } = this.props;
if (rtcType === RtcTypes.AgoraWeb && localStream) {
console.log(123123123123);
return React.createElement(AgoraWebView
// @ts-ignore
, {
// @ts-ignore
videoTrack: (_a = localStream === null || localStream === void 0 ? void 0 : localStream.localStream) === null || _a === void 0 ? void 0 : _a.cameraTrack,
// @ts-ignore
audioTrack: (_b = localStream === null || localStream === void 0 ? void 0 : localStream.localStream) === null || _b === void 0 ? void 0 : _b.microphoneTrack, fit: (_c = this.props) === null || _c === void 0 ? void 0 : _c.fit });
}
if (rtcType === RtcTypes.TRTCWeb && localStream) {
console.log(123123123123);
return React.createElement(TRTCWebView
// @ts-ignore
, {
// @ts-ignore
localStream: localStream === null || localStream === void 0 ? void 0 : localStream.localStream, fit: (_d = this.props) === null || _d === void 0 ? void 0 : _d.fit });
}
return React.createElement("div", null);
}
}
//# sourceMappingURL=index.js.map