Callback after video finishes?

I'm trying to write a Plex plugin to create a livestream - I'm aware of the limitations, but I'm still trying to get it working.

 

The stream gets created and plays fine, but I have no way to know if the user is finished watching the stream. Since the plugin interacts with an external program to reserve a TV tuner, start transcoding, and start streaming, I need a way to call back to my plugin when the user closes the stream.

After a while of searching the docs, it doesn't seem that this is possible.

 

Is there a method of receiving this callback that I'm not aware of?

 

Thanks for any responses!

I'm afraid that's not possible in the current framework

A possible workaround would be to utilize the HTTP interface of Plex Media Server to get these kind of updates. Don't know much about it so I can't even tell you where to start, but I know some people have created plugins/apps regarding this. Maybe look how Trakt works?