How to view video in asp.net c#
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jayraj ChhayaRank #304 · 8.2K reputationPosted May 21, 2024, 3:18 AM EDT
To view videos in ASP.NET using C#, you can utilize HTML5 video tags within your ASPX pages.
Your browser does not support the video tag.The
videotag is used to display the video file "movie.mp4" with playback controls. You can adjust the width, height, and video file source as needed. Additionally, ensure that the video file path is correct and accessible within your project structure.Abhishek ChadhaRank #402 · 6.2K reputationPosted May 21, 2024, 3:34 AM EDT
Here's an example of how your ASP.NET web page might look:
Video Player Video Player Your browser does not support the video tag.In this example:
srcattribute of thetag specifies the path to the video file.typeattribute specifies the MIME type of the video file. For MP4 files, it's usuallyvideo/mp4.widthandheightattributes define the dimensions of the video player.controlsattribute adds playback controls (play, pause, volume, etc.) to the video player.tag.Make sure the path specified in the
srcattribute of thetag is correct relative to your ASP.NET application's root directory.