decord/alpha/source/modules/external_pip/useExternalPipEnabler.android.tsx

41 lines
1.6 KiB
TypeScript
Raw Normal View History

// Module ID: 17545
// Function ID: 17546
// Name: useExternalPipEnabler
// Dependencies: [4843, 502, 4850, 504, 17546, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 17545 (useExternalPipEnabler)
import ExternalPipEnablerState from "ExternalPipEnablerState" /* 17546 */;
import ChannelRTCStore from "ChannelRTCStore" /* 4843 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4850 */;
2026-07-23 10:11:24 +00:00
require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/external_pip/useExternalPipEnabler.android.tsx");
2026-07-20 16:05:17 +00:00
export default function useExternalPIPEnabler(disabled) {
disabled = disabled.disabled;
const items = [ChannelRTCStore, RTCConnectionStore, AuthenticationStore];
2026-07-20 16:05:17 +00:00
const items1 = [disabled];
return disabled(504).useStateFromStoresObject(items, () => {
const channelId = RTCConnectionStore.getChannelId();
2026-07-20 16:05:17 +00:00
if (null != channelId) {
if (!disabled) {
const videoParticipants = ChannelRTCStore.getVideoParticipants(channelId);
2026-07-29 08:29:29 +00:00
let tmp2 = videoParticipants.filter((localVideoDisabled) => !localVideoDisabled.localVideoDisabled).length > 0;
if (!tmp2) {
const streamParticipants = ChannelRTCStore.getStreamParticipants(channelId);
2026-07-29 08:29:29 +00:00
const found = streamParticipants.filter((user) => user.user.id !== id.getId());
tmp2 = null != found.find((streamId) => null != streamId.streamId);
2026-07-20 16:05:17 +00:00
}
const obj2 = {};
const merged = Object.assign(ExternalPipEnablerState.DEFAULT_STATE);
obj2.externalPipEnabled = tmp2;
return obj2;
2026-07-20 16:05:17 +00:00
}
}
return ExternalPipEnablerState.DEFAULT_STATE;
2026-07-20 16:05:17 +00:00
}, items1);
};