Skip to content

Commit

Permalink
wip add watermark
Browse files Browse the repository at this point in the history
  • Loading branch information
mickel8 committed Oct 20, 2024
1 parent 903f215 commit 14d5776
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
31 changes: 31 additions & 0 deletions broadcaster/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,34 @@ summary {
color: #606060;
padding: 10px 0px;
}

.a-watermark {
pointer-events: none;
}



.w {
position: relative;
}

.w:before {
content: " ";
background-color: red;
position: absolute;
width: 100px;
height: 100px;
right: 10px;
top: 10px;
background: url("swm_logo.svg");
max-width: 15%;
background-repeat: no-repeat;
max-height: 15%;
opacity: 0.9;
pointer-events: all;
}

.w:hover:before {
transform: scale(1.1);
transition: all 0.2s linear;
}
19 changes: 18 additions & 1 deletion broadcaster/assets/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,31 @@ async function connectInput(id) {
whepClient.onstream = (stream) => {
console.log(`[${id}]: Creating new video element`);


const w = document.createElement('div');
w.className = 'w'

const videoPlayer = document.createElement('video');
videoPlayer.srcObject = stream;
videoPlayer.autoplay = true;
videoPlayer.controls = true;
videoPlayer.muted = true;
videoPlayer.className = 'rounded-xl w-full h-full object-cover bg-black';

videoPlayerGrid.appendChild(videoPlayer);
w.appendChild(videoPlayer);

// const a = document.createElement('a');
// a.appendChild(w);
// a.href = "https://swmansion.com"
// a.className = 'a-watermark';

const watermark = document.createElement('div');
watermark.style = 'position: absolute; width: 20px; height: 20px; background-color: red;'
const p = document.createElement('div');
p.style = 'position: relative; display: inline-block;';
p.appendChild(videoPlayer);
p.appendChild(watermark);
videoPlayerGrid.appendChild(p);
inputData.videoPlayer = videoPlayer;
updateVideoGrid();
statusMessage.classList.add('hidden');
Expand Down
2 changes: 1 addition & 1 deletion broadcaster/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
"globals": "^15.8.0",
"prettier": "^3.3.3"
}
}
}

0 comments on commit 14d5776

Please sign in to comment.