Tells streaming clients from where they shall retrieve video stream segments.
The Train Resolver service is part of the platform for media caching on trains. The Train Resolver is needed by streaming client based on the ARD-Player with the MCDN Add-on. When the user requests the playback of a video the player will first query a resolution service for which host it shall address to retrieve the respective stream segments. The DNS on trains equipped with our system will be configured to redirect these requests to the Train Resolver. The Train Resolver will tell the player to request all video segments from the local cache on the train.
The service consits of an HTTP interface implemented in app.controller.ts
which routes to a simple provider implemented in app.service.ts
. The provder generates the body of the default repsonse of the HTTP interface, which will look like in this listing:
{
"cdns": [
{
"hostname": "http://<<original-CDN-hostname>>.cache.cache:8080",
"weight": 1
}
]
}
Note: Typically you would use the up.sh
script from the Platform project to install, build and run this service as part of a composite of docker services. Read on if you intend to run the service directly on your host system.
Prerequestits: Following software needs to be installed on your host machine in order to execute the subsequent steps.
First, git clone
this project and change into its root directory. Than run the following command to install its dependencies:
$ npm install
You can than run the service in three different modes.
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
With following command you can build a docker image for this service. But again, typically you use the startup script up.sh
of the Platform project to do the job.
$ docker build -t 5gv-train-resolver .