unresolved method captureStream on HTMLCanvasElement(HTMLCanvasElement 上未解决的方法 captureStream)
问题描述
canvas 元素和方法 captureStream
的情况很奇怪.根据文档 HTMLCanvasElement 有一个方法 captureStream
.但是我的 Angular6 应用声称没有这种方法.
I have weird situation with canvas element and method captureStream
. According to documentation HTMLCanvasElement has a method captureStream
. However my Angular6 app claims that there isn't such method.
所以这段代码不起作用:
So this code won't work:
let canvas: HTMLCanvasElement;
canvas = document.createElement('canvas');
let stream = canvas.captureStream(20);
第三行失败.
这段代码运行没有任何错误:
This code runs without any error:
let canvas: any;
canvas = document.createElement('canvas');
let stream = canvas.captureStream(20);
这怎么可能?我 100% 确定 HTMLCanvasElement 具有此方法,并且 document.createElement('canvas') 返回 HTMLCanvasElement.
How this is possible? I'm 100% sure that HTMLCanvasElement has this method and the document.createElement('canvas') returns HTMLCanvasElement.
推荐答案
根据MDN,看起来 captureStream
方法仍然是一个工作草案(截至 2021 年 6 月),尽管并非所有主流浏览器都实现了它.这可能就是为什么它还不是 HTMLCanvasElement
的类型定义的一部分.
According to MDN, it looks like the captureStream
method is still a working draft (as of June 2021), eventhough it is not implemented by all major browsers. That is probably why it is not yet part of the type definition for HTMLCanvasElement
.
这篇关于HTMLCanvasElement 上未解决的方法 captureStream的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:HTMLCanvasElement 上未解决的方法 captureStream


- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 失败的 Canvas 360 jquery 插件 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- addEventListener 在 IE 11 中不起作用 2022-01-01