Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 942957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:21:21+00:00 2026-05-15T22:21:21+00:00

Here I am new to Silverlight and I have to implement a video player

  • 0

Here I am new to Silverlight and I have to implement a video player in asp.net with C# , I found some article about video player and media player. I am implementing according the tutorials but the that is not working here I am sending my code please find out what is problem. Tell me what is the difference between media element and media player in Silverlight?

here is the code of .aspx page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register Assembly="System.Web.Silverlight"  Namespace="System.Web.UI.SilverlightControls" TagPrefix="asp" %>

<%@ Register assembly="AjaxControlToolkit" amespace="AjaxControlToolkit"  tagprefix="cc1" %>    


<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>SILVERLIGHT MEDIA PLAYER | DEMO</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div id="xx" runat="server"></div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />    

            <div>
                <div style="float:left">
                    <asp:DropDownList ID="cmbSkins" runat="server" 
                    onselectedindexchanged="cmbSkins_SelectedIndexChanged" />
                </div>               
                <div><h3>SELECT PLAYER STYLE</h3></div>
            </div>

            <asp:MediaPlayer ID="MediaPlayer1" runat="server" 
                Width="600px" 
                Height="440px"
                PlaceholderSource="http://www.webinfocentral.com/VIDEO/JJ2008/ImgMain.JPG">                  
            </asp:MediaPlayer>
            <hr />            
            <hr />    
        </form>
    </body>
</html>

and this the code behind page:

public partial class _Default : System.Web.UI.Page
{
protected enum MediaPlayerSkins
{
    AudioGray,
    Basic,
    Classic,
    Console,
    Expression,
    Futuristic,
    Professional,
    Simple
}   

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        MediaPlayer1.AutoPlay = true;
        MediaPlayer1.ScaleMode = System.Web.UI.SilverlightControls.ScaleMode.Zoom;

        cmbSkins.Items.Add(MediaPlayerSkins.Classic.ToString());
        cmbSkins.Items.Add(MediaPlayerSkins.Console.ToString());
        cmbSkins.Items.Add(MediaPlayerSkins.Expression.ToString());
        cmbSkins.Items.Add(MediaPlayerSkins.Futuristic.ToString());
        cmbSkins.Items.Add(MediaPlayerSkins.Professional.ToString());
        cmbSkins.Items.Add(MediaPlayerSkins.AudioGray.ToString());
        cmbSkins.Items.Add(MediaPlayerSkins.Simple.ToString());
        cmbSkins.AutoPostBack = true;
        cmbSkins.SelectedIndex = 4;

        MediaPlayer1.MediaSource = Server.MapPath("~/") + "Wildlife.wmv";
        xx.InnerHtml = Server.MapPath("~/") + "Wildlife.wmv";
        MediaPlayer1.MediaSkinSource = "~/MediaPlayerSkins/" + cmbSkins.SelectedValue + ".xaml";
    }
}


protected void cmbSkins_SelectedIndexChanged(object sender, EventArgs e)
{
    MediaPlayer1.MediaSkinSource = "~/MediaPlayerSkins/" + cmbSkins.SelectedValue + ".xaml";
}

}

I don’t know anything about Silverlight and this is done using a article, I only changed the source of player nothing else and this is not working.

One question is arising in my mind that which is the best for playing video flash player or this one while we have a low bandwidth internet connection. Please tell me some useful solution?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:21:21+00:00Added an answer on May 15, 2026 at 10:21 pm

    guys i found why it was not working i am missing the proper source path that should be “~/MediaFile.wmv” instead of server.mappath(….).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am totally new to HTML5. Previously I have developed Silverlight and ASP .Net
I am new to WP7 programming and I have been following this tutorial http://weblogs.asp.net/scottgu/archive/2010/03/18/building-a-windows-phone-7-twitter-application-using-silverlight.aspx
am new here. i have a slight problem; PLease look at the following code
I'm new here and have a problem. I am having to pick up C#
I'm new here and I have a problem with the jQuery's function - animate
I'm new here to stackoverflow, so bear with me. I have a book that
I'm new here and I hope anyonte can help me. I have WCF Service
I'm new here and I hope I could get some help with an Android
I'm new here. I thought I could ask for some help here on my
I'm new to Silverlight, so I don't have a complete grasp of all the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.