diff --git a/client/angular.json b/client/angular.json index 988f07369b..fffd083955 100644 --- a/client/angular.json +++ b/client/angular.json @@ -39,6 +39,11 @@ "glob": "**/*", "input": "node_modules/cm-chessboard/assets/", "output": "/chess/" + }, + { + "glob": "**/*", + "input": "node_modules/pdfjs-dist/legacy/build/", + "output": "/pdfjs/" } ], "styles": ["src/styles.scss"], diff --git a/client/ngsw-config.json b/client/ngsw-config.json index 1405481722..35506cb1c7 100644 --- a/client/ngsw-config.json +++ b/client/ngsw-config.json @@ -1,7 +1,6 @@ { "$schema": "./node_modules/@angular/service-worker/config/schema.json", "index": "/index.html", - "version": 2, "assetGroups": [ { "name": "app", diff --git a/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/mediafile-slide/components/mediafile-slide.component.ts b/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/mediafile-slide/components/mediafile-slide.component.ts index a9aa31936d..7c5330855a 100644 --- a/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/mediafile-slide/components/mediafile-slide.component.ts +++ b/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/mediafile-slide/components/mediafile-slide.component.ts @@ -2,7 +2,6 @@ import { Component } from '@angular/core'; import { IMAGE_MIMETYPES, PDF_MIMETYPES } from 'src/app/site/pages/meetings/pages/mediafiles'; import { BaseSlideComponent } from '../../../base/base-slide-component'; -import { SlideMediafileService } from '../../../services/slide-mediafile.service'; import { MediafileSlideData } from '../mediafile-slide-data'; @Component({ @@ -12,13 +11,7 @@ import { MediafileSlideData } from '../mediafile-slide-data'; }) export class MediafileSlideComponent extends BaseSlideComponent { public get url(): string { - if (this.projector && this.projector.id) { - const url = this.slideMediafileService.getMediafileSync(this.projector.id, this.data.data.id); - - return url?.data || ``; - } - - return ``; + return `/system/media/get/${this.data.data.id}`; } public get scroll(): number { @@ -45,11 +38,8 @@ export class MediafileSlideComponent extends BaseSlideComponent { - this.cache[projectorId] = { data: null, id }; // Prevent duplicate request of file - - try { - const file = await this.http.get(`/system/media/get/${id}`, {}, { responseType: `blob` }); - // TODO: When mediafile service supports single page retrieval - // we might want to cache multiple pages of a file to prevent - // rerequesting pages when navigating back. - // For now the objects will just be deleted when a new one is - // available. - this.cache[projectorId] = { data: URL.createObjectURL(file), id }; - } catch (e) { - console.error(e); - delete this.cache[projectorId]; - } - - return null; - } - - public getMediafileSync(projectorId: Id, id: Id): MediafileCacheEntry | null { - if (!this.cache[projectorId] || this.cache[projectorId].id !== id) { - this.getMediafile(projectorId, id); - return null; - } - - return this.cache[projectorId]; - } -} diff --git a/nginx/nginx.conf b/nginx/nginx.conf index dd88a84141..ac058f04ad 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -16,6 +16,10 @@ http { index index.html index.htm; include /etc/nginx/mime.types; + types { + application/javascript js mjs; + } + client_max_body_size 100M; gzip on;