Skip to content

Commit 14d5776

Browse files
committed
wip add watermark
1 parent 903f215 commit 14d5776

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

broadcaster/assets/css/app.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,34 @@ summary {
8383
color: #606060;
8484
padding: 10px 0px;
8585
}
86+
87+
.a-watermark {
88+
pointer-events: none;
89+
}
90+
91+
92+
93+
.w {
94+
position: relative;
95+
}
96+
97+
.w:before {
98+
content: " ";
99+
background-color: red;
100+
position: absolute;
101+
width: 100px;
102+
height: 100px;
103+
right: 10px;
104+
top: 10px;
105+
background: url("swm_logo.svg");
106+
max-width: 15%;
107+
background-repeat: no-repeat;
108+
max-height: 15%;
109+
opacity: 0.9;
110+
pointer-events: all;
111+
}
112+
113+
.w:hover:before {
114+
transform: scale(1.1);
115+
transition: all 0.2s linear;
116+
}

broadcaster/assets/js/home.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,31 @@ async function connectInput(id) {
7474
whepClient.onstream = (stream) => {
7575
console.log(`[${id}]: Creating new video element`);
7676

77+
78+
const w = document.createElement('div');
79+
w.className = 'w'
80+
7781
const videoPlayer = document.createElement('video');
7882
videoPlayer.srcObject = stream;
7983
videoPlayer.autoplay = true;
8084
videoPlayer.controls = true;
8185
videoPlayer.muted = true;
8286
videoPlayer.className = 'rounded-xl w-full h-full object-cover bg-black';
8387

84-
videoPlayerGrid.appendChild(videoPlayer);
88+
w.appendChild(videoPlayer);
89+
90+
// const a = document.createElement('a');
91+
// a.appendChild(w);
92+
// a.href = "https://swmansion.com"
93+
// a.className = 'a-watermark';
94+
95+
const watermark = document.createElement('div');
96+
watermark.style = 'position: absolute; width: 20px; height: 20px; background-color: red;'
97+
const p = document.createElement('div');
98+
p.style = 'position: relative; display: inline-block;';
99+
p.appendChild(videoPlayer);
100+
p.appendChild(watermark);
101+
videoPlayerGrid.appendChild(p);
85102
inputData.videoPlayer = videoPlayer;
86103
updateVideoGrid();
87104
statusMessage.classList.add('hidden');

broadcaster/assets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
"globals": "^15.8.0",
2121
"prettier": "^3.3.3"
2222
}
23-
}
23+
}

0 commit comments

Comments
 (0)