jpilfold / ngx-image-viewer

An image viewer component for Angular 2+
MIT License
49 stars 54 forks source link

Open Image Viewer in fullscreen mode by default #25

Closed mirko-lazarevic closed 5 years ago

mirko-lazarevic commented 5 years ago

Hello @jpilfold, I'm using your component dynamically (I create the component instance when user clicks on the button) I'd like to know is it possible to open image viewer in fullscreen mode directly?

By default fullscreen is set to false, so far the only thing I could do is this.imageViewerComponentInstance.fullscreen = true;

jpilfold commented 5 years ago

As per the MDN docs (https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen) fullscreen must be called as part of a user action, otherwise it will fail. You could try calling toggleFullscreen on the component instance from your button click though

mirko-lazarevic commented 5 years ago

I come up with different solution. Thank you very much, anyway.