Giter VIP home page Giter VIP logo

push-button-media's Introduction

Push Button Media

This lets you press an Amazon IoT Button to play/display a random video/image. After that finishes, it loops through a collection of other videos.

The idea is that you have a collection of short 'prompt' videos, which are suggesting to the viewer to press the button. When the button is pressed, the 'prompt' video is closed and a random video/image is selected from a different collection.

This project was built for The Legible Bodies to use for their closing reception in the Mill Arts Project space.

Requirements

Setup

  • add videos to content_waiting
    • these will play in a random loop while we wait for someone to press the button
  • add videos/images to content_button
    • this is the content that will be used when someone presses the button
    • any video that is playable by QuickTime and jpg/png files will work
  • edit content_waiting_playlist.m3u to be a playlist of the content_waiting videos
    • you can gather all the content_waiting videos in VLC and choose 'Save Playlist...'
  • set up your Amazon IoT Button
  • cd endpoint && npm install
  • configure VLC to default to fullscreen with as little UI as possible and play infinitely
    • choose 'Repeat All' in the 'Playback' menu
    • choose 'Random' in the 'Playback' menu
    • open Preferences
      • select 'Interface' and un-check the box for 'Show Fullscreen Controller'
      • select 'Video' and check the box for 'Fullscreen'
      • select 'Subtitles / OSD' and un-check the box for 'Enable OSD'

Run

  • start the endpoint in one terminal: cd endpoint; node index.js
  • start ngrok in another terminal: ngrok http 3000
  • edit the endpointUrl variable in button/index.js to your http ngrok url
  • copy the code in button/index.js to your AWSIoTButton Amazon Lambda function
  • push the Amazon IoT Button to display media
    • the transition could be chunky the first time that VLC is run, but subsequent runs should be ok

What's Happening

  • the button triggers the Amazon Lambda function
  • the Amazon Lambda function makes a call to the node endpoint via the ngrok url
  • the node endpoint checks if Preview or QuickTime is running
    • if Preview or QuickTime is running
      • it does nothing and exits immediately because something is already playing/being shown
    • if Preview or QuickTime is not running
      • it runs the main.sh script
        • this plays a video or shows an image for 5 seconds
        • then it quits QuickTime/Preview
        • and finally it plays the infinite playlist in VLC

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.