From 5c27ae484ab299be1827cd118fe18a1a577f15d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Zbytovsk=C3=BD?= Date: Thu, 3 Oct 2024 11:11:11 +0200 Subject: [PATCH] add support for different panorama in fullscreen --- examples/example-fullscreenPanorama.htm | 10 ++++++++++ src/js/pannellum.js | 15 +++++++++++++++ src/standalone/standalone.js | 1 + 3 files changed, 26 insertions(+) create mode 100644 examples/example-fullscreenPanorama.htm diff --git a/examples/example-fullscreenPanorama.htm b/examples/example-fullscreenPanorama.htm new file mode 100644 index 0000000..6e80b2a --- /dev/null +++ b/examples/example-fullscreenPanorama.htm @@ -0,0 +1,10 @@ + + + + pannellum embed example + + + + + + diff --git a/src/js/pannellum.js b/src/js/pannellum.js index ead7333..a7f866c 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -2327,6 +2327,21 @@ function processOptions(isPreview) { function toggleFullscreen() { if (loaded && !error) { if (!fullscreenActive) { + if (config.panoramaFullscreen) { + var p = ''; + if (config.basePath) { + p = config.basePath; + } + p = absoluteURL(config.panoramaFullscreen) ? config.panoramaFullscreen : p + config.panoramaFullscreen; + + var panoImageFullscreen = document.createElement('img'); + panoImageFullscreen.src = p; + panoImageFullscreen.onload = function() { + panoImage = panoImageFullscreen; + onImageLoad(); + } + } + try { if (container.requestFullscreen) { container.requestFullscreen(); diff --git a/src/standalone/standalone.js b/src/standalone/standalone.js index c33155a..8e414b8 100644 --- a/src/standalone/standalone.js +++ b/src/standalone/standalone.js @@ -67,6 +67,7 @@ function parseURLParameters() { case 'fallback': case 'preview': case 'panorama': + case 'panoramaFullscreen': case 'config': configFromURL[option] = decodeURIComponent(value); break;