Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

暂停录音后,将数据深拷贝了,在拷贝的哪部分上播放后,原来的不能继续录音。为什么这种情况。 #51

Closed
sleepyddl opened this issue May 30, 2020 · 3 comments

Comments

@sleepyddl
Copy link

暂停录音后,将数据深拷贝了,在拷贝的哪部分上播放后,原来的数据不能继续录音。为什么这种情况。

@sleepyddl
Copy link
Author

可能我没有描述清楚问题。

场景是这样的,点击顺序 开始 --> 克隆 --> 继续

问题是,对克隆后的a 进行继续录音 无效

HTML

<button class="start">开始</button>
<button class="clone">克隆</button>
<button class="resume">继续</button>

JS

let recorder = new Recorder();
let a = null;

document.querySelector(".start").addEventListener("click", () => {
  recorder.start();
  setTimeout(() => {
    recorder.pause();
  }, 2000);
});

document.querySelector(".clone").addEventListener("click", () => {
  a = _.cloneDeep(recorder);
  console.log(a);
});

document.querySelector(".resume").addEventListener("click", () => {
  a.resume();
  setInterval(() => {
    console.log(a);
  }, 1000);
});

@2fps
Copy link
Owner

2fps commented Dec 17, 2020

二进制数据,不能这么拷贝的呀,转成dateview去处理

@sleepyddl
Copy link
Author

哈哈 我小白 过段时间试试

@2fps 2fps closed this as completed Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants