Skip to content

Commit ee9f8eb

Browse files
Add new workflow
1 parent f8d3f3e commit ee9f8eb

File tree

5 files changed

+139
-36
lines changed

5 files changed

+139
-36
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Video Call Screen</title>
7+
<link rel="stylesheet" href="css/call.css">
8+
</head>
9+
<body>
10+
<div class="video-call-container">
11+
<!-- Video Elements -->
12+
<div class="video-wrapper">
13+
<video id="uiLocalVideo" autoplay muted></video>
14+
<video id="remoteVideo" autoplay></video>
15+
</div>
16+
17+
<!-- Controls -->
18+
<div class="controls">
19+
<button id="mute" class="control-btn">🎤</button>
20+
<button id="camera" class="control-btn">📷</button>
21+
<button id="endCall" class="control-btn end-call">🔴</button>
22+
</div>
23+
</div>
24+
<script src="js/call.js"></script>
25+
</body>
26+
</html>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
body {
2+
margin: 0;
3+
font-family: Arial, sans-serif;
4+
background-color: #000;
5+
color: white;
6+
display: flex;
7+
justify-content: center;
8+
align-items: center;
9+
height: 100vh;
10+
}
11+
12+
.video-call-container {
13+
display: flex;
14+
flex-direction: column;
15+
justify-content: space-between;
16+
width: 100%;
17+
height: 100%;
18+
}
19+
20+
.video-wrapper {
21+
position: relative;
22+
flex-grow: 1;
23+
display: flex;
24+
justify-content: center;
25+
align-items: center;
26+
overflow: hidden;
27+
}
28+
29+
video {
30+
max-width: 100%;
31+
max-height: 100%;
32+
border-radius: 10px;
33+
background-color: black;
34+
}
35+
36+
#uiLocalVideo {
37+
position: absolute;
38+
width: 30%;
39+
height: auto;
40+
top: 10px;
41+
right: 10px;
42+
border: 2px solid white;
43+
border-radius: 8px;
44+
}
45+
46+
.controls {
47+
display: flex;
48+
justify-content: center;
49+
gap: 15px;
50+
padding: 15px;
51+
background: rgba(0, 0, 0, 0.6);
52+
}
53+
54+
.control-btn {
55+
background-color: #333;
56+
border: none;
57+
color: white;
58+
padding: 10px 20px;
59+
border-radius: 5px;
60+
font-size: 20px;
61+
cursor: pointer;
62+
}
63+
64+
.control-btn:hover {
65+
background-color: #555;
66+
}
67+
68+
.end-call {
69+
background-color: red;
70+
color: white;
71+
}
72+
73+
.end-call:hover {
74+
background-color: darkred;
75+
}

src/main/resources/static/index.html

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,26 @@
1616
<script src="/webjars/webrtc-adapter/release/adapter.js"></script>
1717

1818
<!-- Kurento -->
19-
<link rel="stylesheet" href="/css/kurento.css">
19+
<!-- <link rel="stylesheet" href="/css/kurento.css">-->
20+
<link rel="stylesheet" href="/css/call.css">
2021
<script src="/js/kurento-utils.min.js"></script> <!-- JAR from Maven -->
2122
<script src="/js/app.js"></script>
23+
<script src="/js/call.js"></script>
2224

2325
</head>
2426

2527
<body>
26-
<header>
27-
<!-- <div class="navbar navbar-inverse navbar-fixed-top">-->
28-
<!-- <div class="container">-->
29-
<!-- <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">-->
30-
<!-- <ul class="nav navbar-nav navbar-right">-->
31-
<!-- <li>-->
32-
<!-- <a href="https://github.com/Kurento/kurento/tree/main/tutorials/java/hello-world">-->
33-
<!-- <span class="glyphicon glyphicon-file"></span>Source Code</a>-->
34-
<!-- </li>-->
35-
<!-- </ul>-->
36-
<!-- </div>-->
37-
<!-- </div>-->
38-
<!-- </div>-->
39-
</header>
4028

41-
<div class="container">
42-
<div class="row">
43-
44-
<div class="col-md-2">
45-
<a id="uiStartBtn" href="#" class="btn btn-success">
46-
<span class="glyphicon glyphicon-play"></span>Start</a>
47-
<br>
48-
<br>
49-
<a id="uiStopBtn" href="#" class="btn btn-danger">
50-
<span class="glyphicon glyphicon-stop"></span>Stop</a>
51-
</div>
52-
<div class="col-md-5">
53-
<div class='video-container'>
54-
<video id="uiLocalVideo" class='userVideo' playsinline muted></video>
55-
<video id="uiRemoteVideo" class='peerVideo' playsinline muted></video>
56-
</div>
57-
</div>
29+
<div class="video-call-container">
30+
<div class="video-wrapper">
31+
<video id="uiLocalVideo" autoplay muted></video>
32+
<video id="uiRemoteVideo" autoplay></video>
33+
</div>
5834

35+
<div class="controls">
36+
<button id="mute" class="control-btn">🎤</button>
37+
<button id="camera" class="control-btn">📷</button>
38+
<button id="endCall" class="control-btn end-call">🔴</button>
5939
</div>
6040
</div>
6141

src/main/resources/static/js/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ function uiStart()
188188
};
189189

190190
options.configuration = {
191-
iceServers : JSON.parse('[{"urls":"stun:stun.l.google.com:19302"}]')
192-
// iceServers: JSON.parse('[{"urls":"stun:stun.l.google.com:19302"}, {"urls":"turns:standard.relay.metered.ca:80", ' +
193-
// '"username":"65024e9d0265012cc6669435", ' +
194-
// '"credential":"k3nUiqAyH5SM/5qt"}]')
191+
// iceServers : JSON.parse('[{"urls":"stun:stun.l.google.com:19302"}]')
192+
iceServers: JSON.parse('[{"urls":"stun:stun.l.google.com:19302"}, {"urls":"turns:standard.relay.metered.ca:80", ' +
193+
'"username":"65024e9d0265012cc6669435", ' +
194+
'"credential":"k3nUiqAyH5SM/5qt"}]')
195195
};
196196
webRtcPeer = new kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options,
197197
function(err)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Basic logic for controls
2+
const muteButton = document.getElementById("mute");
3+
const cameraButton = document.getElementById("camera");
4+
const endCallButton = document.getElementById("endCall");
5+
6+
let isMuted = false;
7+
let isCameraOn = true;
8+
9+
muteButton.addEventListener("click", () => {
10+
isMuted = !isMuted;
11+
muteButton.textContent = isMuted ? "🔇" : "🎤";
12+
});
13+
14+
cameraButton.addEventListener("click", () => {
15+
isCameraOn = !isCameraOn;
16+
cameraButton.textContent = isCameraOn ? "📷" : "📴";
17+
});
18+
19+
endCallButton.addEventListener("click", () => {
20+
alert("Call ended");
21+
// Add logic to terminate the call
22+
});

0 commit comments

Comments
 (0)