Replace green screen with blank screen, add CORS policy

This commit is contained in:
Daniel Petri Rocha 2024-07-23 10:28:23 +00:00
parent 2317d2f98f
commit 4ccc883437
5 changed files with 9 additions and 6 deletions

View File

@ -17,7 +17,6 @@ import MediaStreamUtils from '/imports/utils/media-stream-utils';
import { notify } from '/imports/ui/services/notification'; import { notify } from '/imports/ui/services/notification';
import { import {
EFFECT_TYPES, EFFECT_TYPES,
FALLBACK_IMAGE,
SHOW_THUMBNAILS, SHOW_THUMBNAILS,
setSessionVirtualBackgroundInfo, setSessionVirtualBackgroundInfo,
getSessionVirtualBackgroundInfo, getSessionVirtualBackgroundInfo,
@ -341,7 +340,7 @@ class VideoPreview extends Component {
const webcamBackgroundURL = webcamBackground?.webcamBackground; const webcamBackgroundURL = webcamBackground?.webcamBackground;
if (webcamBackgroundURL !== '') { if (webcamBackgroundURL !== '') {
this.handleVirtualBgSelected(EFFECT_TYPES.IMAGE_TYPE, FALLBACK_IMAGE, { url: webcamBackgroundURL }); this.handleVirtualBgSelected(EFFECT_TYPES.IMAGE_TYPE, '', { url: webcamBackgroundURL });
} }
}); });
} else { } else {

View File

@ -397,7 +397,13 @@ export async function createVirtualBackgroundService(parameters = null) {
// Function to convert image URL to a File object // Function to convert image URL to a File object
async function getFileFromUrl(url) { async function getFileFromUrl(url) {
try { try {
const response = await fetch(url); const response = await fetch(url, {
credentials: 'omit',
mode: 'cors',
headers: {
'Accept': 'image/*',
}
});
if (!response.ok) { if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`); throw new Error(`HTTP error! status: ${response.status}`);
} }

View File

@ -8,7 +8,6 @@ const EFFECT_TYPES = {
IMAGE_TYPE: 'image', IMAGE_TYPE: 'image',
NONE_TYPE: 'none', NONE_TYPE: 'none',
} }
const FALLBACK_IMAGE = 'green_screen.jpg';
// TODO I'm sure this is centralized somewhere; fetch it from "there" if possible // TODO I'm sure this is centralized somewhere; fetch it from "there" if possible
const BASE_PATH = Meteor.settings.public.app.cdn const BASE_PATH = Meteor.settings.public.app.cdn
@ -34,7 +33,7 @@ const MODELS = {
const { const {
thumbnailsPath: THUMBNAILS_PATH = '/resources/images/virtual-backgrounds/thumbnails/', thumbnailsPath: THUMBNAILS_PATH = '/resources/images/virtual-backgrounds/thumbnails/',
fileNames: IMAGE_NAMES = ['home.jpg', 'coffeeshop.jpg', 'board.jpg', 'green_screen.jpg'], fileNames: IMAGE_NAMES = ['home.jpg', 'coffeeshop.jpg', 'board.jpg'],
storedOnBBB: IS_STORED_ON_BBB = true, storedOnBBB: IS_STORED_ON_BBB = true,
imagesPath: IMAGES_PATH = '/resources/images/virtual-backgrounds/', imagesPath: IMAGES_PATH = '/resources/images/virtual-backgrounds/',
showThumbnails: SHOW_THUMBNAILS = true, showThumbnails: SHOW_THUMBNAILS = true,
@ -102,7 +101,6 @@ export {
IMAGES_PATH, IMAGES_PATH,
BLUR_FILENAME, BLUR_FILENAME,
EFFECT_TYPES, EFFECT_TYPES,
FALLBACK_IMAGE,
setSessionVirtualBackgroundInfo, setSessionVirtualBackgroundInfo,
getSessionVirtualBackgroundInfo, getSessionVirtualBackgroundInfo,
getSessionVirtualBackgroundInfoWithDefault, getSessionVirtualBackgroundInfoWithDefault,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 693 B