Skip to content

Commit

Permalink
Preparing video bug fix + language updates
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssaxuu committed Feb 6, 2024
1 parent 053cfae commit 4b81e1c
Show file tree
Hide file tree
Showing 24 changed files with 49 additions and 39 deletions.
2 changes: 1 addition & 1 deletion build/_locales/de/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Bildschirmaufnahme & Beschriftungswerkzeug",
"message": "Screenity - Bildschirmaufnahme & Beschriftung",
"description": "Erweiterungsname"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion build/_locales/fr/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Enregistreur d'écran et outil d'annotation",
"message": "Screenity - Capture & Annotation d'écran",
"description": "Nom de l'extension"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion build/_locales/hi/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "स्क्रीनिटी स्क्रीन रिकॉर्डिंग और व्याख्या का उपकरण",
"message": "स्क्रीनिटी - स्क्रीन रिकॉर्डिंग & नोट्स",
"description": "एक्सटेंशन का नाम"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion build/_locales/pl/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Rejestrator ekranu & Narzędzie do adnotacji",
"message": "Screenity - Nagrywarka & Edytor adnotacji",
"description": "Nazwa rozszerzenia"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion build/_locales/ru/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Инструмент для записи экрана и аннотаций",
"message": "Screenity - Запись экрана & Аннотации",
"description": "Название расширения"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion build/_locales/ta/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "ஸ்க்ரீனிட்டி - திரை ரெக்கார்டர் & சிறுகுறிப்பு கருவி",
"message": "ஸ்க்ரீனிட்டி - திரைப்பதிவு & குறிப்புகள்",
"description": "நீட்சிதம் பெயர்"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion build/_locales/tr/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Ekran Kaydedici & Not Ekleme Aracı",
"message": "Screenity - Ekran Kayıt & Not Aracı",
"description": "Uzantı adı"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion build/_locales/uk/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Запис екрану та інструмент для анотацій",
"message": "Screenity - Запис екрану & Анотації",
"description": "Extension name"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion build/background.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"description":"__MSG_extDesc__","version":"3.1.5","manifest_version":3,"name":"__MSG_extName__","default_locale":"en","background":{"service_worker":"background.bundle.js"},"action":{"default_icon":"assets/img/icon-34.png"},"icons":{"128":"assets/img/icon-128.png"},"host_permissions":["<all_urls>"],"content_scripts":[{"matches":["<all_urls>"],"js":["contentScript.bundle.js"],"css":["assets/fonts/fonts.css"]}],"web_accessible_resources":[{"resources":["content.styles.css","blank.mp4","playground.html","editor.html","assets/*","setup.html","worker.js","vendor/*","recorder.html","recorderoffscreen.html","sandbox.html","wrapper.html","camera.html","permissions.html","region.html","waveform.html","playground.html","editorfallback.html","download.html","*"],"matches":["<all_urls>"]}],"oauth2":{"client_id":"560517327251-m7n1k3kddknu7s9s4ejvrs1bj91gutd7.apps.googleusercontent.com","scopes":["https://www.googleapis.com/auth/drive.file"]},"cross_origin_embedder_policy":{"value":"require-corp"},"cross_origin_opener_policy":{"value":"same-origin"},"content_security_policy":{"sandbox":"sandbox allow-scripts allow-modals allow-popups; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; object-src 'self';worker-src 'self' blob: ;","extension_pages":"script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; media-src 'self' data: blob: *;"},"sandbox":{"pages":["editor.html"]},"commands":{"start-recording":{"suggested_key":{"default":"Alt+Shift+G"},"description":"Start recording"},"cancel-recording":{"suggested_key":{"default":"Alt+Shift+X"},"description":"Cancel recording"},"pause-recording":{"suggested_key":{"default":"Alt+Shift+M"},"description":"Pause/Resume recording"}},"permissions":["identity","activeTab","storage","unlimitedStorage","downloads","tabs","tabCapture","scripting"],"optional_permissions":["offscreen","desktopCapture","alarms"]}
{"description":"__MSG_extDesc__","version":"3.1.6","manifest_version":3,"name":"__MSG_extName__","default_locale":"en","background":{"service_worker":"background.bundle.js"},"action":{"default_icon":"assets/img/icon-34.png"},"icons":{"128":"assets/img/icon-128.png"},"host_permissions":["<all_urls>"],"content_scripts":[{"matches":["<all_urls>"],"js":["contentScript.bundle.js"],"css":["assets/fonts/fonts.css"]}],"web_accessible_resources":[{"resources":["content.styles.css","blank.mp4","playground.html","editor.html","assets/*","setup.html","worker.js","vendor/*","recorder.html","recorderoffscreen.html","sandbox.html","wrapper.html","camera.html","permissions.html","region.html","waveform.html","playground.html","editorfallback.html","download.html","*"],"matches":["<all_urls>"]}],"oauth2":{"client_id":"560517327251-m7n1k3kddknu7s9s4ejvrs1bj91gutd7.apps.googleusercontent.com","scopes":["https://www.googleapis.com/auth/drive.file"]},"cross_origin_embedder_policy":{"value":"require-corp"},"cross_origin_opener_policy":{"value":"same-origin"},"content_security_policy":{"sandbox":"sandbox allow-scripts allow-modals allow-popups; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; object-src 'self';worker-src 'self' blob: ;","extension_pages":"script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; media-src 'self' data: blob: *;"},"sandbox":{"pages":["editor.html"]},"commands":{"start-recording":{"suggested_key":{"default":"Alt+Shift+G"},"description":"Start recording"},"cancel-recording":{"suggested_key":{"default":"Alt+Shift+X"},"description":"Cancel recording"},"pause-recording":{"suggested_key":{"default":"Alt+Shift+M"},"description":"Pause/Resume recording"}},"permissions":["identity","activeTab","storage","unlimitedStorage","downloads","tabs","tabCapture","scripting"],"optional_permissions":["offscreen","desktopCapture","alarms"]}
4 changes: 2 additions & 2 deletions build/permissions.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/sandbox.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/_locales/de/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Bildschirmaufnahme & Beschriftungswerkzeug",
"message": "Screenity - Bildschirmaufnahme & Beschriftung",
"description": "Erweiterungsname"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion src/_locales/fr/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Enregistreur d'écran et outil d'annotation",
"message": "Screenity - Capture & Annotation d'écran",
"description": "Nom de l'extension"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion src/_locales/hi/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "स्क्रीनिटी स्क्रीन रिकॉर्डिंग और व्याख्या का उपकरण",
"message": "स्क्रीनिटी - स्क्रीन रिकॉर्डिंग & नोट्स",
"description": "एक्सटेंशन का नाम"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion src/_locales/pl/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Rejestrator ekranu & Narzędzie do adnotacji",
"message": "Screenity - Nagrywarka & Edytor adnotacji",
"description": "Nazwa rozszerzenia"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion src/_locales/ru/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Инструмент для записи экрана и аннотаций",
"message": "Screenity - Запись экрана & Аннотации",
"description": "Название расширения"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion src/_locales/ta/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "ஸ்க்ரீனிட்டி - திரை ரெக்கார்டர் & சிறுகுறிப்பு கருவி",
"message": "ஸ்க்ரீனிட்டி - திரைப்பதிவு & குறிப்புகள்",
"description": "நீட்சிதம் பெயர்"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion src/_locales/tr/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Ekran Kaydedici & Not Ekleme Aracı",
"message": "Screenity - Ekran Kayıt & Not Aracı",
"description": "Uzantı adı"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion src/_locales/uk/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extName": {
"message": "Screenity - Запис екрану та інструмент для анотацій",
"message": "Screenity - Запис екрану & Анотації",
"description": "Extension name"
},
"extDesc": {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "__MSG_extName__",
"description": "__MSG_extDesc__",
"default_locale": "en",
"version": "3.1.5",
"version": "3.1.6",
"background": {
"service_worker": "background.bundle.js"
},
Expand Down
6 changes: 5 additions & 1 deletion src/pages/Background/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,11 @@ const handleChunks = async (chunks, override = false) => {
const maxRetries = 5; // Maximum number of retry attempts per batch
const retryDelay = 1000; // Delay in milliseconds between retry attempts

sendMessageTab(sandboxTab, { type: "chunk-count", count: chunksCount });
sendMessageTab(sandboxTab, {
type: "chunk-count",
count: chunksCount,
override: override,
});

const sendNextBatch = async (retryCount = 0) => {
// Determine the range of chunks for the current batch
Expand Down
6 changes: 0 additions & 6 deletions src/pages/Permissions/Permissions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ const Recorder = () => {
}));
}

