From a84dfe8178ca1270a9c00730f1ab900d7a83969d Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Sat, 15 Jan 2022 00:53:42 +0800 Subject: [PATCH] Add: sleep stop timer --- web/src/App.css | 3 +++ web/src/component/AudioPlayer.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/web/src/App.css b/web/src/App.css index a0d6b5d..b841f03 100644 --- a/web/src/App.css +++ b/web/src/App.css @@ -108,3 +108,6 @@ dialog { .warp-word { overflow-wrap: anywhere; } +.number-input { + width: 5em; +} diff --git a/web/src/component/AudioPlayer.js b/web/src/component/AudioPlayer.js index 45ae91b..35934ea 100644 --- a/web/src/component/AudioPlayer.js +++ b/web/src/component/AudioPlayer.js @@ -18,6 +18,8 @@ function AudioPlayer(props) { }); const [playingURL, setPlayingURL] = useState(""); const [isPreparing, setIsPreparing] = useState(false); + const [timerCount, setTimerCount] = useState(0); + const [timerID, setTimerID] = useState(null); useEffect(() => { // no playing file @@ -111,6 +113,35 @@ function AudioPlayer(props) {
+ + { + setTimerCount(e.target.value); + }} + /> + + +