# Video Player Hook

**URL:** <https://forums.plex.tv/t/video-player-hook/2092>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [June 25, 2009, 11:09am UTC](https://forums.plex.tv/t/video-player-hook/2092 "2009-06-25T11:09:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![logy](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@logy](https://forums.plex.tv/u/logy)\
**Post date:** [June 25, 2009, 11:09am UTC](https://forums.plex.tv/t/video-player-hook/2092/1 "2009-06-25T11:09:17Z")

</div>

Greetings…  
  
  
  
i like to make a little hook script when i press play/pause/stop while playing a video. i just want call/start a system command or shell script.

- is this possible with a pyton script/plugin or do i have to edit the plex source?  
- is there a script/plugin API documentation? or a simple example for understanding.  
  
  
  
i “speak” bash/perl and a little bit python, so i just need the hook syntax (if there is one)  
  
  
  
the main goal is to send an I/O command via an usb-I/O adapter to toggle/dimm the roomlight  
  
  
  
any info/suggestion/help would be nice  
  
  
  
thanks in advance

---

<div class="post-metadata">

**Author:** ![jam](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jam/32/186050_2.png) [@jam](https://forums.plex.tv/u/jam)\
**Post date:** [June 25, 2009, 3:48pm UTC](https://forums.plex.tv/t/video-player-hook/2092/2 "2009-06-25T15:48:36Z")

</div>

Sorry, there’s no way of doing this currently. It’s something we want to add to future versions as part of a bigger “event” system 🙂

---

<div class="post-metadata">

**Author:** ![sansnipple](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sansnipple](https://forums.plex.tv/u/sansnipple)\
**Post date:** [June 25, 2009, 4:13pm UTC](https://forums.plex.tv/t/video-player-hook/2092/3 "2009-06-25T16:13:00Z")

</div>

that would be so awesome, having plex intelligently control the room lighting!

---

<div class="post-metadata">

**Author:** ![logy](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@logy](https://forums.plex.tv/u/logy)\
**Post date:** [June 25, 2009, 4:54pm UTC](https://forums.plex.tv/t/video-player-hook/2092/4 "2009-06-25T16:54:29Z")

</div>

> [@](#):
>
> Sorry, there’s no way of doing this currently. It’s something we want to add to future versions as part of a bigger “event” system 🙂

  
You got 3 days :D  
  
Ok, i will wait. In the meantime I found a dirty workaround: I monitor the plex process via [ps-watcher](http://ps-watcher.sourceforge.net/). If the plex process hit 50% CPU ps-watch will run a shell command. (and run enother if it goes back)  
  
On my mac mini plex use 12% cpu while in menu or pause. while play 1080p it use ~70%.  
  
For the light this could be enought, for my second [goal](http://forums.plexapp.com/index.php?showtopic=7264&hl=) (play 2 different sound track on 2 different audio interfaces) i guess it won't be very syncron.

---

<div class="post-metadata">

**Author:** ![Keane16](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@Keane16](https://forums.plex.tv/u/Keane16)\
**Post date:** [June 26, 2009, 10:34am UTC](https://forums.plex.tv/t/video-player-hook/2092/5 "2009-06-26T10:34:30Z")

</div>

Very cool. 🙂  
  
  
  
So many possibilities.

---

<div class="post-metadata">

**Author:** ![antspants](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@antspants](https://forums.plex.tv/u/antspants)\
**Post date:** [July 18, 2009, 7:03am UTC](https://forums.plex.tv/t/video-player-hook/2092/6 "2009-07-18T07:03:59Z")

</div>

☹ …   
  
  
  
i wish i was a bigger nerd…   
  
  
  
  
  
sigh…

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 8:28pm UTC](https://forums.plex.tv/t/video-player-hook/2092/7 "2019-12-20T20:28:24Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
