Просмотр исходного кода

Allow switching to dynamic scenes (fixes #686).

pull/688/head
Matthew Petroff 6 лет назад
Родитель
Сommit
a057211989
2 измененных файлов: 14 добавлений и 0 удалений
  1. +6
    -0
      doc/json-config-parameters.md
  2. +8
    -0
      src/js/pannellum.js

+ 6
- 0
doc/json-config-parameters.md Просмотреть файл

@@ -446,6 +446,12 @@ Currently, only equirectangular dynamic content is supported.
The panorama source is considered dynamic when this is set to `true`. Defaults
to `false`. This should be set to `true` for video.

### `dynamicUpdate` (boolean)

For dynamic content, viewer will start automatically updating when set to
`true`. Defaults to `false`. If the updates are controlled via the `setUpdate`
method, as with the Video.js plugin, this should be set to `false`.



## Additional information for tour configuration files


+ 8
- 0
src/js/pannellum.js Просмотреть файл

@@ -92,6 +92,7 @@ var defaultConfig = {
northOffset: 0,
showFullscreenCtrl: true,
dynamic: false,
dynamicUpdate: false,
doubleClickZoom: true,
keyboardZoom: true,
mouseZoom: true,
@@ -2287,6 +2288,13 @@ function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) {
}
fireEvent('scenechange', sceneId);
load();

// Properly handle switching to dynamic scenes
update = config.dynamicUpdate === true;
if (config.dynamic) {
panoImage = config.panorama;
onImageLoad();
}
}

/**


Загрузка…
Отмена
Сохранить