Skip to content

Commit

Permalink
add supportsFullscreen flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Regaddi committed Jan 11, 2022
1 parent bfce8a8 commit d0e8e9a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export interface DailyBrowserInfo {
mobile: boolean;
name: string;
version: string;
supportsFullscreen: boolean;
supportsScreenShare: boolean;
supportsSfu: boolean;
supportsVideoProcessing: boolean;
Expand Down
2 changes: 2 additions & 0 deletions src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ import {
isReactNative,
browserVideoSupported_p,
getUserAgent,
isFullscreenSupported,
isScreenSharingSupported,
isSfuSupported,
isVideoProcessingSupported,
Expand Down Expand Up @@ -623,6 +624,7 @@ export default class DailyIframe extends EventEmitter {
mobile: browser.getPlatformType() === 'mobile',
name: browser.getBrowserName(),
version: browser.getBrowserVersion(),
supportsFullscreen: !!isFullscreenSupported(),
supportsScreenShare: !!isScreenSharingSupported(),
supportsSfu: !!isSfuSupported(),
supportsVideoProcessing: isVideoProcessingSupported(),
Expand Down
7 changes: 7 additions & 0 deletions src/shared-with-pluot-core/Environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ export function isScreenSharingSupported() {
return isDisplayMediaAccessible() && canUnifiedPlan();
}

export function isFullscreenSupported() {
if (isReactNative()) return false;
if (!document) return false;
const iframe = document.createElement('iframe');
return !!iframe.requestFullscreen || !!iframe.webkitRequestFullscreen;
}

const supportedBrowsersForVideoProcessors = ['Chrome', 'Firefox'];

export function isVideoProcessingSupported() {
Expand Down

0 comments on commit d0e8e9a

Please sign in to comment.