Click here to Skip to main content
14,580,280 members
Rate this:
Please Sign up or sign in to vote.
See more:
HI my requirement is to display the mp4 and pptx files in webpage ...i am using the below code but its displaying only pdf,img,mp3 files ...any helps please

What I have tried:

in .aspx:

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

<asp:Literal ID="lit1" runat="server" >

in aspx.cs:

protected void Page_Load(object sender, EventArgs e)
var directory = new DirectoryInfo(Server.MapPath("~/Files/"));
var myFile = directory.GetFiles()
.OrderByDescending(f => f.LastWriteTime)
string strurl = "<iframe width='100%' height='400' scrolling='auto' src='/Files/" + myFile.ToString() + "'></iframe>";

lit1.Text = strurl;

Updated 16-May-16 1:38am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You can try html5 video player.

refer HTML5 Video

Let me know if you found the solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100