diff --git a/packages/nutui-taro-demo/src/pages/index/index.tsx b/packages/nutui-taro-demo/src/pages/index/index.tsx index bf214cb214..54de2dd9b4 100644 --- a/packages/nutui-taro-demo/src/pages/index/index.tsx +++ b/packages/nutui-taro-demo/src/pages/index/index.tsx @@ -1,5 +1,5 @@ import Taro from '@tarojs/taro' -import { View, Image, Text, ScrollView, Button, Input } from '@tarojs/components' +import { View, Image, Text, ScrollView, Button, Input, Video } from '@tarojs/components' import pkg from '@/packages/../config.json' import packageJson from '@/packages/../../package.json' import './index.scss' @@ -10,7 +10,7 @@ const navs = pkg.nav // hack taro load button xml -console.log(Button, Input ) +console.log(Button, Input, Video ) // try { // console.log('xxx', Schema) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a0fd1d67d3..d7d23e189f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18010,4 +18010,4 @@ snapshots: yoctocolors-cjs@2.1.2: {} - zwitch@2.0.4: {} + zwitch@2.0.4: {} \ No newline at end of file diff --git a/src/config.json b/src/config.json index aaf92c5d38..b700e19aa1 100644 --- a/src/config.json +++ b/src/config.json @@ -1133,7 +1133,7 @@ "author": "swag~jun" }, { - "version": "2.0.0", + "version": "3.0.0", "name": "Video", "type": "component", "cName": "视频播放器", diff --git a/src/packages/video/demo.taro.tsx b/src/packages/video/demo.taro.tsx index 103a083e25..44e38884c3 100644 --- a/src/packages/video/demo.taro.tsx +++ b/src/packages/video/demo.taro.tsx @@ -2,6 +2,7 @@ import React from 'react' import Taro from '@tarojs/taro' import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' + import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' import Demo2 from './demos/taro/demo2' @@ -44,9 +45,7 @@ const VideoDemo = () => { return ( <>
- + {translated.basic} {translated.autoPlay} diff --git a/src/packages/video/demos/taro/demo1.tsx b/src/packages/video/demos/taro/demo1.tsx index 3ff469ba24..fe14f7f965 100644 --- a/src/packages/video/demos/taro/demo1.tsx +++ b/src/packages/video/demos/taro/demo1.tsx @@ -1,8 +1,9 @@ import React, { useState } from 'react' import { Cell, Video } from '@nutui/nutui-react-taro' +import pxTransform from '@/utils/px-transform' const Demo1 = () => { - const [source, setSource] = useState({ + const [source] = useState({ src: 'https://storage.360buyimg.com/nutui/video/video_NutUI.mp4', type: 'video/mp4', }) @@ -14,14 +15,14 @@ const Demo1 = () => { const playend = (elm: any) => console.log('playend', elm) return ( <> - + diff --git a/src/packages/video/demos/taro/demo2.tsx b/src/packages/video/demos/taro/demo2.tsx index f665a972fd..5265d8cb25 100644 --- a/src/packages/video/demos/taro/demo2.tsx +++ b/src/packages/video/demos/taro/demo2.tsx @@ -1,8 +1,9 @@ import React, { useState } from 'react' import { Cell, Video } from '@nutui/nutui-react-taro' +import pxTransform from '@/utils/px-transform' const Demo2 = () => { - const [source, setSource] = useState({ + const [source] = useState({ src: 'https://storage.360buyimg.com/nutui/video/video_NutUI.mp4', type: 'video/mp4', }) @@ -16,14 +17,14 @@ const Demo2 = () => { const playend = (elm: any) => console.log('playend', elm) return ( <> - + diff --git a/src/packages/video/demos/taro/demo3.tsx b/src/packages/video/demos/taro/demo3.tsx index 20175dca8e..71fa64dd13 100644 --- a/src/packages/video/demos/taro/demo3.tsx +++ b/src/packages/video/demos/taro/demo3.tsx @@ -1,8 +1,9 @@ import React, { useState } from 'react' import { Cell, Video } from '@nutui/nutui-react-taro' +import pxTransform from '@/utils/px-transform' const Demo3 = () => { - const [source, setSource] = useState({ + const [source] = useState({ src: 'https://storage.360buyimg.com/nutui/video/video_NutUI.mp4', type: 'video/mp4', }) @@ -15,14 +16,14 @@ const Demo3 = () => { const playend = (elm: any) => console.log('playend', elm) return ( <> - + diff --git a/src/packages/video/demos/taro/demo4.tsx b/src/packages/video/demos/taro/demo4.tsx index fe143692b9..0cc2cc20d6 100644 --- a/src/packages/video/demos/taro/demo4.tsx +++ b/src/packages/video/demos/taro/demo4.tsx @@ -1,8 +1,9 @@ import React, { useState } from 'react' import { Cell, Video } from '@nutui/nutui-react-taro' +import pxTransform from '@/utils/px-transform' const Demo4 = () => { - const [source, setSource] = useState({ + const [source] = useState({ src: 'https://storage.360buyimg.com/nutui/video/video_NutUI.mp4', type: 'video/mp4', }) @@ -23,7 +24,7 @@ const Demo4 = () => { onPlay={play} onPause={pause} onPlayEnd={playend} - style={{ height: '163px' }} + style={{ height: pxTransform(163) }} /> diff --git a/src/packages/video/demos/taro/demo5.tsx b/src/packages/video/demos/taro/demo5.tsx index e18c601316..65d83529ee 100644 --- a/src/packages/video/demos/taro/demo5.tsx +++ b/src/packages/video/demos/taro/demo5.tsx @@ -1,8 +1,9 @@ import React, { useState } from 'react' import { Cell, Video } from '@nutui/nutui-react-taro' +import pxTransform from '@/utils/px-transform' const Demo5 = () => { - const [source, setSource] = useState({ + const [source] = useState({ src: 'https://storage.360buyimg.com/nutui/video/video_NutUI.mp4', type: 'video/mp4', }) @@ -15,14 +16,14 @@ const Demo5 = () => { const playend = (elm: any) => console.log('playend', elm) return ( <> - + diff --git a/src/packages/video/demos/taro/demo6.tsx b/src/packages/video/demos/taro/demo6.tsx index dac3f10616..a8b191a666 100644 --- a/src/packages/video/demos/taro/demo6.tsx +++ b/src/packages/video/demos/taro/demo6.tsx @@ -1,8 +1,9 @@ import React, { useState } from 'react' import { Cell, Video } from '@nutui/nutui-react-taro' +import pxTransform from '@/utils/px-transform' const Demo6 = () => { - const [source, setSource] = useState({ + const [source] = useState({ src: 'https://storage.360buyimg.com/nutui/video/video_NutUI.mp4', type: 'video/mp4', }) @@ -19,14 +20,14 @@ const Demo6 = () => { const playend = (elm: any) => console.log('playend', elm) return ( <> - + diff --git a/src/packages/video/demos/taro/demo7.tsx b/src/packages/video/demos/taro/demo7.tsx index ac089782fd..2d02cd1719 100644 --- a/src/packages/video/demos/taro/demo7.tsx +++ b/src/packages/video/demos/taro/demo7.tsx @@ -1,8 +1,9 @@ import React, { useState } from 'react' import { Cell, Video, Button } from '@nutui/nutui-react-taro' +import pxTransform from '@/utils/px-transform' const Demo7 = () => { - const [source1, setSource1] = useState({ + const [source, setSource] = useState({ src: 'https://storage.360buyimg.com/nutui/video/legao-%E6%9D%A8%E8%BF%9B%E5%86%9B.mp4', type: 'video/mp4', }) @@ -14,23 +15,23 @@ const Demo7 = () => { const playend = (elm: any) => console.log('playend', elm) const changeVideo = () => { - setSource1({ ...source1, src: 'https://vjs.zencdn.net/v/oceans.mp4' }) + setSource({ ...source, src: 'https://vjs.zencdn.net/v/oceans.mp4' }) } return ( <> - +