473,834 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Silverlight Mediaelement to play Video

53 New Member
Hi,

I am new to Silverlight application.I want to display video using Mediaelement tag and I used the below code to play video.
Expand|Select|Wrap|Line Numbers
  1. <Canvas>
  2.            <MediaElement x:Name="mPlayer" Width="640" Height="480" Source="a_video.avi"/>
  3.  
  4.             <Button x:Name="bPlay" Background="Green" Width="100" Height="45" Canvas.Left="8" Canvas.Top="497" Content="Play" />
  5.             <Button x:Name="bPause" Background="Yellow" Width="100" Height="45" Canvas.Left="112" Canvas.Top="497" Content="Pause"/>
  6.             <Button x:Name="bStop" Background="Red" Width="100" Height="45" Canvas.Left="216" Canvas.Top="497" Content="Stop"/>            
  7.         </Canvas>
And I placed that video file in Xaml folder but when i run the application i am not getting any results to play video. The steps I followed are correct or anything missed.
Please help me how to play video using silverlight mediaelement and mention the steps to play video and where i have to place video to use it in mediaelement source property.

Thanks in advance
Pavani
Mar 2 '09 #1
3 8660
Frinavale
9,735 Recognized Expert Moderator Expert
Have you checked out this video tutorial? I think it could help you.
Mar 2 '09 #2
dotneto
36 New Member
Please read this or watch the proposed video.

I don't think media element supports avi files.
Mar 9 '09 #3
jamalag
1 New Member
I notice that this is an old post, but at the time of your posting it may not have been possible to play AVI files.

But since Silverlight 4 (using media element and mediastreamsour ce) and the just released Silverlight 5 RC (using P/Invoke), you can play AVI files.

But please note that the code will only run on Windows platform.

check out my how-to articles at codeproject.com :

Silverlight 4: http://www.codeproject.com/KB/silver...eamSource.aspx

Silverlight 5 RC: http://www.codeproject.com/KB/silver...mSourceS5.aspx

good luck.
Sep 13 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1419
by: Piotrekk | last post by:
Hi I have a little problem. Having small mavie.avi ( divx compression ) i've noticed that candle fire on movie.avi in windows media player is displayed properly but in my mediaelement candle fire in focal point is black. Same problem is few seconds later with regular lamp ( only the little elements on lamp ). I have tried different codecs. Really don't know what could be the problem. The video also seem to have small lags.
0
325
by: Piotrekk | last post by:
Hi I have a little problem. Having small mavie.avi ( divx compression ) i've noticed that candle fire on movie.avi in windows media player is displayed properly but in my mediaelement candle fire in focal point is black. Sometimes I see such a problems when I use wrong codecs to decode the movie. Same problem is few seconds later with regular lamp ( only the little elements on lamp ). I have tried different codecs so i think that's not...
1
3694
by: cbmeeks | last post by:
I just want to play some m4a files I have. Some, are DRM-locked down crap that I got from iTunes (never again will I buy DRM music). But, I have some .m4a files that are DRM free (from Amazon). They play just fine in Windows Media Player 11 and even my Sony PSP. I have created a MediaElement control in a WPF app and when I put the source as a mp3 file, it works. But when I switch to a m4a file, I get nothing.
0
2381
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
I have a web site under .NET 2.0 that renders videos using the Silverlight media player. The <asp:MediaPlayercontrol only works on .NET 3.5, but I managed to get things working under .NET 2.0 by working with the javascript rather than the server control. The web page looks like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="video5.aspx.cs" Inherits="GalleryServerPro.Web.video5" %>
1
2866
by: Faisal Shafiq | last post by:
I want to upload a file direct to the Silverlight Streaming Service from a Web Client such as silverlight application. As per our product requirement we want to upload a .WMV file directly from silverlight client to Silverlight streaming service. I tried to user WebClient and HttpWebRequest for that purpose but, unfortunately I can found the way to do so. There are some problems with both classes. 1. There is no property of get...
0
3053
by: Petra | last post by:
Hello, I have a strange problem with Pause and Resume using a MediaElement.Clock. I implemented a MediaElement to display a video and implemented a GUI around it to make the typical Start/Stop/Pause/Resume functionality available. For one particular video I work with the clock.Controller.Resume()
3
689
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
Note: My apologies for repeating this post from last week, but my nospam alias and profile account were incorrect. I think I have fixed this, so hopefully this post will trigger MS into a response per their MSDN policy. -------------------- I have a web site under .NET 2.0 that renders videos using the Silverlight media player. The web page looks like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="video2.aspx.cs"
13
4031
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
This is a follow-up to my post "Silverlight video doesn't work when file is streamed from handler in ASP.net" at http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.framework.aspnet&mid=e9a38d03-83a8-41fc-8950-5ee60d2a18a5. I have a web site under .NET 2.0 that renders videos using the Silverlight media player. When I stream the video file (.wmv) to the browser via a hard-coded link to the file,...
0
9797
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9644
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10793
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10219
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5626
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5793
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3081
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.