How to get thumbnail of Uploaded video in SharePoint online document library

SUMAN SUMAN 0 Reputation points
2023-06-06T10:20:59.49+00:00

I need one assistance where I upload video file in SPO custom document library. And later on I need to show only the thumbnail image of that video uploaded in custom UI page, and once user clicks on the thumbnail image it should play the video in other page using SPFX webpart.

I am able to get thumbnail image URL using MS Flow and set it as metadata data property for that document library item, it works fine but challenge is that the URL gets expired after some time as the thumbnail image URL contains access token as parameter.

Is there a way I can get the thumbnail image URL without access token and should not expire, which I can use while binding my custom SPFX webpart page?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,946 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 36,651 Reputation points Microsoft Vendor
    2023-06-07T03:13:48.9633333+00:00

    Hi @Suman Suman

    Currently there is no such method can get the thumbnail without accesstoken. You will need at least Files.Read permission to get the thumbnail.

    User's image

    You could use following api to retrieve the data

    GET /sites/{site-id}/drive/items/{item-id}/thumbnails

    Here is the document for more details

    https://learn.microsoft.com/en-us/graph/api/driveitem-list-thumbnails?view=graph-rest-1.0&tabs=powershell


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.