Private video using thumbnails prevents video access

Following this tutorial for private videos will result in receiving tokenized assets from the video api:

 "assets": {
        "iframe": "<iframe src=\"https://embed.api.video/vod/vitkytkieTnEvUjKE0VQpd2?token=4a9a10fd-6c03-457f-a6c5-6d73f2c9fa85\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
        "player": "https://embed.api.video/vod/vitkytkieTnEvUjKE0VQpd2?token=4a9a10fd-6c03-457f-a6c5-6d73f2c9fa85",
        "hls": "https://cdn.api.video/vod/vitkytkieTnEvUjKE0VQpd2/token/4a9a10fd-6c03-457f-a6c5-6d73f2c9fa85/hls/manifest.m3u8",
        "thumbnail": "https://cdn.api.video/vod/vitkytkieTnEvUjKE0VQpd2/token/4a9a10fd-6c03-457f-a6c5-6d73f2c9fa85/thumbnail.jpg",
        "mp4": "https://cdn.api.video/vod/vitkytkieTnEvUjKE0VQpd2/token/4a9a10fd-6c03-457f-a6c5-6d73f2c9fa85/mp4/1080/source.mp4"
    }

However, when it comes to using multiple of these assets what is the recommended approach? I am using these assets in a front-end react application. For example, if I try use the thumbnail image in my page followed by the player asset. Visiting the thumbnail address uses up the one-use token. So then trying to access the player asset results in not-found. There must be a better way than generating a new token each time I want to use an asset?

1 Like

Had the same issue. Did not manage to solve it via API, so had to make my own image cache CDN which downloads images from api.video and uploads them to my own CDN server for later serving.

This issue really should be addressed by api.video team :slight_smile: