|
@@ -1,6 +1,4 @@
|
1
|
1
|
import logger from './logger';
|
2
|
|
-import { ElectronWindowType } from './types';
|
3
|
|
-
|
4
|
2
|
|
5
|
3
|
/**
|
6
|
4
|
* Begins a request to get available DesktopCapturerSources.
|
|
@@ -13,23 +11,6 @@ import { ElectronWindowType } from './types';
|
13
|
11
|
* @returns {Function}
|
14
|
12
|
*/
|
15
|
13
|
export function obtainDesktopSources(options: { thumbnailSize?: Object; types: string[]; }) {
|
16
|
|
- const { JitsiMeetElectron } = window as ElectronWindowType;
|
17
|
|
-
|
18
|
|
- // TODO: delete this after 2 releases
|
19
|
|
- if (JitsiMeetElectron?.obtainDesktopStreams) {
|
20
|
|
- return new Promise((resolve, reject) => {
|
21
|
|
- JitsiMeetElectron.obtainDesktopStreams(
|
22
|
|
- (sources: Array<{ id: string; }>) => resolve(_separateSourcesByType(sources)),
|
23
|
|
- (error: Error) => {
|
24
|
|
- logger.error(
|
25
|
|
- `Error while obtaining desktop sources: ${error}`);
|
26
|
|
- reject(error);
|
27
|
|
- },
|
28
|
|
- options
|
29
|
|
- );
|
30
|
|
- });
|
31
|
|
- }
|
32
|
|
-
|
33
|
14
|
return APP.API.requestDesktopSources(options).then(
|
34
|
15
|
({ sources, error }: { error: Error; sources: Array<{ id: string; }>; }) => {
|
35
|
16
|
if (sources) {
|
|
@@ -43,21 +24,6 @@ export function obtainDesktopSources(options: { thumbnailSize?: Object; types: s
|
43
|
24
|
});
|
44
|
25
|
}
|
45
|
26
|
|
46
|
|
-/**
|
47
|
|
- * Check usage of old jitsi meet electron version.
|
48
|
|
- *
|
49
|
|
- * @returns {boolean} True if we use old jitsi meet electron, otherwise false.
|
50
|
|
- */
|
51
|
|
-export function oldJitsiMeetElectronUsage() {
|
52
|
|
- const { JitsiMeetElectron } = window as ElectronWindowType;
|
53
|
|
-
|
54
|
|
- if (JitsiMeetElectron?.obtainDesktopStreams) {
|
55
|
|
- return true;
|
56
|
|
- }
|
57
|
|
-
|
58
|
|
- return false;
|
59
|
|
-}
|
60
|
|
-
|
61
|
27
|
/**
|
62
|
28
|
* Converts an array of DesktopCapturerSources to an object with types for keys
|
63
|
29
|
* and values being an array with sources of the key's type.
|