Play video with a movement sensor (GPIO)
2019-08-19 play-video-by-gpio-V1.10.10.js download
BUG FIX, NEW FEATURES, MINOR UPDATES
- Initial version
COMPATIBILITY
- PlugnCast V3.10.51
- Device Gekkota V4.11.10 (or above) supporting Jack 35 GPIO
- Playzilla V4.10.20 (or above)
INFORMATION
INSTALLATION AND CONFIGURATION
- In PlugnCast, create a type
textvariable name (ex:videoSource), whose name has to be also defined inVAR_NAMEof the playout scriptplay-video-by-gpio-V1.10.10.js, and create values for this variable- Variable value examples
- VideoA/video.mp4
- VideoB/video.m2v
- Variable value examples
- Associate an appropriate value of the variable
videoSourceto the device - Create a playout with a nominal content
- Add the required video media to the playout manifest
- Insert the
play-video-by-gpio-V1.10.10.jsscript in thescript to executescreen of thePropertytab of the playout Edit the script
play-video-by-gpio-V1.10.10.jsand adjust the 2 parameters value oftriggerOnEdgeandmediaOnStatedepending on your needs:- Typical use case when using a luminosity sensor or a switch:
triggerOnEdge= false :mediaOnState= false:- on GPIO level 0, the video is played infinitely
- on GPIO level 1, the nominal playout content is played
- in case GPIO level bouncing, the played content is following the GPIO level
mediaOnState= true:- on GPIO level 0, the nominal playout content is played
- on GPIO level 1, the video is played infinitely
- in case GPIO level bouncing, the played content is following the GPIO level
- Typical use case when using a movement sensor or a push-button:
triggerOnEdge= true :mediaOnState= false:- when there is noone in the room, the nominal playout content is always played
- on a presence detection [rising edge], the video is played once
mediaOnState= true:- when there is noone in the room, the nominal playout content is always played
- on a presence detection [falling edge], the video is played once
- Typical use case when using a luminosity sensor or a switch:
Publish the playout on the device
Note: the video can be played only in the main region of the playout
MOVEMENT SENSOR AND GPIO CONFIGURATION
- Plug the movement sensor on the Jack 35 GPIO of the device with an appropriate connector
- Read and apply the configuration-by-script application note to configure as input the GPIO Jack 35 of the media player
- For example: setJackGPIO(false, "in", 100000000); // Jack GPIO : Input, Debouncing 100ms
- The rising and falling edges for detection can be inverted using this same command