diff --git a/video.html b/video.html index a8268f3..660da75 100644 --- a/video.html +++ b/video.html @@ -19,7 +19,7 @@ console.log("connection closed"); }; - window.onunload=function(){ + window.onbeforeunload=function(){ ws.close(); };