How to Play video in Asp.Net


In this article we will create video using html5 controls in asp.net webpage. In HTML5 controls provide video tag for play video in web form. Here we will create sample video in our webpage.

In your webpage create video tag for playing video like below.

<div>
   <video width="320" height="240" controls> 
      <source src="VideoFile/AIRLIFT.mp4" type="video/mp4"> 
      <source src="VideoFile/AIRLIFT.0gg" type="video/ogg"> 
      <track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English"> 
      <track src="subtitles_no.vtt" kind="subtitles" srclang="no" label="Norwegian"> 
   </video>
</div>

Here you can assign many controls for video controls as we known if we want to play audio as well in webpage. Run your browser and you can check your video in webpage.

Related Posts

Previous
Next Post »

Thanks for comments.....