-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
canvas回放时img空白 #851
Comments
@Juice10 https://github.com/rrweb-io/rrweb/blob/master/packages/rrweb/src/record/observers/canvas/2d.ts#L45-L59 |
@Mark-Fenng I'm working on a version that uses the (webgl) serializer that support capturing image arguments. I'm hoping to be done in the next couple days with it. Keep an eye on the canvas-fps branch. |
thanks. |
我也出现这个问题了 楼主最后解决了吗 你那个解决方案 你试了 行得通吗 英语不好 看不懂楼下那个大神说的 他正在开发的canvas-fps分支 怎么整 |
@naimao001 他说正在开发的那个分支解决了这个问题,等一段时间这个分支合并到主分支后就会发布一个新的版本 |
好的,这个问题只是回放时候的问题是吧,大佬解决了 原来录屏的events就正常可以回放出来了吧 |
应该是在录制时的问题,录制出来的数据中
args的第一个参数是空的{},需要等待问题解决后才能录制出正确的数据 |
@naimao001 我的那个方案可以解决呀,我就那么处理的,将img元素只保留src属性就行,然后加一个标记字段便于回放的时候识别并恢复成img元素就行。 |
当然也可以参考 |
@pjxxcc @Mark-Fenng |
#859 should fix this issue. Both with |
问题
canvas回放时里面的img部分显示空白,控制台可以看到如下打印:
排查发现是因为录制的canvas事件中带有一个img元素:
经过
JSON.stringify
转为json字符串后,dom元素img被处理成了{}
:解决
目前想到的方案是在
JSON.stringify
中对dom元素做转换,仅保留必要的属性,然后在JSON.parse
时再逆向恢复为dom元素:这个方案应该能解决问题,但是感觉不是最佳方案。
我看本项目的文档示例中也是对录制数据进行
JSON.stringify
处理后存放,是否应该在rrweb.record得到的envent中不返回dom元素,而是简单的数据对象呢?The text was updated successfully, but these errors were encountered: