`react-video-recorder`卡在加载上

发布于 2025-02-02 06:24:01 字数 658 浏览 1 评论 0原文

我正在尝试使用 react-video-recorder 在我的应用中。我在Stackblitz和Storybook中看到了

但是,当我在代码中实现它时,它只是显示组件,索取麦克风和凸轮权限,然后卡在“加载...”上。我的相机LED点亮了几秒钟,然后关闭。

我使用推荐方法安装了软件包(YARN添加React-Video-React React React-Dom Prop-Types样式组件)。我有节点V16.14.2,React V18.1.0和React-Scripts V5。

我刚刚写了一个非常基本的React视频记录器实现。像这样:

import VideoRecorder from "react-video-recorder"

export default function CreateMyIntro () {
  return (
    <VideoRecorder />
  )
}

我做错了什么?

I'm trying to use react-video-recorder in my app. I see the demos, both in Stackblitz and the Storybook in Vercel. Both works just fine in my browsers.

But when I implement it in my code, it just shows the component, asks for mic and cam permissions, and then it's stuck at "Loading...". My camera LED lights up for a few seconds, and turns back off.

I installed the package using the recommended method (yarn add react-video-recorder react react-dom prop-types styled-components). I have Node v16.14.2, React v18.1.0 and react-scripts v5.

I just wrote a very basic implementation of React Video Recorder. Like this:

import VideoRecorder from "react-video-recorder"

export default function CreateMyIntro () {
  return (
    <VideoRecorder />
  )
}

What do I do wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悲喜皆因你 2025-02-09 06:24:02

只需遇到这个问题。根据其github上的“问题”选项卡,该模块与React 18不起作用。尝试降级为17。请参见他们的github问题

*编辑:从10/14/22版本开始Noreferrer“> 3.19.4 已发布,其中包括React 18的兼容性。尝试更新到最新版本,我刚刚对其进行了测试,现在正在使用React 18。

Just ran into this issue. According to the issues tab on their GitHub, the module does not work with React 18. Try downgrading to React 17. See their GitHub Issues

*Edit: As of 10/14/22 version 3.19.4 was released, which includes compatibility for React 18. Try updating to most recent version, I just tested it and it is working now with React 18.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文