How to confirm that a viewing session is ended

I am writing a bash scipt to do a simple wowza_access.log parsing, somewhat like top command, to show the real time clients event and duration status.
I found that a testing video player (jwplayer) still viewing the video stream, but the same client IP and same client-id will trigger some ‘stop’ ‘destroy’ ‘disconnect’ events even the video is still playing.

How do I decide that the player has stopped or even browser is closed? so that I can treat that session ended? what is the log messages that confirm this?

Thanks in advance
Cheers
Joshua