change(player): dont show cursor icon if session is played on mobvile

This commit is contained in:
sylenien 2022-12-13 16:38:37 +01:00 committed by Delirium
parent d96ae9e259
commit 3ac436bdb9
3 changed files with 6 additions and 5 deletions

View file

@ -5,9 +5,10 @@ import styles from './cursor.module.css';
export default class Cursor {
private readonly cursor: HTMLDivElement;
private tagElement: HTMLDivElement;
constructor(overlay: HTMLDivElement) {
constructor(overlay: HTMLDivElement, isMobile: boolean) {
this.cursor = document.createElement('div');
this.cursor.className = styles.cursor;
if (isMobile) this.cursor.style.backgroundImage = 'unset'
overlay.appendChild(this.cursor);
}

View file

@ -57,7 +57,7 @@ export default class Screen {
private readonly screen: HTMLDivElement;
private parentElement: HTMLElement | null = null;
constructor() {
constructor(isMobile: boolean) {
const iframe = document.createElement('iframe');
iframe.className = styles.iframe;
this.iframe = iframe;
@ -73,7 +73,7 @@ export default class Screen {
screen.appendChild(overlay);
this.screen = screen;
this.cursor = new Cursor(this.overlay) // TODO: move outside
this.cursor = new Cursor(this.overlay, isMobile) // TODO: move outside
}
attach(parentElement: HTMLElement) {

View file

@ -31,7 +31,7 @@ export default class WebPlayer extends Player {
private targetMarker: TargetMarker
constructor(private wpState: Store<typeof WebPlayer.INITIAL_STATE>, session, config: RTCIceServer[], live: boolean) {
const isMobile = session.userOs === 'iPhone' || session.userOs === 'Android'
let initialLists = live ? {} : {
event: session.events.toJSON(),
stack: session.stackEvents.toJSON(),
@ -46,7 +46,7 @@ export default class WebPlayer extends Player {
),
}
const screen = new Screen()
const screen = new Screen(isMobile)
const messageManager = new MessageManager(session, wpState, screen, initialLists)
super(wpState, messageManager)
this.screen = screen