On This Page

Related Pages

Video

Control video play/pause, speed, and time position

The Video widget plays an HTML5 video file, and can control the play/pause state, playback speed, and time position of the video. It also has options to loop the video forever, and to play continuously regardless of the play/pause input value.


Instructions

1 Set Video File

In the more tab, set the file name (.mp4) that’s local on your device. The files are located in the NTK application directory:

App: NTK.app>Contents>app>dist>assets>video>nyc_people.mp4 (on Mac, open app with right/control-click, Show Package Contents)

Command Line: NTKserver>assets>video>nyc_people.mp4

Place your own files in this directory, and put the filename in the widget

ntk_app

2 Connect

Connect input widgets to:

  1. Play – If the value is less than 500, the audio will be paused, if 500 or more the audio will play.
  2. Speed – 100 is normal speed and zero is stopped. The values accepted depend in the browser – negative values may allow reverse audio in some cases. Numbers higher than 100 play the video faster than normal.
  3. Time – Scrub the video in real time. Values start at zero for the beginning of the file, and each integer is equal to a second. For example, the default ball.mp4 file is about 14 seconds long. So an input to time will position the video half way through. Fractional numbers are okay, and will position the video to sub-second locations.
  4. Opacity – The input value sets the opacity of the video, with 0 being completely transparent, and 100 being fully opaque.

3 Adjust

More tab

  • Loop – If you check the loop checkbox, the video will loop forever when the widget is in Play mode.
  • Continuous – If you check the continuous checkbox, the video will always play, regardless of the input value sent to the play/pause input at the top left. This is useful if you want the video file to play all the time.
  • Threshold – Above this amount as input in the top, play/pause input with start playback. Below this number will pause the video.
  • Width – Sets the size of the video, keeping the height proportional to the width set here.
  • Video File – You can replace the default video file by putting the location of your .mp4 file in this box.
NETLabTK - Tangible IoT