Commit 38ac25ca by ramdayalmunda

background overlay when saving video

parent e4f159e3
...@@ -259,19 +259,17 @@ var getUserDetails = null ...@@ -259,19 +259,17 @@ var getUserDetails = null
return return
} }
if (loggedIn && request.action === 'stopRecording') { if (loggedIn && request.action === 'stopRecording') {
console.log('to stop recording')
recording = false; recording = false;
let generatingOid = tutorShotId
tutorShotId = null
sendResponse({ sendResponse({
userDetails, userDetails,
loggedIn, loggedIn,
recording, recording,
status: getStatus() status: "generatingVideo"
}); });
console.log('sending generatingVideo message, ')
sendMessageToActiveTab("generatingVideo") sendMessageToActiveTab("generatingVideo")
console.log('sent generatingVideo message, ') await api.post('/tutor-shot/finalize', { _id: generatingOid }, { headers: { userid: userDetails.uid } })
await api.post('/tutor-shot/finalize', { _id: tutorShotId }, { headers: { userid: userDetails.uid } })
tutorShotId = null
setData("recording", false) setData("recording", false)
setData("imageNumber", 0) setData("imageNumber", 0)
setData("tutorShotId", null) setData("tutorShotId", null)
......
...@@ -30,6 +30,7 @@ var webpageObserver = { disconnect() { } } ...@@ -30,6 +30,7 @@ var webpageObserver = { disconnect() { } }
} }
containerDiv = document.createElement('div') containerDiv = document.createElement('div')
containerDiv.setAttribute('test', 'tutor-shot')
containerDiv.style.position = "fixed" containerDiv.style.position = "fixed"
containerDiv.style.display = "block" containerDiv.style.display = "block"
containerDiv.style.background = "transparent" containerDiv.style.background = "transparent"
...@@ -237,7 +238,6 @@ async function getCaptureData() { ...@@ -237,7 +238,6 @@ async function getCaptureData() {
} }
function reRenderFloatingBar(data) { function reRenderFloatingBar(data) {
console.log('reRenderFloatingBar', data)
if (data) { if (data) {
if (data.status == 'stopped') { if (data.status == 'stopped') {
containerDiv.remove() containerDiv.remove()
...@@ -344,7 +344,6 @@ window.addEventListener('mousedown', async function (e) { ...@@ -344,7 +344,6 @@ window.addEventListener('mousedown', async function (e) {
}) })
// content.js // content.js
chrome.runtime.onMessage.addListener(async function (message, sender, sendResponse) { chrome.runtime.onMessage.addListener(async function (message, sender, sendResponse) {
console.log('getting message')
if (message.action == 'tabChanged') { if (message.action == 'tabChanged') {
// console.log('tabChanged', message) // console.log('tabChanged', message)
} }
...@@ -384,10 +383,10 @@ chrome.runtime.onMessage.addListener(async function (message, sender, sendRespon ...@@ -384,10 +383,10 @@ chrome.runtime.onMessage.addListener(async function (message, sender, sendRespon
} }
else if (message.message == 'generatingVideo') { else if (message.message == 'generatingVideo') {
console.log('generating Video')
finalizingOverlay = document.createElement('div') finalizingOverlay = document.createElement('div')
finalizingOverlay.setAttribute('class', 'tutor-shot-overlay') finalizingOverlay.setAttribute('class', 'tutor-shot-overlay')
sr.append(finalizingOverlay) finalizingOverlay.setAttribute('style', `all: unset; position: fixed; top: 0px; bottom: 0px; left: 0px; right: 0px; background-color: #000000a0; pointer-events: inherit; z-index: 101; display: flex; color: white; justify-content: center; align-items: center; font-size: 28px;`)
document.body.append(finalizingOverlay)
finalizingOverlay.innerHTML = ` finalizingOverlay.innerHTML = `
<div> <div>
Your video is being saved. Your video is being saved.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment