forked from lavender/watch-party
		
	Dont send events if video controls hidden
This commit is contained in:
		
							parent
							
								
									903fd535ce
								
							
						
					
					
						commit
						051516fef6
					
				
					 6 changed files with 8 additions and 8 deletions
				
			
		|  | @ -1,4 +1,4 @@ | ||||||
| import { setupCreateSessionForm } from "./lib/create-session.mjs"; | import { setupCreateSessionForm } from "./lib/create-session.mjs?v=2"; | ||||||
| 
 | 
 | ||||||
| const main = () => { | const main = () => { | ||||||
|   setupCreateSessionForm(); |   setupCreateSessionForm(); | ||||||
|  |  | ||||||
|  | @ -52,6 +52,6 @@ | ||||||
|       </form> |       </form> | ||||||
|     </div> |     </div> | ||||||
| 
 | 
 | ||||||
|     <script type="module" src="/main.mjs?v=2"></script> |     <script type="module" src="/main.mjs?v=3"></script> | ||||||
|   </body> |   </body> | ||||||
| </html> | </html> | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| import { createSession } from "./watch-session.mjs?v=3"; | import { createSession } from "./watch-session.mjs?v=4"; | ||||||
| 
 | 
 | ||||||
| export const setupCreateSessionForm = () => { | export const setupCreateSessionForm = () => { | ||||||
|   const form = document.querySelector("#create-session-form"); |   const form = document.querySelector("#create-session-form"); | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| import { joinSession } from "./watch-session.mjs?v=3"; | import { joinSession } from "./watch-session.mjs?v=4"; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @param {HTMLInputElement} field |  * @param {HTMLInputElement} field | ||||||
|  |  | ||||||
|  | @ -85,7 +85,7 @@ const setupOutgoingEvents = (video, socket) => { | ||||||
|   const currentVideoTime = () => (video.currentTime * 1000) | 0; |   const currentVideoTime = () => (video.currentTime * 1000) | 0; | ||||||
| 
 | 
 | ||||||
|   video.addEventListener("pause", async (event) => { |   video.addEventListener("pause", async (event) => { | ||||||
|     if (outgoingDebounce) { |     if (outgoingDebounce || !video.controls) { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -101,7 +101,7 @@ const setupOutgoingEvents = (video, socket) => { | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|   video.addEventListener("play", (event) => { |   video.addEventListener("play", (event) => { | ||||||
|     if (outgoingDebounce) { |     if (outgoingDebounce || !video.controls) { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -124,7 +124,7 @@ const setupOutgoingEvents = (video, socket) => { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (outgoingDebounce) { |     if (outgoingDebounce || !video.controls) { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| import { setupJoinSessionForm } from "./lib/join-session.mjs?v=2"; | import { setupJoinSessionForm } from "./lib/join-session.mjs?v=3"; | ||||||
| 
 | 
 | ||||||
| const main = () => { | const main = () => { | ||||||
|   setupJoinSessionForm(); |   setupJoinSessionForm(); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue