[Amity File Repository] method 'fileUrlWithSize' is not working as expected

Hello, I was trying to get image thumbnail image for my video upload as per documentation.

I am using this code:

import { FileRepository } from '@amityco/ts-sdk';

function getVideoImageThumbnail() {
  const videoImageThumbnail = FileRepository.fileUrlWithSize('fileId', 'medium');

  return videoImageThumbnail;

When I provide fileId, method returns me the same fileId but with ?size= query appended to it.
I have checked source code and found this:

 * Allow to query a file url with a selected size
 * @param fileUrl the file Url to decorate
 * @param size one of the selected sizes
 * @returns the computed url for the selected size
export const fileUrlWithSize = (
  fileUrl: Amity.File['fileUrl'],
  size: 'small' | 'medium' | 'large' | 'full',
) => {
  return `${fileUrl}?size=${size}`;

Which is not the same as documentation suggests: accepts fileUrl instead of fileId

So, I am confused, what is the correct way to get thumbnail image?

@aleksey.k I’ll check with my team and get back to you as soon as possible.

1 Like

@aleksey.k Upon careful review with our dedicated team, it has come to our attention that the TS SDK does not yet support Video Thumbnail Images. Please know, we understand the importance of this feature and have formally requested its enhancement to better serve your needs.

1 Like

Got it, thank you! I think at least for now it would be nice to edit documentation to mention that it is currently not supported :slight_smile:

Thanks again and have a nice day!

1 Like