GithubHelp home page GithubHelp logo

大神我测出来一个bug about cameraview HOT 7 CLOSED

cjt2325 avatar cjt2325 commented on June 14, 2024
大神我测出来一个bug

from cameraview.

Comments (7)

CJT2325 avatar CJT2325 commented on June 14, 2024

你好,这个BUG不是你设备的原因,是这个项目的存在BUG
This happens if stop() is called immediately after start();
这是MediaRecorder接口stop()方法的说明,如果在star()之后立刻stop()就会抛出异常,你现在看到的这份代码我的处理是如果录制视频过短,会延迟1000毫秒再去stop(),但是我没有处理频繁按住松开这部分逻辑,在我本地我已经处理了,不过逻辑有点不太清晰,等完善之后我更新上去。

from cameraview.

zhangxiaobin123456 avatar zhangxiaobin123456 commented on June 14, 2024

我找到源码是试着将 CameraInterface类中的 stopRecord方法 中 try{}catch{}里边的 IllegalStateException 改成了 Exception ,
if (mediaRecorder != null && isRecorder) {
try {
mediaRecorder.stop();
isRecorder = false;
} catch (Exception e) {
e.printStackTrace();
}

点了点暂时好像没出bug

from cameraview.

CJT2325 avatar CJT2325 commented on June 14, 2024

嗯,可以尝试一下,然后你最好在catch到异常后将资源全部释放掉,或者放在finily里面也可以

from cameraview.

zhangxiaobin123456 avatar zhangxiaobin123456 commented on June 14, 2024

等于就是将 stopRecord方法剩下的代码都放到了finally 里边吧

from cameraview.

CJT2325 avatar CJT2325 commented on June 14, 2024

嗯,就是一些状态的更改,和资源的释放

from cameraview.

zhangxiaobin123456 avatar zhangxiaobin123456 commented on June 14, 2024

谢谢大神指点,我放进去了,试着频繁操作并没有崩溃

from cameraview.

CJT2325 avatar CJT2325 commented on June 14, 2024

👍 我找个时间用你的方法处理一下

from cameraview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.