Skip to content

Commit

Permalink
[mirotalkbro] - #10 adding waiting broadcaster...
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Jan 20, 2025
1 parent d82983c commit 31e9d12
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license For open source under AGPL-3.0
* @license For private project or commercial purposes contact us at: [email protected]
* @author Miroslav Pejic - [email protected]
* @version 1.1.14
* @version 1.1.15
*/

require('dotenv').config();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirotalkbro",
"version": "1.1.14",
"version": "1.1.15",
"description": "P2P WebRTC audio, video and screen live broadcast",
"main": "app/server.js",
"scripts": {
Expand Down
14 changes: 14 additions & 0 deletions public/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,20 @@ td button:hover {
align-items: center;
}

.overlay {
z-index: 1;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 12px;
padding: 10px 20px;
border-radius: 8px;
pointer-events: none;
text-align: center;
}

.fadeIn {
-webkit-animation: fadeIn ease-in 1;
-moz-animation: fadeIn ease-in 1;
Expand Down
6 changes: 6 additions & 0 deletions public/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ function makeDraggable(element, dragObj) {
}
}

function hideElement(element) {
if (!element.classList.contains('hidden')) {
element.classList.add('hidden');
}
}

async function playSound(name) {
const sound = '../assets/sounds/' + name + '.mp3';
const audioToPlay = new Audio(sound);
Expand Down
2 changes: 2 additions & 0 deletions public/js/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ console.log('Viewer', {

const body = document.querySelector('body');

const waitingBroadcaster = document.getElementById('waitingBroadcaster');
const viewerForm = document.getElementById('viewerForm');
const viewerFormHeader = document.getElementById('viewerFormHeader');
const viewerButtons = document.getElementById('viewerButtons');
Expand Down Expand Up @@ -113,6 +114,7 @@ socket.on('offer', async (id, description, iceServers) => {
peerConnection.ontrack = (event) => {
saveRecording();
attachStream(event.streams[0]);
hideElement(waitingBroadcaster);
};

peerConnection.onicecandidate = (event) => {
Expand Down
1 change: 1 addition & 0 deletions public/views/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<div class="video-off">
<img id="videoOff" class="video-off" src="../assets/images/videoOff.png" />
</div>
<div id="waitingBroadcaster" class="overlay pulse">Waiting broadcaster...</div>
</div>
<label id="recordingLabel" class="pulse">🔴 REC: <span id="recordingTime">0S</span></label>
<div id="viewerButtons" class="viewer-buttons">
Expand Down

0 comments on commit 31e9d12

Please sign in to comment.