fix(tracker): fix asist canvas layer (#1923)

This commit is contained in:
Delirium 2024-03-01 12:08:50 +01:00 committed by GitHub
parent deb9f37d8f
commit 7c2db1d67c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,7 @@
## 8.0.3
- make assist canvas layer hidden from canvas capturer
## 8.0.2
- another fix for peer reconnection strategy

View file

@ -1,7 +1,7 @@
{
"name": "@openreplay/tracker-assist",
"description": "Tracker plugin for screen assistance through the WebRTC",
"version": "8.0.2",
"version": "8.0.3",
"keywords": [
"WebRTC",
"assistance",

View file

@ -4,6 +4,7 @@ export default class AnnotationCanvas {
private painting = false
constructor() {
this.canvas = document.createElement('canvas')
this.canvas.setAttribute('data-openreplay-hidden', '1')
Object.assign(this.canvas.style, {
position: 'fixed',
left: 0,

View file

@ -6,6 +6,7 @@ declare global {
function dummyTrack(): MediaStreamTrack {
const canvas = document.createElement('canvas')//, { width: 0, height: 0})
canvas.setAttribute('data-openreplay-hidden', '1')
canvas.width=canvas.height=2 // Doesn't work when 1 (?!)
const ctx = canvas.getContext('2d')
ctx?.fillRect(0, 0, canvas.width, canvas.height)

View file

@ -15,6 +15,7 @@ describe('AnnotationCanvas', () => {
style: {},
getContext: jest.fn(() => contextMock as unknown as HTMLCanvasElement),
parentNode: document,
setAttribute: jest.fn()
}
contextMock = {