question

moloyadhikary avatar image
0 Votes"
moloyadhikary asked LimitlessTechnology-2700 answered

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

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.

windows-serverdotnet-aspnet-core-mvc
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @moloyadhikary , I suggest you can use third-party media services to store and read videos. For example, use Azure Media Service.



0 Votes 0 ·

1 Answer

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hi @moloyadhikary

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://docs.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://docs.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 : )

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.