react-native-webrtc: Add registerGlobals (#40636)

* Add registerGlobals type

* Add test & Fix version
This commit is contained in:
Arnaud Barré 2019-11-26 23:55:51 +01:00 committed by Andrew Casey
parent e7ba075c07
commit ec7e51feeb
2 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,4 @@
// Type definitions for react-native-webrtc 1.69
// Type definitions for react-native-webrtc 1.75
// Project: https://github.com/react-native-webrtc/react-native-webrtc
// Definitions by: Carlos Quiroga <https://github.com/KarlosQ>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@ -241,6 +241,8 @@ export class mediaDevices {
static getUserMedia(constraints: MediaStreamConstraints): MediaStream;
}
export function registerGlobals(): void;
export interface RTCViewProps {
streamURL: string;
mirror?: boolean;

View File

@ -7,7 +7,8 @@ const {
RTCIceCandidate,
RTCSessionDescription,
MediaStream,
RTCView
RTCView,
registerGlobals,
} = WebRTC;
mediaDevices.getUserMedia({
@ -59,6 +60,8 @@ MediaStreamInit.toURL();
peer.addStream(MediaStreamInit);
registerGlobals();
export const VideoCall = () => (
<RTCView objectFit={"cover"} zOrder={0} style={{}} streamURL={""} />
);