mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.28k stars 724 forks source link

"autoLoad" option with multires causes black screen. #349

Open jsassinsky opened 7 years ago

jsassinsky commented 7 years ago

When the "autoLoad": true option is added to a multires pano it causes Pannellum to open but the viewer remains black. Removing the autoLoad option returns the viewer to normal behavior, of course with the "Click to Load" button.

The black screen behavior is observed using Chrome Version 56.0.2924.87 (64-bit) on Windows 10. The background on Microsoft Edge 38.14393.0.0 is the "Click to Load" background image but without the button. Regardless, the pano still does not auto load.

It appears the multires panos on the pannellum.org home page auto load during scene changes without the autoLoad option in the script. Is this default behavior or is there another method used to auto load the multires image?

mpetroff commented 7 years ago

Do you have an example that displays this behavior? Are any errors printed to the browser's developer console?

jsassinsky commented 7 years ago

See attached. There are no errors in the console. By all indications, except for the bug, the viewer is operating properly. No exceptions. No errors.

We did find that a multires pano with "autoLoad": true enabled shows black and will remain that way indefinitely until the browser window is resized then it instantly appears.

pannellum black screen

mpetroff commented 7 years ago

By example, I meant a web page, not an image. I unfortunately can't debug an image.

alvarigno commented 6 years ago

it usually happen when you implement pannellum into a modal bootstrap view, it didn't work. it works with autoload "false". it works when you click on button.

yjchieng commented 6 years ago

@mpetroff I could provide an example:

With autoload: http://360.ademo.work/multires?autoload Without autoload: http://360.ademo.work/multires

Although I don't get a black screen, I get sth like this:

screen shot 2018-07-06 at 19 15 17

If I resize the browser or do something that cause the display area to change size (E.g. open developer tool) then the image became normal.

mpetroff commented 6 years ago

@yjchieng You need to move the <style> section into <head> (or at least before the Pannellum instance). The canvas is being created before the style information is evaluated, so the canvas is 0px tall and hence isn't visible.

yjchieng commented 6 years ago

@mpetroff ah, now i understand why. The problem is solved by moving the