()
| 33 | } |
| 34 | |
| 35 | public startTracking() { |
| 36 | setInterval(() => { |
| 37 | const players = document.getElementsByTagName('video'); |
| 38 | for (let i = 0; i < players.length; i++) { |
| 39 | const player: HTMLVideoElement = players[i]; |
| 40 | const { duration } = player; |
| 41 | const current = player.currentTime; |
| 42 | const { paused } = player; |
| 43 | |
| 44 | if (duration && duration > 60) { |
| 45 | const item = { |
| 46 | current, |
| 47 | duration, |
| 48 | paused, |
| 49 | }; |
| 50 | logger.debug(window.location.href, item); |
| 51 | this.currentPlayer = player; |
| 52 | this.notifyListeners(item, player); |
| 53 | playerExtras(item, player); |
| 54 | return; |
| 55 | } |
| 56 | } |
| 57 | this.currentPlayer = null; |
| 58 | }, 1000); |
| 59 | |
| 60 | return this; |
| 61 | } |
| 62 | |
| 63 | protected proxySetTime: ((time: number) => void) | null = null; |
| 64 |
no test coverage detected