diff --git a/package-lock.json b/package-lock.json index 5bcb6621b51d1d308421939d4367d11c42dce3fd..b7e325721b0cfe0e22a140792806184c38122c24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,6 @@ "@tiptap/extension-underline": "^2.0.0-beta.23", "@tiptap/starter-kit": "2.0.0-beta.184", "ngx-tiptap": "^3.0.4", - "nosleep.js": "^0.12.0", "prosemirror-state": "^1.3.4", "rxjs": "^7.4.0", "testcafe": "^1.18.6", @@ -10872,11 +10871,6 @@ "node": ">=0.10.0" } }, - "node_modules/nosleep.js": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz", - "integrity": "sha512-9d1HbpKLh3sdWlhXMhU6MMH+wQzKkrgfRkYV0EBdvt99YJfj0ilCJrWRDYG2130Tm4GXbEoTCx5b34JSaP+HhA==" - }, "node_modules/npm-bundled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", @@ -23659,11 +23653,6 @@ "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", "dev": true }, - "nosleep.js": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz", - "integrity": "sha512-9d1HbpKLh3sdWlhXMhU6MMH+wQzKkrgfRkYV0EBdvt99YJfj0ilCJrWRDYG2130Tm4GXbEoTCx5b34JSaP+HhA==" - }, "npm-bundled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", diff --git a/package.json b/package.json index ebdefbefc0d939387a2944a4e3d5e71d9850251b..da3845bd0ba3cf317b347e1a1bfe61218664287c 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,6 @@ "@tiptap/extension-underline": "^2.0.0-beta.23", "@tiptap/starter-kit": "2.0.0-beta.184", "ngx-tiptap": "^3.0.4", - "nosleep.js": "^0.12.0", "prosemirror-state": "^1.3.4", "rxjs": "^7.4.0", "testcafe": "^1.18.6", diff --git a/projects/player/src/app/app.component.ts b/projects/player/src/app/app.component.ts index bd955b2c86b277ec730f5a41e8ec207a4028aeb0..17c650d14ce4f4b154bafb6b5134e21d0a950868 100644 --- a/projects/player/src/app/app.component.ts +++ b/projects/player/src/app/app.component.ts @@ -54,8 +54,6 @@ export class AppComponent implements OnInit { .subscribe((message: VopStartCommand): void => this.onStart(message)); this.nativeEventService.focus .subscribe((focused: boolean): void => this.onFocus(focused)); - this.nativeEventService.pointerDown - .subscribe( () => this.deviceService.dontSleep()); } private initVeronaPostService(): void { diff --git a/projects/player/src/app/services/device.service.ts b/projects/player/src/app/services/device.service.ts index 80101ecf95f5001ff5e7ad171f86d8f8af82f495..988c5120b6fce518964aa3510030e3f62539ba0a 100644 --- a/projects/player/src/app/services/device.service.ts +++ b/projects/player/src/app/services/device.service.ts @@ -1,6 +1,4 @@ import { Injectable } from '@angular/core'; -import NoSleep from 'nosleep.js'; -import { LogService } from 'player/modules/logging/services/log.service'; @Injectable({ providedIn: 'root' @@ -8,20 +6,11 @@ import { LogService } from 'player/modules/logging/services/log.service'; export class DeviceService { hasHardwareKeyboard: boolean = false; private readonly isTouch!: boolean; - private noSleep!: NoSleep; // Cannot be instanced in a constructor, must be instanced by a user event constructor() { this.isTouch = (('ontouchstart' in window) || (navigator && navigator.maxTouchPoints > 0)); } - dontSleep(): void { - if (this.isTouch && (!this.noSleep || !this.noSleep.isEnabled )) { - this.noSleep = new NoSleep(); - this.noSleep.enable().then(() => {}, - () => LogService.error('player: enabling noSleep instance failed')); - } - } - get isMobileWithoutHardwareKeyboard(): boolean { return this.isTouch && !this.hasHardwareKeyboard; }