chrome.runtime.sendMessage({
oh: "hi",
stream: JSON.stringify(stream),
devicesInfo: JSON.stringify(devicesInfo),
});

// Save in Chrome local storage
chrome.storage.local.set({
// Set available devices
Expand Down
32 changes: 22 additions & 10 deletions src/pages/Sandbox/context/ContentState.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ const ContentState = (props) => {
for (const chunk of chunks) {
// Check if too many chunks have been received
if (contentStateRef.current.chunkIndex >= chunkCount.current) {
makeVideoTab(null, { override: true });
return;
}

Expand All @@ -375,6 +376,8 @@ const ContentState = (props) => {
}));
}
sendResponse({ status: "ok" });

return;
};

// Check Chrome version
Expand All @@ -392,29 +395,38 @@ const ContentState = (props) => {
}
}, []);

const makeVideoTab = (sendResponse = null, message) => {
if (makeVideoCheck.current) return;
makeVideoCheck.current = true;
setContentState((prevState) => ({
...prevState,
override: message.override,
}));
// All chunks received, reconstruct video
checkMemory();
reconstructVideo();
if (sendResponse !== null) {
sendResponse({ status: "ok" });
}
};

const onChromeMessage = useCallback(
(request, sender, sendResponse) => {
const message = request;
if (message.type === "chunk-count") {
setContentState((prevState) => ({
...prevState,
chunkCount: message.count,
override: message.override,
}));
} else if (message.type === "new-chunk-tab") {
handleBatch(message.chunks, sendResponse);

return true;
} else if (message.type === "make-video-tab") {
if (makeVideoCheck.current) return;
makeVideoCheck.current = true;
setContentState((prevState) => ({
...prevState,
override: message.override,
}));
// All chunks received, reconstruct video
checkMemory();
reconstructVideo();
sendResponse({ status: "ok" });
makeVideoTab(sendResponse, message);

return;
} else if (message.type === "saved-to-drive") {
setContentState((prevContentState) => ({
...prevContentState,
Expand Down

0 comments on commit 4b81e1c

Please sign in to comment.