获取视频时间,图表样式层级过高

master
qsj 2 years ago
parent a757928cf6
commit 2cb4156bc1

@ -12,6 +12,7 @@ import React, {
} from "react"; } from "react";
import Echarts from "./components/Echart/index"; import Echarts from "./components/Echart/index";
import EchartFace from "./components/Echart_face/index";
import { import {
Block, Block,
View, View,
@ -2036,6 +2037,12 @@ class IotCarePlanWL200 extends Component<any, any> {
isMuted = !isMuted isMuted = !isMuted
this.setState({ isMuted }) this.setState({ isMuted })
} }
GetVideosTime=(event)=>{
let videoRef = Taro.createVideoContext('myVideo',this)
// videoRef.currentTime
console.log('获取播放时间',event.detail.currentTime);
}
onPlay = (e) => { onPlay = (e) => {
console.log('出发', e); console.log('出发', e);
@ -2260,17 +2267,14 @@ class IotCarePlanWL200 extends Component<any, any> {
className='video-or-image' className='video-or-image'
src={ActiveModeItem.modeVideo} src={ActiveModeItem.modeVideo}
loop loop
id="myVideo" id="myVideo"
// ref={videoRef}
onPlay={this.onPlay} onPlay={this.onPlay}
muted={isMuted} muted={isMuted}
onTimeUpdate={this.GetVideosTime}
/> />
)} )}
<button onClick={this.handleClicksound}>/</button> <button onClick={this.GetVideosTime}></button>
{/* <button onClick={this.handleClicksound}>音频播放/音频暂停</button> */}
{/* <button onClick={this.handleClickVideo}>播放/暂停</button> */} {/* <button onClick={this.handleClickVideo}>播放/暂停</button> */}
{isShowNurse && ( {isShowNurse && (
<Block> <Block>
@ -2339,6 +2343,7 @@ class IotCarePlanWL200 extends Component<any, any> {
)} )}
<Echarts></Echarts> <Echarts></Echarts>
<EchartFace></EchartFace>
</View> </View>
<Footer <Footer

@ -47,6 +47,7 @@ function Index() {
}; };
const echartsRef = useRef<EchartsHandle>(null); const echartsRef = useRef<EchartsHandle>(null);
const option: EChartOption = { const option: EChartOption = {
grid: { grid: {
// 让图表占满容器 // 让图表占满容器
top: "28rpx", top: "28rpx",
@ -289,6 +290,7 @@ function Index() {
<Block> <Block>
<View className='box'> <View className='box'>
<Echarts <Echarts
force-use-old-canvas="false"
echarts={echarts} echarts={echarts}
option={option} option={option}
ref={echartsRef} ref={echartsRef}

@ -359,7 +359,8 @@ const seriesData = [
ref={echartsRef} ref={echartsRef}
// isPage={false} // isPage={false}
// style自定义设置echarts宽高 // style自定义设置echarts宽高
style={{ width: "100%", height: "100%" }} // style={{ width: "100%", height: "100%" }}
style={{ width: "630rpx", height: "260rpx" }}
/> />
{/* <View className="box"> {/* <View className="box">

Loading…
Cancel
Save