()
| 110 | } |
| 111 | |
| 112 | function stop() { |
| 113 | cleanup?.() |
| 114 | cleanup = null |
| 115 | if (visibilityHandler) { |
| 116 | document.removeEventListener('visibilitychange', visibilityHandler) |
| 117 | visibilityHandler = null |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | function reconnect() { |
| 122 | if (!cleanup) return |