mirror of https://github.com/jitsi/jitsi-meet
feat(screenshare) - add web security fix for electron (#13096)
use send the share screen sources using the external api --------- Co-authored-by: Gabriel Borlea <gabriel.borlea@8x8.com>pull/13958/head jitsi-meet_9031
parent
f78ebbb9a9
commit
8a2e4bc628
@ -0,0 +1,9 @@ |
||||
/** |
||||
* Action type to set the device sources. |
||||
*/ |
||||
export const SET_DESKTOP_SOURCES = 'SET_DESKTOP_SOURCES'; |
||||
|
||||
/** |
||||
* Action type to DELETE_DESKTOP_SOURCES. |
||||
*/ |
||||
export const DELETE_DESKTOP_SOURCES = 'DELETE_DESKTOP_SOURCES'; |
@ -0,0 +1,9 @@ |
||||
/** |
||||
* The size of the requested thumbnails. |
||||
* |
||||
* @type {Object} |
||||
*/ |
||||
export const THUMBNAIL_SIZE = { |
||||
height: 300, |
||||
width: 300 |
||||
}; |
@ -0,0 +1,34 @@ |
||||
import ReducerRegistry from '../base/redux/ReducerRegistry'; |
||||
|
||||
import { DELETE_DESKTOP_SOURCES, SET_DESKTOP_SOURCES } from './actionTypes'; |
||||
import { IDesktopSources } from './types'; |
||||
|
||||
/** |
||||
* The initial state of the web-hid feature. |
||||
*/ |
||||
const DEFAULT_STATE: IDesktopPicker = { |
||||
sources: {} as IDesktopSources |
||||
}; |
||||
|
||||
export interface IDesktopPicker { |
||||
sources: IDesktopSources; |
||||
} |
||||
|
||||
ReducerRegistry.register<IDesktopPicker>( |
||||
'features/desktop-picker', |
||||
(state: IDesktopPicker = DEFAULT_STATE, action): IDesktopPicker => { |
||||
switch (action.type) { |
||||
case SET_DESKTOP_SOURCES: |
||||
return { |
||||
...state, |
||||
sources: action.sources |
||||
}; |
||||
case DELETE_DESKTOP_SOURCES: |
||||
return { |
||||
...state, |
||||
...DEFAULT_STATE |
||||
}; |
||||
default: |
||||
return state; |
||||
} |
||||
}); |
@ -0,0 +1,14 @@ |
||||
export interface IDesktopSources { |
||||
sources: ISourcesByType; |
||||
} |
||||
|
||||
export interface ISourcesByType { |
||||
screen: []; |
||||
window: []; |
||||
} |
||||
|
||||
export type ElectronWindowType = { |
||||
JitsiMeetElectron?: { |
||||
obtainDesktopStreams: Function; |
||||
} ; |
||||
} & typeof window; |
Loading…
Reference in new issue