Sorry if it is in the API documentation but I cannot find it.
is there any way to do something (run a script) when a viewer connects and disconnects / time out?
If you mean tracking specified client connection/disconnection there are no WMSPanel API methods to trigger a script by these events.
Paul, you may achieve the desired result using the external handler as described in the following documentation page:
Feel free to use the following sample code as a starting point:
I need to make it so client can only watch 1 channel at a time.
playback authorization would work but I am no good at socket programming.
I have just seen the PPV handler page. softvelumDOTcom/paywall/pay_per_view/
Could I accomplish what I want with using "Enable publish/unpublish notifications."
1)"Enable publish/unpublish notifications" is triggered when incoming stream connected/disconnected. it's not for client connection notifications.
2) you don't have to be socket programmer to implement https://blog.wmspanel.com/2018/11/playback-session-authorization.html . handler implemented as regular web handler on any modern language. github link provided has simple python example
3) If you plan to use pay_per_view you will have to implement web handler as well. Usually clients implement both https://blog.wmspanel.com/2018/11/playback-session-authorization.html and pay per view handler.
Auth handler declines client if this user already watch video. pay per view handler checks when client disconnected and mark client disconnected from current stream to allow connect to new one.
You can mark client as "watching" in your database and don't show video player in case if client is "watching".
Thanks a lot for the info
and required to achieve the purposes illustrated in the
If you want to know more or withdraw your consent to all or some of the cookies, please
refer to the