None 的浏览器支持录制视频

None of the browsers support recording of a video

我已经实现了 react-webcam 和 react-video-recorder 分别使用设备的网络摄像头拍摄照片和视频。我已经按照文档进行操作,并且它们都可以在我的本地主机上完美运行。问题是当我部署它们时,浏览器不支持录制视频。我已经在 Chrome、Firefox 和 Opera 上测试过,其中 none 支持它。

我已经关注 https://www.npmjs.com/package/react-webcam for taking image and https://www.npmjs.com/package/react-video-recorder 通过设备的网络摄像头录制视频。

class VideoPost extends Component {
  handleRecordingComplete = (videoBlob, startedAt, thumbnailBlob, duration) => {
    const urlCreator = window.URL || window.webkitURL;
    const videoUrl = urlCreator.createObjectURL(videoBlob);
    this.setState({ videoSrc: videoUrl, video: videoBlob });
  };
  onVideoDisplay = () => (
    <video
      src={this.state.videoSrc}
      controls
      style={{
        height: '200px',
        width: '200px'
      }}
    />
  );
  render(){
    return(
      <div>
      <VideoRecorder
        onRecordingComplete={this.handleRecordingComplete}
        renderLoadingView={this.onVideoDisplay}
      />
      </div>
    )
  }
}

我希望视频能播放

然而在现场,

我是不是漏掉了什么?

这可能是由于来源不安全。确保您已在 https 上部署您的应用程序,即您已应用有效的 SSL 证书

参考 - react-webcam 的 npm 页面

Note: Browsers will throw an error if the page is loaded from insecure origin. I.e. Use https.