Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yashrajbharti committed Jun 12, 2024
1 parent 50e7550 commit e10dbcc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions assets/video-rect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion js/photo-capture-and-save.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ const drawOnCanvasAndSavePhoto = async (isMirrored = false) => {

const isDualMode = document.querySelector(
".switch-camera-video-photo-mode input[type='radio'][name='modes']:checked").value === "dual-mode"
document.querySelector(".preview")?.classList?.remove("video")
if (!isDualMode)
document.querySelector(".preview").src = imageDataUrl;

if (isDualMode) {
dualPreview = !dualPreview;
if (dualPreview)
Expand Down
3 changes: 2 additions & 1 deletion js/video-capture-and-save.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ const saveRecordedVideo = () => {
link.href = videoUrl;
link.download = filename;
// link.click();
document.querySelector(".preview").src = videoUrl
document.querySelector(".preview").src = videoUrl;
document.querySelector(".preview").classList.add("video")
document.querySelector(".preview-dual").src = "./assets/rect-dual.svg"
chunks = [];
};
Expand Down
4 changes: 4 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ video.flip {
position: relative;
z-index: 1;
}

.lenses>.image>.preview.video {
content: url("./assets/video-rect.svg");
}
.lenses>.image>.preview-dual {
position: absolute;
object-fit: cover;
Expand Down

0 comments on commit e10dbcc

Please sign in to comment.