-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathRemoteParticipantPresenter.js
72 lines (69 loc) · 1.83 KB
/
RemoteParticipantPresenter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import React from "react";
import { View, Text } from "react-native";
import {
useParticipant,
RTCView,
MediaStream,
} from "@videosdk.live/react-native-sdk";
import colors from "../../../styles/colors";
import { convertRFValue } from "../../../styles/spacing";
import { ROBOTO_FONTS } from "../../../styles/fonts";
import { ScreenShare } from "../../../assets/icons";
export default function RemoteParticipantPresenter({ presenterId }) {
const { displayName, screenShareStream, screenShareOn } =
useParticipant(presenterId);
const presentingText = displayName || "";
return (
<View
style={{
flex: 3,
paddingHorizontal: 12,
borderTopColor: colors.primary[700],
justifyContent: "space-between",
}}
>
{screenShareOn && screenShareStream ? (
<RTCView
streamURL={new MediaStream([screenShareStream.track]).toURL()}
objectFit={"contain"}
style={{
flex: 1,
}}
/>
) : null}
<View
style={{
flexDirection: "row",
marginBottom: 8,
justifyContent: "space-between",
position: "absolute",
bottom: 0,
right: 0,
left: 10,
}}
>
<View
style={{
flexDirection: "row",
padding: 6,
justifyContent: "center",
alignItems: "center",
borderRadius: 4,
}}
>
<ScreenShare width={20} height={20} fill={"#FFF"} />
<Text
style={{
color: "white",
fontFamily: ROBOTO_FONTS.RobotoRegular,
fontSize: convertRFValue(12),
marginLeft: 10,
}}
>
{`${presentingText} is Presenting`}
</Text>
</View>
</View>
</View>
);
}