Jump to content

Webhooks handling of playing next TV episode


ajcdk

Recommended Posts

Hi,

Rather new guy to Emby here, but loving it so far.

I've really taken a liking to the webhooks plugin to dim/undim lights in my living room when playing something, but it is a bit wonky sometimes when I watch a TV show.

I noticed that when it goes to the next episode, it'll send the "playback.stop" almost instantly followed by "playback.start", meaning my lights will turn up the brightness and then immediately dim them again.
I have tried to counter this effect in my PHP script by using a text file and a timer delay; basically when playback stops, it writes a string, then waits. If it then receives playback.start during that delay, it'll overwrite the text file, and after that delay it'll read the text file again, which should then keep it from undimming the lights.

This fix doesn't always work though. So I'd really love a native solution to this in the Webhooks plugin.

Alternatively, feedback from someone who has experienced the same challenge and found a solid fix would be very welcome.

Thanks!

Link to comment
Share on other sites

Hi, that's more or less the convention in our api. It tells you that playback has stopped on the first file, and then you get a notification for the second one. What you can do is check the NextMediaType value, and if that's null, then that tells you that nothing will be playing next.

Link to comment
Share on other sites

Hi Luke, thanks so much for your reply. I looked into your suggestion of checking the value of "NextMediaType", but that doesn't seem to be part of the data sent. Does it have another key name, that I'm just missing?

I really appreciate you taking the time to help me out with what is admittedly a bit of a champagne problem :)

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...