Click here to Skip to main content
15,905,238 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am using this code to run a video file in my asp.net application:

<asp:MediaPlayer ID="MediaPlayer1" runat="server" Height="240px" Width="320px"
MediaSkinSource="~/skins/AudioGray.xaml" MediaSource="~/files/Butterfly.wmv"
Volume="0.9">
</asp:MediaPlayer>


It works fine, but I need to show a small video-window and when somebody clicks on the play-icon on this window, then the size of screen must be adjusted before the video starts.
Like we can see that in facebook....
How can I do this?

Please tell me.
Posted
Updated 5-Apr-11 21:20pm
v2

1 solution

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>SilverLight 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";
    }
}



hope it will help you..
 
Share this answer
 

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