Asp.Net Core Web App Play and download Video from Disk

Moloy Adhikary 1 Reputation point
2021-09-05T08:49:13.36+00:00

I am having a scenario here. I have to build an asp.net core web application from where I have to browse drive and directories (where hosted: windows) and list the available video files. This portion working perfectly.

Now I have to do two things with those video files:

1. Need to download files (working except the size is < 2 GB)
2. Need to play the video on the page whatever the format and size is.

Asking for your helps. Thanks in advance.

Developer technologies | ASP.NET | ASP.NET Core
Windows for business | Windows Server | User experience | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,926 Reputation points
    2021-09-06T13:10:20.763+00:00

    Hi @Moloy Adhikary

    There are lots of formats for video files, and each format typically requires a different player and a different way to configure the player. In ASP.NET Razor pages, you can play a video in a web page using the Video helper. To play the video on the page you can try out the below methods
    https://learn.microsoft.com/en-us/aspnet/web-pages/overview/ui-layouts-and-themes/10-working-with-video

    To download files you can use the WebClient.DownloadFile Method
    https://learn.microsoft.com/en-us/dotnet/api/system.net.webclient.downloadfile?view=net-5.0

    Hope this Answers all your queries , if not please do repost back .
    If an Answer is helpful, please click "Accept Answer" and upvote it : )

    0 comments No comments

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.