|
|
|
|
24
|
import { SpeedyMedia } from 'speedy-vision/types/core/speedy-media';
|
24
|
import { SpeedyMedia } from 'speedy-vision/types/core/speedy-media';
|
25
|
import { SpeedyMediaSourceNativeElement } from 'speedy-vision/types/core/speedy-media-source';
|
25
|
import { SpeedyMediaSourceNativeElement } from 'speedy-vision/types/core/speedy-media-source';
|
26
|
import { SpeedyPromise } from 'speedy-vision/types/core/speedy-promise';
|
26
|
import { SpeedyPromise } from 'speedy-vision/types/core/speedy-promise';
|
|
|
27
|
+import { AR } from '../main';
|
27
|
import { Nullable, Utils } from '../utils/utils';
|
28
|
import { Nullable, Utils } from '../utils/utils';
|
28
|
import { AREvent, AREventTarget } from '../utils/ar-events';
|
29
|
import { AREvent, AREventTarget } from '../utils/ar-events';
|
29
|
-import { IllegalArgumentError, IllegalOperationError, NotSupportedError } from '../utils/errors';
|
|
|
|
|
30
|
+import { IllegalArgumentError, IllegalOperationError, NotSupportedError, AccessDeniedError } from '../utils/errors';
|
30
|
import { Viewport } from './viewport';
|
31
|
import { Viewport } from './viewport';
|
31
|
import { Settings } from './settings';
|
32
|
import { Settings } from './settings';
|
32
|
import { Stats } from './stats';
|
33
|
import { Stats } from './stats';
|
|
|
|
|
289
|
if(mode !== 'inline' && Session.count > 0)
|
290
|
if(mode !== 'inline' && Session.count > 0)
|
290
|
throw new IllegalOperationError(`Can't start more than one immersive session`);
|
291
|
throw new IllegalOperationError(`Can't start more than one immersive session`);
|
291
|
|
292
|
|
|
|
293
|
+ // dev build? work-in-progress
|
|
|
294
|
+ const isStableBuild = /^\d+\.\d+(\.\d+)*$/.test(AR.version);
|
|
|
295
|
+ if(!isStableBuild) {
|
|
|
296
|
+ if(!(['localhost', '127.0.0.1', '[::1]', '', 'encantar.dev', 'alemart.github.io'].includes(location.hostname))) {
|
|
|
297
|
+ if(!(location.hostname.startsWith('192.168.') || location.hostname.startsWith('10.') || /^172\.(1[6-9]|2[0-9]|3[01])\./.test(location.hostname))) {
|
|
|
298
|
+ const message = 'This is a development build (unstable). Do not use it in production.';
|
|
|
299
|
+ Utils.warning(message);
|
|
|
300
|
+ if(!confirm(message + '\n\nAre you sure you want to continue?'))
|
|
|
301
|
+ throw new AccessDeniedError('Aborted');
|
|
|
302
|
+ }
|
|
|
303
|
+ }
|
|
|
304
|
+ }
|
|
|
305
|
+
|
292
|
// initialize matrix routines
|
306
|
// initialize matrix routines
|
293
|
return Speedy.Matrix.ready();
|
307
|
return Speedy.Matrix.ready();
|
294
|
|
308
|
|