-
Notifications
You must be signed in to change notification settings - Fork 200
/
index.html
211 lines (209 loc) · 7.93 KB
/
index.html
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="../../../assets/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Use Vue -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
</head>
<body>
<div class="container">
<!-- left -->
<section class="left"></section>
<!-- right -->
<section class="right row" id="vue-wrapper">
<!-- video -->
<div class="video-group col-md-12 col-lg-6">
<!-- local stream -->
<section class="card">
<div class="card-header">local stream</div>
<div class="card-body">
<stream-player
:video-track="videoTrack"
:uid="options.uid"
:options="{mirror:localMirror}"
></stream-player>
</div>
</section>
<!-- remote stream -->
<section class="card">
<div class="card-header">remote stream</div>
<div class="card-body">
<div id="remote-playerlist">
<stream-player
v-for="(item,index) in remoteUsers"
:key="item.uid"
:video-track="item.videoTrack"
:audio-track="item.audioTrack"
:uid="item.uid"
></stream-player>
</div>
</div>
</section>
</div>
<!-- form -->
<div class="col-lg-6">
<form id="join-form" name="join-form">
<div>
<div class="mt-2">
<label class="form-label">Channel</label>
<input
class="form-control"
v-model="options.channel"
id="channel"
type="text"
placeholder="enter channel name"
required
/>
<div class="tips">
If you don`t know what is your channel, checkout
<a
href="https://docs.agora.io/en/Agora%20Platform/terms?platform=All%20Platforms#channel"
>this</a
>
</div>
</div>
<div class="mt-2">
<label class="form-label">User ID(optional)</label>
<input
class="form-control"
id="uid"
v-model="options.uid"
type="text"
onkeyup="this.value=this.value.replace(/[^0-9]/g,'')"
onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')"
placeholder="Enter the user ID"
/>
</div>
</div>
<div class="mt-2">
<!-- Step1 -->
<section class="step">
<label class="form-label"><span>Step1</span> Create AgoraRTC Client</label>
<button
type="button"
id="step-create"
:disabled="stepCreateDisabled"
@click="stepCreate"
class="btn btn-primary btn-sm"
>
Create Client
</button>
</section>
<!-- Step2 -->
<section class="step">
<label class="form-label"><span>Step2</span> Join Channel</label>
<button
type="button"
id="step-join"
:disabled="stepJoinDisabled"
@click="stepJoin"
class="btn btn-primary btn-sm"
>
Join Channel
</button>
</section>
<!-- Step3 -->
<section class="step">
<label class="form-label"><span>Step3</span> Create Track & Publish</label>
<div class="form-check">
<span class="form-check-label">Mirror Mode</span>
<input
class="form-check-input"
:disabled="mirrorCheckDisabled"
type="checkbox"
value=""
id="mirror-check"
v-model="localMirror"
:disabled="mirrorCheckDisabled"
/>
</div>
<button
type="button"
id="step-publish"
:disabled="stepPublishDisabled"
@click="stepPublish"
class="btn btn-primary btn-sm"
>
Create Track & Publish
</button>
<!-- audio -->
<label class="form-label mt-2">Microphone</label>
<mic-select :audio-track="audioTrack"></mic-select>
<!-- video -->
<label class="form-label mt-2">Camera</label>
<cam-select :video-track="videoTrack"></cam-select>
</section>
<!-- Step4 -->
<section class="step">
<label class="form-label"><span>Step4</span> Subscribe & Play</label>
<select v-model="remoteUid" class="form-select" id="remote-uid-select" style="max-width: 300px">
<option disabled value="">Please select remote userId</option>
<option v-for="user in remoteUsers" :key="user.uid" :value="user.uid" >
{{ user.uid }}
</option>
</select>
<div class="mt-2 mb-1">
<span class="form-check d-inline-block">
<input
class="form-check-input"
type="checkbox"
v-model="audioChecked"
id="audio-check"
/>
<label class="form-check-label" for="audio-check"> Audio </label>
</span>
<span class="form-check d-inline-block">
<input
class="form-check-input"
type="checkbox"
id="video-check"
v-model="videoChecked"
/>
<label class="form-check-label" for="video-check"> Video </label>
</span>
</div>
<button
type="button"
id="step-subscribe"
:disabled="stepSubscribeDisabled"
@click="stepSubscribe"
class="btn btn-primary btn-sm"
>
Subscribe & Play
</button>
</section>
<!-- Step5 -->
<section class="step">
<label class="form-label"><span>Step5</span> Leave Channel</label>
<button
type="button"
id="step-leave"
:disabled="stepLeaveDisabled"
@click="stepLeave"
class="btn btn-danger btn-sm"
>
Leave Channel
</button>
</section>
</div>
</form>
</div>
<!-- app info -->
<div id="app-info"></div>
</section>
</div>
<script src="../../../assets/jquery-3.4.1.min.js"></script>
<script src="../../../assets/bootstrap.bundle.min.js"></script>
<script src="../../../common/constant.js"></script>
<script src="../../../common/utils.js"></script>
<script src="../../../common/left-menu.js"></script>
<script src="../../../i18n/language.js"></script>
<script src="./assets/vue.min.js"></script>
<script src="https://download.agora.io/sdk/release/AgoraRTC_N.js"></script>
<script src="./index.js"></script>
</body>
</html>