Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/editors/media-viewer/register.ts
6011 views
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
/*
7
Handle viewing images and videos
8
*/
9
10
import { MediaViewer } from "./viewer";
11
import { register_file_editor } from "../../project-file";
12
import { IMAGE_EXTS, VIDEO_EXTS, AUDIO_EXTS } from "../../file-associations";
13
14
for (const is_public of [true, false]) {
15
register_file_editor({
16
ext: IMAGE_EXTS,
17
icon: "file-image",
18
component: MediaViewer,
19
is_public,
20
});
21
22
register_file_editor({
23
ext: VIDEO_EXTS,
24
icon: "video-camera",
25
component: MediaViewer,
26
is_public,
27
});
28
29
register_file_editor({
30
ext: AUDIO_EXTS,
31
icon: "audio",
32
component: MediaViewer,
33
is_public,
34
});
35
}
36
37