Yansen 2 年之前
父節點
當前提交
031adb70c8
共有 3 個檔案被更改,包括 4 行新增3 行删除
  1. 1
    0
      src/pages/sample/home/components/VideoPlay.jsx
  2. 2
    3
      src/pages/sample/home/index.jsx
  3. 1
    0
      vite.config.js

+ 1
- 0
src/pages/sample/home/components/VideoPlay.jsx 查看文件

@@ -41,6 +41,7 @@ const VideoPlay = (props) => {
41 41
       ref={ref}
42 42
       autoPlay={false}
43 43
       src={url}
44
+      controls="controls"
44 45
       onEnded={() => {
45 46
         isVideoPlayRef.current = false;
46 47
       }}

+ 2
- 3
src/pages/sample/home/index.jsx 查看文件

@@ -27,7 +27,7 @@ export default (props) => {
27 27
     height,
28 28
     overflow: 'hidden',
29 29
     width: '100%',
30
-    objectFit: 'fill',
30
+    objectFit: 'contain',
31 31
   }), [height]);
32 32
 
33 33
   useEffect(() => {
@@ -52,7 +52,6 @@ export default (props) => {
52 52
     });
53 53
     handNext();
54 54
 
55
-    
56 55
     const boxHeight = boxRef.current.offsetHeight;
57 56
     setHeight(boxHeight ? `${boxHeight}px` : '100%');
58 57
   }, []);
@@ -78,7 +77,7 @@ export default (props) => {
78 77
     <div
79 78
       onMouseEnter={onMouseEnter}
80 79
       onMouseLeave={onMouseLeave}
81
-      style={{ height, overflow: "hidden" }}
80
+      style={{ height, overflow: "hidden", background: '#081A48' }}
82 81
       ref={boxRef}
83 82
     >
84 83
       <Carousel

+ 1
- 0
vite.config.js 查看文件

@@ -6,6 +6,7 @@ import vitePluginImp from 'vite-plugin-imp'
6 6
 // https://vitejs.dev/config/
7 7
 export default defineConfig({
8 8
   server: {
9
+    host: '0.0.0.0',
9 10
     proxy: {
10 11
       '/api/': {
11 12
         // 要代理的地址