fix(pip) make PiP disabled by default
This reverts commit c84c3c61e2c24014b43023316627f7747bbca7a6.
This commit is contained in:
parent
d1c9720033
commit
b428ce2dcd
|
@ -43,7 +43,7 @@ class PictureInPictureModule extends ReactContextBaseJavaModule {
|
||||||
private static final String TAG = NAME;
|
private static final String TAG = NAME;
|
||||||
|
|
||||||
private static boolean isSupported;
|
private static boolean isSupported;
|
||||||
private boolean isDisabled;
|
private boolean isEnabled;
|
||||||
|
|
||||||
public PictureInPictureModule(ReactApplicationContext reactContext) {
|
public PictureInPictureModule(ReactApplicationContext reactContext) {
|
||||||
super(reactContext);
|
super(reactContext);
|
||||||
|
@ -84,7 +84,7 @@ class PictureInPictureModule extends ReactContextBaseJavaModule {
|
||||||
*/
|
*/
|
||||||
@TargetApi(Build.VERSION_CODES.O)
|
@TargetApi(Build.VERSION_CODES.O)
|
||||||
public void enterPictureInPicture() {
|
public void enterPictureInPicture() {
|
||||||
if (isDisabled) {
|
if (!isEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,8 +132,8 @@ class PictureInPictureModule extends ReactContextBaseJavaModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void setPictureInPictureDisabled(Boolean disabled) {
|
public void setPictureInPictureEnabled(Boolean enabled) {
|
||||||
this.isDisabled = disabled;
|
this.isEnabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPictureInPictureSupported() {
|
public boolean isPictureInPictureSupported() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import { setPictureInPictureDisabled } from '../../mobile/picture-in-picture/functions';
|
import { setPictureInPictureEnabled } from '../../mobile/picture-in-picture/functions';
|
||||||
import { setAudioOnly } from '../audio-only';
|
import { setAudioOnly } from '../audio-only';
|
||||||
import JitsiMeetJS from '../lib-jitsi-meet';
|
import JitsiMeetJS from '../lib-jitsi-meet';
|
||||||
import { MiddlewareRegistry } from '../redux';
|
import { MiddlewareRegistry } from '../redux';
|
||||||
|
@ -41,7 +41,7 @@ function _toggleScreenSharing(enabled, store) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dispatch(destroyLocalDesktopTrackIfExists());
|
dispatch(destroyLocalDesktopTrackIfExists());
|
||||||
setPictureInPictureDisabled(false);
|
setPictureInPictureEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ function _toggleScreenSharing(enabled, store) {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function _startScreenSharing(dispatch, state) {
|
function _startScreenSharing(dispatch, state) {
|
||||||
setPictureInPictureDisabled(true);
|
setPictureInPictureEnabled(false);
|
||||||
|
|
||||||
JitsiMeetJS.createLocalTracks({ devices: [ 'desktop' ] })
|
JitsiMeetJS.createLocalTracks({ devices: [ 'desktop' ] })
|
||||||
.then(tracks => {
|
.then(tracks => {
|
||||||
|
@ -73,6 +73,6 @@ function _startScreenSharing(dispatch, state) {
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log('ERROR creating ScreeSharing stream ', error);
|
console.log('ERROR creating ScreeSharing stream ', error);
|
||||||
|
|
||||||
setPictureInPictureDisabled(false);
|
setPictureInPictureEnabled(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ import { getIsLobbyVisible } from '../../../lobby/functions';
|
||||||
import { navigate }
|
import { navigate }
|
||||||
from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
|
from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
|
||||||
import { screen } from '../../../mobile/navigation/routes';
|
import { screen } from '../../../mobile/navigation/routes';
|
||||||
|
import { setPictureInPictureEnabled } from '../../../mobile/picture-in-picture';
|
||||||
import { Captions } from '../../../subtitles';
|
import { Captions } from '../../../subtitles';
|
||||||
import { setToolboxVisible } from '../../../toolbox/actions';
|
import { setToolboxVisible } from '../../../toolbox/actions';
|
||||||
import { Toolbox } from '../../../toolbox/components/native';
|
import { Toolbox } from '../../../toolbox/components/native';
|
||||||
|
@ -179,6 +180,7 @@ class Conference extends AbstractConference<Props, State> {
|
||||||
*/
|
*/
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
BackHandler.addEventListener('hardwareBackPress', this._onHardwareBackPress);
|
BackHandler.addEventListener('hardwareBackPress', this._onHardwareBackPress);
|
||||||
|
setPictureInPictureEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -211,6 +213,7 @@ class Conference extends AbstractConference<Props, State> {
|
||||||
BackHandler.removeEventListener('hardwareBackPress', this._onHardwareBackPress);
|
BackHandler.removeEventListener('hardwareBackPress', this._onHardwareBackPress);
|
||||||
|
|
||||||
clearTimeout(this._expandedLabelTimeout.current);
|
clearTimeout(this._expandedLabelTimeout.current);
|
||||||
|
setPictureInPictureEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { useDispatch, useSelector } from 'react-redux';
|
||||||
import JitsiScreen from '../../../../base/modal/components/JitsiScreen';
|
import JitsiScreen from '../../../../base/modal/components/JitsiScreen';
|
||||||
import { LoadingIndicator, TintedView } from '../../../../base/react';
|
import { LoadingIndicator, TintedView } from '../../../../base/react';
|
||||||
import { isLocalVideoTrackDesktop } from '../../../../base/tracks';
|
import { isLocalVideoTrackDesktop } from '../../../../base/tracks';
|
||||||
import { setPictureInPictureDisabled } from '../../../../mobile/picture-in-picture/functions';
|
import { setPictureInPictureEnabled } from '../../../../mobile/picture-in-picture/functions';
|
||||||
import { setIsCarmode } from '../../../../video-layout/actions';
|
import { setIsCarmode } from '../../../../video-layout/actions';
|
||||||
import ConferenceTimer from '../../ConferenceTimer';
|
import ConferenceTimer from '../../ConferenceTimer';
|
||||||
import { isConnecting } from '../../functions';
|
import { isConnecting } from '../../functions';
|
||||||
|
@ -31,12 +31,12 @@ const CarmodeTab = (): JSX.Element => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(setIsCarmode(true));
|
dispatch(setIsCarmode(true));
|
||||||
setPictureInPictureDisabled(true);
|
setPictureInPictureEnabled(false);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
dispatch(setIsCarmode(false));
|
dispatch(setIsCarmode(false));
|
||||||
if (!isSharing) {
|
if (!isSharing) {
|
||||||
setPictureInPictureDisabled(false);
|
setPictureInPictureEnabled(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { NativeModules } from 'react-native';
|
||||||
|
|
||||||
const { Dropbox } = NativeModules;
|
const { Dropbox } = NativeModules;
|
||||||
|
|
||||||
import { setPictureInPictureDisabled } from '../mobile/picture-in-picture/functions';
|
import { setPictureInPictureEnabled } from '../mobile/picture-in-picture/functions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action to authorize the Jitsi Recording app in dropbox.
|
* Action to authorize the Jitsi Recording app in dropbox.
|
||||||
|
@ -13,12 +13,12 @@ import { setPictureInPictureDisabled } from '../mobile/picture-in-picture/functi
|
||||||
* access token or rejected with an error.
|
* access token or rejected with an error.
|
||||||
*/
|
*/
|
||||||
export async function _authorizeDropbox(): Promise<Object> {
|
export async function _authorizeDropbox(): Promise<Object> {
|
||||||
setPictureInPictureDisabled(true);
|
setPictureInPictureEnabled(false);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await Dropbox.authorize();
|
return await Dropbox.authorize();
|
||||||
} finally {
|
} finally {
|
||||||
setPictureInPictureDisabled(false);
|
setPictureInPictureEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,13 @@ import { NativeModules } from 'react-native';
|
||||||
/**
|
/**
|
||||||
* Enabled/Disables the PictureInPicture mode in PiP native module.
|
* Enabled/Disables the PictureInPicture mode in PiP native module.
|
||||||
*
|
*
|
||||||
* @param {boolean} disabled - Whether the PiP mode should be disabled.
|
* @param {boolean} enabled - Whether the PiP mode should be enabled.
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export function setPictureInPictureDisabled(disabled: boolean) {
|
export function setPictureInPictureEnabled(enabled: boolean) {
|
||||||
const { PictureInPicture } = NativeModules;
|
const { PictureInPicture } = NativeModules;
|
||||||
|
|
||||||
if (PictureInPicture) {
|
if (PictureInPicture) {
|
||||||
PictureInPicture.setPictureInPictureDisabled(disabled);
|
PictureInPicture.setPictureInPictureEnabled(enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue