|
@@ -60,7 +60,7 @@ var initOverlay = function(THREE) {
|
|
if (info.media) {
|
|
if (info.media) {
|
|
if (info.media.includes('video')) {
|
|
if (info.media.includes('video')) {
|
|
//var id = "video"+ this.sid id="${ id }"
|
|
//var id = "video"+ this.sid id="${ id }"
|
|
- var video = $(`<video controls="controls" loop autoplay x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>`)[0]
|
|
|
|
|
|
+ var video = $(`<video controls="controls" loop x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>`)[0]
|
|
|
|
|
|
video.setAttribute("crossOrigin", 'Anonymous')
|
|
video.setAttribute("crossOrigin", 'Anonymous')
|
|
//要在src设置好前解决跨域
|
|
//要在src设置好前解决跨域
|
|
@@ -76,9 +76,16 @@ var initOverlay = function(THREE) {
|
|
/* video.addEventListener('loadeddata', ()=>{
|
|
/* video.addEventListener('loadeddata', ()=>{
|
|
console.log(this.sid + " loaded!!!")
|
|
console.log(this.sid + " loaded!!!")
|
|
}) */
|
|
}) */
|
|
- video.volume = 0
|
|
|
|
- video.muted = true
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /* video.volume = 0
|
|
|
|
+ video.muted = true */
|
|
plane.material.opacity = 1;
|
|
plane.material.opacity = 1;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ video.currentTime = 0
|
|
|
|
+
|
|
|
|
+
|
|
} else if (info.media.includes('photo')) {
|
|
} else if (info.media.includes('photo')) {
|
|
/* var img = new Image();
|
|
/* var img = new Image();
|
|
|
|
|
|
@@ -233,8 +240,13 @@ var initOverlay = function(THREE) {
|
|
|
|
|
|
Overlay.prototype.updateVisibles = function(panos) {
|
|
Overlay.prototype.updateVisibles = function(panos) {
|
|
this.visible = !!panos.find(pano=>this.visiblePanos.includes(pano))
|
|
this.visible = !!panos.find(pano=>this.visiblePanos.includes(pano))
|
|
- if (!this.visible && this.overlayType == 'video')
|
|
|
|
- this.videoControl('stop')
|
|
|
|
|
|
+
|
|
|
|
+ if(this.overlayType == 'video'){
|
|
|
|
+ this.visible ? this.videoControl("play") : this.videoControl('stop')
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -251,8 +263,7 @@ var initOverlay = function(THREE) {
|
|
if(!state || state == 'stop'){
|
|
if(!state || state == 'stop'){
|
|
this.plane.material.map.image.paused || this.plane.material.map.image.pause()
|
|
this.plane.material.map.image.paused || this.plane.material.map.image.pause()
|
|
if(state == 'stop'){
|
|
if(state == 'stop'){
|
|
- this.plane.material.map.image.currentTime = 0;
|
|
|
|
-
|
|
|
|
|
|
+ this.plane.material.map.image.currentTime = 0;
|
|
}
|
|
}
|
|
//console.log("pause")
|
|
//console.log("pause")
|
|
}else if(state){
|
|
}else if(state){
|