Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.presentation.focus();
// Setup orbit control.
const { x, y, z } = this.presentation.getCurrentStep().getPosition();
this.orbitControl.enabled = true;
this.orbitControl.target.set(x, y, z);
} else {
selectedComponent = undefined;
this.presentation.blur();
}
if (mode === EditorMode.PLAY) {
this.presentation.play();
this.orbitControl.enabled = false;
this.transformControl.enabled = false;
this.transformControl.detach();
if (Screenfull) Screenfull.request(this.presentation.domElement);
this.presentation.resize(window.innerWidth, window.innerHeight);
} else if (this.state.mode === EditorMode.PLAY) {
if (Screenfull) Screenfull.exit();
}
this.setState({
mode,
selectedComponent
});
}
enterFullscreen(canvas) {
if (screenfull.enabled) {
screenfull.request(canvas);
} else {
// iOS
this.__setState(State.PRESENTING_FULLSCREEN);
}
return true;
}
$(document).on('click', '#cr-stage', function () {
if (screenfull.enabled) {
screenfull.request($('#theater')[0]);
$('body').addClass('fullscreen');
scaleGame();
document.addEventListener(screenfull.raw.fullscreenchange, function () {
if (!screenfull.isFullscreen) {
// exit fullscreen code here
$('body').removeClass('fullscreen');
scaleGame();
}
});
}
});
onClickFullscreen() {
if(!this.state.fullscreen) {
screenfull.request(findDOMNode(this.pdf_wrapper));
} else {
screenfull.exit();
}
this.setState({ fullscreen: !this.state.fullscreen });
}
export function showFullScreenIfWasFullScreen() {
if (hasEnteredFullScreenThisSession && !screenfull.isFullscreen) {
screenfull.request();
}
}
this.album = this.navParams.get('album') as Album;
this.story = this.navParams.get('story') as Story;
this.backgroundImage = this.sanitizer.bypassSecurityTrustUrl(
this.story.backgroundImage
);
if (this.story.type === 'youtube') {
this.source = this.sanitizer.bypassSecurityTrustResourceUrl(
this.story.source
);
this.setYoutubeUrl(this.story.source);
this.showControls = true;
} else {
this.showControls = false;
}
if (screenfull.enabled) {
screenfull.request();
}
}
public enterFullscreen(): void {
if (!this.state.isFullscreenAvailable) {
return;
}
screenfull.request(this.ref);
}
enterFullscreen() {
if(screenfull.enabled){
screenfull.request(this.sourceCanvas);
this.__setState(State.PRESENTING);
return true;
}
return false;
};
const handleRequestFullscreenEnter = useCallback(() => {
if (screenfull.enabled) {
screenfull.request(container.current);
}
onFullscreenEnter();
}, [onFullscreenEnter]);