This folder contains a Puppeteer script that performs automated video playback. It controls a headless Chromium browser, connects to a specified NDN router, and plays the specified video.
To setup as Node.js application:
- Follow NDNts-video build instruction to compile a production site in
../public
. - Run
corepack pnpm install
in this directory to install dependencies. - You can run this script with
corepack pnpm -s start
followed by command line flags.
To setup as Docker container image:
- Run
docker build -t localhost/ndnts-video-pptr . -f pptr/Dockerfile
in parent directory. - You can run this script with
docker run --rm --cap-add=SYS_ADMIN localhost/ndnts-video-pptr
followed by command line flags.
--router
specifies a preferred NDN router.
It can be either a WebSocket gateway or an HTTP/3 WebTransport gateway.
If this is omitted or the router is unreachable, the webapp will query NDN-FCH 2021 API and connect to a nearby router.
It is not recommended to rely on NDN-FCH for the purpose of automated testing.
--video
specifies the NDN name of the video metadata.
The video must be retrievable through the specified NDN router.
Most published videos are encoded with either H264 or VP9 codec.
Due to the limitation of Chromium browser installed by Puppeteer, this script can only playback VP9 encoded videos.
--timeout
specifies the playback timeout in milliseconds.
The script stops the browser and exits either 8 seconds after the playback completion or the timeout duration has elapsed, whichever occurs earlier.
Browser console messages are redirected to stdout.
Messages starting with BEACON
reflect playback status and file fetching statistics.
Look at connect.js BeaconData
typedef for its semantics.