Link to home
Start Free TrialLog in
Avatar of Cartillo
CartilloFlag for Malaysia

asked on

Play Windows Media Player via Web Browser

Hi Experts,

I would like to request Experts help. By using Visual Web Developer 2010 Express how to create web page that allow export Windows media media (.wmv) and play the file via Media Player on the web page. Hope Experts will help.
SOLUTION
Avatar of SiddharthRout
SiddharthRout
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't get export, do you mean just save an embedded WMV file to their local system?

This will get you started in playing wmv files on your page:
http://msdn.microsoft.com/en-us/library/ms983653.aspx
Avatar of Cartillo

ASKER

Hi,

I’ve tried to run the code but shows error message at this line:

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

 as “Unexpected end of file looking for </asp:Content> tag”

Hoe to fix this error? Please assist. Attached the code that I’ve used for your kind perusal.

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
   <HTML>
<HEAD>
<TITLE>Embedded Windows Media Player 6.4 Control</TITLE>
</HEAD>
<BODY>
<OBJECT ID="MediaPlayer" WIDTH=320 HEIGHT=240
  CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"
  STANDBY="Loading Windows Media Player components..." 
  TYPE="application/x-oleobject"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">

  <PARAM name="autoStart" value="True">
  <PARAM name="filename" value="http://WebServer/MyFile.wvx">

<EMBED TYPE="application/x-mplayer2" 
    SRC="http://WebServer/MyFile.wvx"
    NAME="MediaPlayer"
    WIDTH=320
    HEIGHT=240>
  </EMBED>
</OBJECT>
<INPUT TYPE="BUTTON" NAME="BtnPlay" VALUE="Play" OnClick="StartMeUp()">
<INPUT TYPE="BUTTON" NAME="BtnStop" VALUE="Stop" OnClick="ShutMeDown()">

</BODY>
</HTML>

Open in new window

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi poweraddict,

Thanks for the code. I’m able to view the media player at design panel but not after I run the code (F5). Attached the print screen of it. Am I missing something?

myplayer.png
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
line 14 and line 17...

Upload a Media player file to your web server and put the URL to the file you just uploaded there, replacing http://WebServer/MyFile.wvx with your actualy file path
Hi poweraddict,

I’ve modified the file path with the actual (attached the modified script). Now I’m able to view the media player but can’t the file. How to fix this?

<PARAM name="autoStart" value="True">
  <PARAM name="filename" value="D:\Users\TST\Documents\Visual Studio 2010\Videos\MySite\MySite\Videos\ TestMedia.mp3">

<EMBED TYPE="application/x-mplayer2" 
    SRC="D:\Users\TST\Documents\Visual Studio 2010\Videos\MySite\MySite\Videos\ TestMedia.mp3"

Open in new window

Hi,

Managed to play the file from local path. Thanks for the guide.