Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
How to add Video in asp.net website
when user click on play button the video will start
Posted

hi,
you can use silver light control for this purpose..

XML
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="CS.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"
    TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>MediaPlayer Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:MediaPlayer ID="MediaPlayer1" runat="server" Height="240px" Width="320px"
            MediaSkinSource="~/skins/Professional.xaml" MediaSource="~/files/Butterfly.wmv"
            Volume="0.9">
        </asp:MediaPlayer>
    </div>
    </form>
</body>
</html>

c# code:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MediaPlayer1.MediaSource = "~/files/Butterfly.wmv";
    }
}

Look for more references:
plz i need some help[^]

A Simple Video Player Control [^]
Playing .wav files using C#[^]
How to Play Videos in .NET WinForm Application using Visual C# and DirectX?[^]

ASP.NET Embedded Video Player (YouTube™ API, C#)
video streaming with ASP.NET 2.0, IIS and HTTP handler
display video in .net ( C# with Asp.net )
Display videos in ASP.NET 2.0
 
Share this answer
 
Comments
PRAVEEN KUMAR 3-Dec-13 23:43pm    
hai guys need ur help.....i want to add online classes to my project.....so can u plz guide me ?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900