Explorar el Código

feat: 判断dpr播放全景视频

chenlei hace 2 meses
padre
commit
7f10b177db
Se han modificado 1 ficheros con 12 adiciones y 1 borrados
  1. 12 1
      Code/src/pages/A2visit/PanoVideo/index.tsx

+ 12 - 1
Code/src/pages/A2visit/PanoVideo/index.tsx

@@ -69,12 +69,23 @@ function PanoVideo({ lodingOk }: Propr) {
                 poster: otherUrl + 'pano/pano1.jpg'
               },
               {
+                res: '2000x1000',
+                url: otherUrl + 'pano/1-2k.mp4',
+                poster: otherUrl + 'pano/pano1.jpg'
+              },
+              {
                 res: '4000x2000',
                 url: otherUrl + 'pano/1-4k.mp4',
                 poster: otherUrl + 'pano/pano1.jpg'
               }
             ]}
-            playRes={isMobile ? '4000x2000' : '8000x4000'}
+            playRes={
+              isMobile
+                ? window.innerHeight * window.devicePixelRatio > 2400
+                  ? '4000x2000'
+                  : '2000x1000'
+                : '8000x4000'
+            }
             onVisibility={() => {
               if (document.visibilityState === 'visible') {
                 videoSceneModel.play()