'视频关闭启动,关闭声音'

master
qsj 2 years ago
parent 5c348080c4
commit 9c38818d91

@ -8,7 +8,7 @@
"compileHotReLoad": false,
"postcss": false,
"preloadBackgroundData": false,
"minified": false,
"minified": true,
"newFeature": true,
"autoAudits": false,
"coverView": true,

@ -26,5 +26,8 @@
}
]
}
},
"setting": {
"bigPackageSizeSupport": true
}
}

@ -8,12 +8,13 @@ import React, {
PropsWithChildren,
useEffect,
useState,
useRef,
} from "react";
import Echarts from "./components/Echart/index";
import {
Block,
View,
View,
Text,
Image,
Video,
@ -144,7 +145,8 @@ class IotCarePlanWL200 extends Component<any, any> {
matrixElectricity: 4, // WE200发箍电量
workMode: "", //当前模式
videoRef: {},
isMuted: false,
gear: { gear: 1 },
currentShowDialog: "",
step: 1, // 1:选择模式并播放视频, 2:护理中
@ -244,7 +246,6 @@ class IotCarePlanWL200 extends Component<any, any> {
componentDidShow() {
console.log("页面显示了");
if (!this.hadLoadedPage) {
this.hadLoadedPage = true; // 二次进入页面(非首次进入)
return;
@ -2022,6 +2023,23 @@ class IotCarePlanWL200 extends Component<any, any> {
return isFooterBtnDisabled; // 数据更新有延迟,返回用于判断
};
handleClickVideo = () => {
let videoRef = Taro.createVideoContext('myVideo')
// 开始播放
videoRef.play()
// 暂停播放
videoRef.pause()
console.log('暂停播放', videoRef);
};
handleClicksound = () => {
let isMuted = this.state.isMuted
isMuted = !isMuted
this.setState({ isMuted })
}
onPlay = (e) => {
console.log('出发', e);
}
customBack = () => {
Taro.reLaunch({ url: "/pages/index/index" });
};
@ -2039,6 +2057,7 @@ class IotCarePlanWL200 extends Component<any, any> {
isConnectShow,
isShowStepTips,
isShowNurse,
isStopNurse,
ModeList,
ModeType,
@ -2052,6 +2071,7 @@ class IotCarePlanWL200 extends Component<any, any> {
isShowCountdown,
countdown,
Electricity,
isMuted,
matrixElectricity,
errorTips,
isEndCarePlan,
@ -2240,9 +2260,18 @@ class IotCarePlanWL200 extends Component<any, any> {
className='video-or-image'
src={ActiveModeItem.modeVideo}
loop
id="myVideo"
// ref={videoRef}
onPlay={this.onPlay}
muted={isMuted}
/>
)}
<button onClick={this.handleClicksound}>/</button>
{/* <button onClick={this.handleClickVideo}>播放/暂停</button> */}
{isShowNurse && (
<Block>
{isStopNurse ? (

Loading…
Cancel
Save