|
@@ -63,6 +63,7 @@
|
|
|
myLoadingStatus: false,
|
|
|
repeatFlag: false, //重复点击
|
|
|
isIOS: false,
|
|
|
+ muted: true,
|
|
|
}
|
|
|
},
|
|
|
beforeDestroy() {
|
|
@@ -188,21 +189,25 @@
|
|
|
controls.enableRotate = true; //启用摄像机水平或垂直旋转
|
|
|
|
|
|
// 监听相机移动事件-限制只能在当前空间范围内移动
|
|
|
- controls.addEventListener('change', () => {
|
|
|
- // 检查相机位置是否超出边界框
|
|
|
- if (boundary && !boundary.containsPoint(camera.position)) {
|
|
|
- let clampedPosition = new THREE.Vector3();
|
|
|
- boundary.clampPoint(camera.position, clampedPosition);
|
|
|
- if (clampedPosition) {
|
|
|
- camera.position.copy(clampedPosition);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ // controls.addEventListener('change', () => {
|
|
|
+ // // 检查相机位置是否超出边界框
|
|
|
+ // if (boundary && !boundary.containsPoint(camera.position)) {
|
|
|
+ // let clampedPosition = new THREE.Vector3();
|
|
|
+ // boundary.clampPoint(camera.position, clampedPosition);
|
|
|
+ // if (clampedPosition) {
|
|
|
+ // camera.position.copy(clampedPosition);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
camera.lookAt(that.controlStarPosition.x, that.controlStarPosition.y, that.controlStarPosition.z);
|
|
|
starRender(); //启动渲染
|
|
|
- // setTimeout(() => {
|
|
|
- // videoHandle()
|
|
|
- // }, 500);
|
|
|
+ if(that.isIOS){
|
|
|
+ document.addEventListener("WeixinJSBridgeReady", function (){
|
|
|
+ videoHandle();
|
|
|
+ }, false)
|
|
|
+ }else{
|
|
|
+ videoHandle();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function videoHandle() {
|
|
@@ -214,11 +219,15 @@
|
|
|
controls2.dispose();
|
|
|
}
|
|
|
// 创建视频元素
|
|
|
- var video = document.createElement('video');
|
|
|
+ // var video = document.createElement('video');
|
|
|
+ var video = document.getElementById('myvideo');
|
|
|
video.src = that.videoUrl; // 视频文件的路径
|
|
|
video.setAttribute("crossOrigin", "Anonymous");
|
|
|
video.loop = true;
|
|
|
- video.muted = true;
|
|
|
+ video.muted = that.muted;
|
|
|
+ video.controls = false;
|
|
|
+ video.setAttribute('webkit-playsinline', true);
|
|
|
+ video.setAttribute('playsinline', true);
|
|
|
video.play();
|
|
|
|
|
|
console.warn("***video***",video,video.width);
|
|
@@ -446,6 +455,9 @@
|
|
|
clearHandle() {
|
|
|
this.clearEvent();
|
|
|
},
|
|
|
+ updateMuted(){
|
|
|
+ this.muted = !this.muted;
|
|
|
+ },
|
|
|
aiPeopleChange(item){
|
|
|
console.warn("***aiPeopleChange***",item);
|
|
|
if(!item || !item.url){
|