diff --git a/src/vr.js b/src/vr.js index 91e8c80..778816b 100644 --- a/src/vr.js +++ b/src/vr.js @@ -61,6 +61,7 @@ class Vr extends BasePlugin { * @static */ static defaultConfig: Object = { + tag: '360', moveMultiplier: 0.15, deviceMotionMultiplier: 1, startInStereo: false, @@ -95,6 +96,7 @@ class Vr extends BasePlugin { _longitude: number; _calculateCanvasSizeInterval: ?IntervalID; _crossOriginSet: boolean; + _tag: string; /** * @constructor @@ -106,6 +108,7 @@ class Vr extends BasePlugin { super(name, player, config); this._initMembers(); this._addBindings(); + this.updateVrIsOn(this.config.tag); } /** @@ -282,6 +285,11 @@ class Vr extends BasePlugin { } } + updateVrIsOn(vrTag: string): void { + this._tag = vrTag ?? '360'; + this.player.setVrTag(vrTag); + } + _updateCamera(): void { if (this._camera) { // limiting latitude from -89 to 89 (cannot point to the sky or under your feet) @@ -453,6 +461,7 @@ class Vr extends BasePlugin { this._latitude = 0; this._longitude = 180; this._crossOriginSet = false; + this._tag = this.config.tag; } _cancelAnimationFrame(): void {