diff --git a/package.json b/package.json index 8e2caabcc..27641eea7 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,11 @@ "coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", "prepush": "npm run lint", "commitmsg": "node config/validate-commit-msg.js", - "changelog": "node config/changelog.js" + "changelog": "node config/changelog.js", + "packages": "npm run packages:update && npm run packages:build && npm run packages:publish", + "packages:update": "pvu --update=react-view360,ngx-view360/projects/ngx-view360,vue-view360", + "packages:build": "pvu --build=react-view360,ngx-view360,vue-view360", + "packages:publish": "pvu --publish=react-view360,ngx-view360/dist/ngx-view360,vue-view360" }, "repository": { "type": "git", diff --git a/src/PanoViewer/PanoViewer.ts b/src/PanoViewer/PanoViewer.ts index 8ac70f648..0c9040169 100644 --- a/src/PanoViewer/PanoViewer.ts +++ b/src/PanoViewer/PanoViewer.ts @@ -473,13 +473,14 @@ class PanoViewer extends Component { } if (image) { + this._deactivate(); + this._image = image as HTMLImageElement; this._isVideo = isVideo; this._projectionType = param.projectionType || PROJECTION_TYPE.EQUIRECTANGULAR; this._cubemapConfig = cubemapConfig; this._stereoFormat = stereoFormat; - this._deactivate(); this._initRenderer(this._yaw, this._pitch, this._fov, this._projectionType, this._cubemapConfig); } @@ -990,6 +991,12 @@ class PanoViewer extends Component { * Destroy webgl context and block user interaction and stop rendering */ private _deactivate() { + // Turn off the video if it has one + const video = this.getVideo(); + if (video) { + video.pause(); + } + if (this._isReady) { this._photoSphereRenderer!.stopRender(); this._yawPitchControl!.disable();