Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
3f8abeb5
Commit
3f8abeb5
authored
Mar 22, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:录音bug
parent
a9eec6b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/modules/teach-tool/components/XMRecord.jsx
+7
-7
No files found.
src/modules/teach-tool/components/XMRecord.jsx
View file @
3f8abeb5
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-03-18 10:01:28
* @Date: 2020-03-18 10:01:28
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-22 1
6:59:29
* @LastEditTime: 2021-03-22 1
7:24:38
* @Description: 录音组件
* @Description: 录音组件
*/
*/
...
@@ -118,6 +118,9 @@ class XMRecord extends Component {
...
@@ -118,6 +118,9 @@ class XMRecord extends Component {
};
};
handleFinishRecord
=
()
=>
{
handleFinishRecord
=
()
=>
{
if
(
this
.
mMediaRecorder
)
{
this
.
mMediaRecorder
.
stop
();
}
const
blob
=
this
.
mMediaRecorder
.
upload
();
const
blob
=
this
.
mMediaRecorder
.
upload
();
UploadOss
.
uploadBlobToOSS
(
blob
,
window
.
random_string
(
16
)
+
".wav"
).
then
(
UploadOss
.
uploadBlobToOSS
(
blob
,
window
.
random_string
(
16
)
+
".wav"
).
then
(
(
mp3URL
)
=>
{
(
mp3URL
)
=>
{
...
@@ -128,9 +131,6 @@ class XMRecord extends Component {
...
@@ -128,9 +131,6 @@ class XMRecord extends Component {
isFinished
:
true
,
isFinished
:
true
,
});
});
window
.
clearInterval
(
this
.
timer
);
window
.
clearInterval
(
this
.
timer
);
if
(
this
.
mMediaRecorder
)
{
this
.
mMediaRecorder
.
stop
();
}
}
}
);
);
};
};
...
@@ -147,6 +147,9 @@ class XMRecord extends Component {
...
@@ -147,6 +147,9 @@ class XMRecord extends Component {
};
};
handleCancel
=
()
=>
{
handleCancel
=
()
=>
{
if
(
this
.
mMediaRecorder
)
{
this
.
mMediaRecorder
.
stop
();
}
window
.
clearInterval
(
this
.
timer
);
window
.
clearInterval
(
this
.
timer
);
this
.
setState
(
this
.
setState
(
{
{
...
@@ -155,9 +158,6 @@ class XMRecord extends Component {
...
@@ -155,9 +158,6 @@ class XMRecord extends Component {
},
},
()
=>
{
()
=>
{
this
.
props
.
onCancel
();
this
.
props
.
onCancel
();
if
(
this
.
mMediaRecorder
)
{
this
.
mMediaRecorder
.
stop
();
}
}
}
);
);
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment