Bläddra i källkod

fix: mobile pano video loading failed

chenlei 3 månader sedan
förälder
incheckning
86cc4ec66b

+ 2 - 2
Code/public/index.html

@@ -25,7 +25,7 @@
 
   <script src="./krpano.js"></script>
 
-  <script>
+  <!-- <script>
     window.onload = function () {
       var script = document.createElement('script')
       script.src = 'https://cdn.bootcss.com/eruda/1.5.4/eruda.min.js'
@@ -34,5 +34,5 @@
         eruda.init()
       }
     }
-  </script>
+  </script> -->
 </html>

+ 1 - 1
Code/public/myData/myData.js

@@ -3,7 +3,7 @@ window.isHH = document.documentElement.clientWidth >= document.documentElement.c
 const isPcTemp = document.documentElement.clientWidth >= 1200
 
 // 本地开发静态资源目录
-const baseUrlLoc = 'http://192.168.20.55:8080/staticData/'
+const baseUrlLoc = 'http://192.168.0.18:8080/staticData/'
 
 // 发送请求基地址
 const apiUrlTemp = 'https://sit-handaizy.4dage.com/api/'

+ 9 - 3
Code/src/pages/A2visit/PanoVideo/index.tsx

@@ -18,6 +18,7 @@ type Propr = {
 function PanoVideo({ lodingOk }: Propr) {
   // 热点名字-打开热点
   const [acName, setAcName] = useState('')
+  const isMobile = /Mobi|Android|iPhone/i.test(navigator.userAgent)
 
   const [activeIdx, setActiveIdx] = useState(-1)
   const middlewareIns = useRef<KrpanoMiddlewareMethods>(null)
@@ -63,12 +64,17 @@ function PanoVideo({ lodingOk }: Propr) {
             videoplayerUrl='./plugins/videoplayer.js'
             sourceList={[
               {
-                res: '2000x1000',
+                res: '8000x4000',
                 url: otherUrl + 'pano/1.mp4',
-                poster: otherUrl + 'pano/pano2.jpg'
+                poster: otherUrl + 'pano/pano1.jpg'
+              },
+              {
+                res: '4000x2000',
+                url: otherUrl + 'pano/1-4k.mp4',
+                poster: otherUrl + 'pano/pano1.jpg'
               }
             ]}
-            playRes='2000x1000'
+            playRes={isMobile ? '4000x2000' : '8000x4000'}
             onVisibility={() => {
               if (document.visibilityState === 'visible') {
                 videoSceneModel.play()

BIN
资源/pano/1-1k.mp4


BIN
资源/pano/1-2k.mp4


BIN
资源/pano/1-4k.mp4