Browse Source

add support for different panorama in fullscreen

pull/1240/head
Pavel Zbytovský 1 month ago
parent
commit
5c27ae484a
3 changed files with 26 additions and 0 deletions
  1. +10
    -0
      examples/example-fullscreenPanorama.htm
  2. +15
    -0
      src/js/pannellum.js
  3. +1
    -0
      src/standalone/standalone.js

+ 10
- 0
examples/example-fullscreenPanorama.htm View File

@@ -0,0 +1,10 @@
<!DOCTYPE HTML>
<html>
<head>
<title>pannellum embed example</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<iframe width="480" height="390" allowfullscreen style="border-style:none;" src="../src/standalone/pannellum.htm#panorama=../../examples/examplepano-640.jpg&amp;panoramaFullscreen=../../examples/examplepano.jpg&amp;autoLoad=true&amp;showZoomCtrl=false&amp;autoRotate=-1"></iframe>
</body>
</html>

+ 15
- 0
src/js/pannellum.js View File

@@ -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();


+ 1
- 0
src/standalone/standalone.js View File

@@ -67,6 +67,7 @@ function parseURLParameters() {
case 'fallback':
case 'preview':
case 'panorama':
case 'panoramaFullscreen':
case 'config':
configFromURL[option] = decodeURIComponent(value);
break;


Loading…
Cancel
Save