×

First time here?

You are looking at the most recent posts. You may also want to check out older archives. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS or email. Thank you for visiting!

When using media with Silverlight there are a few things that you should be aware of.  First, ensure that the media you are planning on using conforms to the VC-1 specification.  Your media files just need to then be accessible via streaming or http-based access for progressive downloads.

The media files for progressive downloads can be anywhere: any web server, Amazon S3 storage, some HttpHandler, whatever – as long as they can be served.

Streaming media is supported via Windows Media Services.  If you haven’t set this up before, there are a few things to note with regard to Silverlight and streaming content.  Most typical default setups of Windows Media streaming uses Real Time Streaming Protocol (RTSP).  It’s actually important to note that while RTSP is the visible configuration, it is actually the Real-time Transport Protocol that is responsible for delivering the bits of audio/video.  All of this might not matter to you, but cache it away for later if you wish.

For setting up streaming services, I recommend using Windows Media Services 2008, which is a free add-on for Windows Server 2008 systems.  After installing this add-on, you’ll have the ability to set up publishing points and host streams of playlists or single files.  What I wanted to point out is one of the common gotchas with Silverlight and streaming in the current versions.

After installing the services, if you start the control panel and highlight the server you will see some options.  Looking at the Properties tab you will see more options, and specifically I wanted to call attention to the ‘Control Protocol’ option.  By default the only enabled option is RTSP.  So basically your streams would respond to a mms://foo link for you and open in Windows Media Player or something that plays back that media.

The problem is that a few people have emailed me about why certain streams don’t work, etc.  Some are for various resons, but some are because of this problem here.  I get a lot of ‘my stream plays in Windows Media Player but not in Silverlight’ questions.  Assuming all other factors are correct (see footnote here as well), the problem is likely that you don’t have HTTP-based streaming enabled.  Silverlight basically looks at the mms:// URI and translates that to get the stream over HTTP instead as that is the method supported in current versions.  You can see this if you put a sniffer on your web application to monitor the requests.  To fix this all you have to do is enable the HTTP control protocol on your server.  Keep in mind that if you are using a single server for multiple scenarios, the default port 80 might already be taken by IIS.  Right click on the HTTP control protocol and choose properties, then choose the IP addresses and/or the port you want it to operate on.  Save those settings and then enable the protocol.

By doing this your streaming server will now also stream over HTTP as well as RTSP, thus enabling different scenarios, but specifically allowing you to use Silverlight to host your streaming content.  Windows Media Services is a great tool to host streaming content and is pretty fun to mess around with (as well as intuitive to setup new streams) creating new publishing points for media.

Other Streaming Issues

One of the other most common issues I see in my inbox is ‘my stream doesn’t work and yes it is streamed over HTTP.’  The most common problem with this is that your page hosting the Silverlight content is likely being viewed over a file:// protocol scheme and your MediaElement has an http:// scheme.  This is known as cross-scheme and is not allowed in Silverlight.  Open the page under an HTTP context and it should render fine as long as it is the same protocol.

Have fun playing with this and hope this helps!


This work is licensed under a Creative Commons Attribution By license.


Gravatar
5/29/2008 12:46 AM | # re: Streaming media in Windows Server for Silverlight
How about restrict the windows media services to stream from a specific domain or ip address so the video wont be used on any other sites. I noticed that people would be using the wmv on their own to consume our bandwidth for nothing. Is it available with new version not 2003?
5/29/2008 7:39 AM | # re: Streaming media in Windows Server for Silverlight
@jed: Good question...I'm not the streaming services wizard, but it looks like there are properties to add more content protection in the manner you suggest. This would be a good question for the forums.
7/18/2008 5:27 AM | # re: Streaming media in Windows Server for Silverlight
I have read several your articls about silverlight. all of them are pratical and useful. I am interesting on this article because I want to build a demo video sites which can stream a live video and can support user interactive to request more information about this video.

I used Windows media service 2008 to build the video server. it works fine now. (you may try mms://dingluolivevideo.no-ip.biz). My question is how do I use this video server to support my website or how to combine the silverlight apps with this video server?

I read your article about silverlight streaming. That likes use windows live to support the website live stream. Can I do the same thing but use my video server?

I have tried to place the link of my video server publish point in the silverlight apps "Cheating silverlight apps" it works one time then stoped. May be some settings I don't know.

I still cannot get how to hook the silverlight with windows media server
Most articles are using embeded video files or use windows live to stream videos.

Your this articles is I am expecting to solve my question but I cannot see more details and practice. I hope you can add some more details in your this articls

You did very great job on this field!
8/28/2008 11:54 PM | # re: Streaming media in Windows Server for Silverlight
Hi Tim,

Thx for your past Email. Mi site www.tekmo.com.ec is running again.

I was the following problem: I have been using asmx web services, when i did to declare a soapclien call to a web service... my web.config was modified by VS IDE... The System.Web.DataExtensions 3.5... was deleted an replaced by 2.0... then... my site DIED !!... but, i got to fix the problem and mi site is running againg.

NOW !!... man, do you know some method to play LIVE STREAM with MediaElement... i'm trying but don't work... Note this:
This streaming port:
"mms://scfire-ntc-aa03.stream.aol.com:80/stream/1025"
Windows Media Player can play this port... but MediaElement don't... MediaElement can play the first chunk... and stop playing. WHY !!...

Hey bro... thx for your help... and visit my site... www.tekmo.com.ec (Radio Section)...
9/5/2008 2:45 PM | # re: Streaming media in Windows Server for Silverlight
Hi, I have a problem getting media to Stream from my Server, Iam using Windows Media Server 2008 with Windows Media Services Installed. I have placed the video to be streamed in an embedded html file in my Web Sites Directory but I get an Error Message saying that Media Player cant connect to the Streaming Media when someone tries to access it over the Internet.

I have the HTTP Protocol Enabled on my Server on a different port other that 80 but still no success. Can you please tell me what am I doing wrong?
9/7/2008 2:41 PM | # re: Streaming media in Windows Server for Silverlight
Lor-ron: The media file has to be configured as a stream in the Windows Media Server configuration. If you are copying the URL generated exactly, it is porbably using an internal IP address and that is why the users cannot see it from the internet.
9/17/2008 1:30 PM | # re: Streaming media in Windows Server for Silverlight
Hello:

I have a problem when use Windows media services 2008 with mediaelemente and Silverlight 2. I use Blend 2.5 June 2008 Preview to create silverlight 2 project. When I copy the publishing point in the source property of mediaelement, then Blend crash!

But when I do the same test with Silverlight 1 the project works fine.

The http protocol

I hope you can help me.

Thanks!
10/9/2008 3:31 AM | # re: Streaming media in Windows Server for Silverlight
Hi
i would like to stream my videos thruw silverligt and it works fine BUT...

how do i get it to work with DRM ?

is it only Play Ready that works with ??

i use windows media player today with DRM 9 ...

but i dont want to invest 30 000 dollers for Play Ready ..

10/9/2008 9:44 AM | # re: Streaming media in Windows Server for Silverlight
Daniel: you will still need PlayReady to issue the license, but your WMDRM stuff will be playable.
10/9/2008 11:46 PM | # re: Streaming media in Windows Server for Silverlight
Hi,

I am using on demand publishing point to play a file.
my source contains mms://ipaddress:portno/publishingpointname/dp.wsx?file=fileid

by using this,I am not able to forward the video on silverlight media element and windows media player

if i remove the port no it works fine on windows media player(i can forward the video)
but silverlight does play this video

Pls help
10/10/2008 2:53 AM | # re: Streaming media in Windows Server for Silverlight
Why do i need play ready??
10/10/2008 9:25 AM | # re: Streaming media in Windows Server for Silverlight
Ajay: your streaming server will still need to stream over HTTP -- Silverlight does not support RTSP protocol (which MMS uses). See this article for ensuring your settings are correct.

Daniel: PlayReady will serve/verify the license.
10/12/2008 11:54 PM | # re: Streaming media in Windows Server for Silverlight
ok,

I have changed. But problem is if i use port no,i am not able to forward the video in windows media player and silverlight player.


Thanks!
10/22/2008 1:36 PM | # re: Streaming media in Windows Server for Silverlight
Hi Tim,
Thanks for the article.
I was wondering if the protocol you are referring to when you say "streaming over HTTP" is Windows Media HTTP Streaming Protocol (MS-WMSP).

Thanks for your answer!
Gravatar
11/4/2008 12:18 AM | # re: Streaming media in Windows Server for Silverlight
It may help readers if you provide a Silverlight code snippet showing the way the source is entered.
11/4/2008 5:58 AM | # re: Streaming media in Windows Server for Silverlight
Cagdas: I'm not a streaming server expert, but enabling the WM server to stream over HTTP is how Silverlight can consume it today (we don't support RTSP).

Rob: The code snipped would be as simple as setting the MediaElement.Source to your http-based stream URI.
11/18/2008 2:24 AM | # re: Streaming media in Windows Server for Silverlight
Hi Tim,
My SL player is not able to play all the WMV video located on the same domain. I'm using SL 2.0 and the video are located on wm.microsoft.com which is a streaming server.

Thanks for your prompt reply,
Fadi
11/18/2008 2:27 AM | # re: Streaming media in Windows Server for Silverlight
Fadi: Is all the media VC-1 encoded? Do you have a sample of one that will not play?
11/18/2008 4:09 AM | # re: Streaming media in Windows Server for Silverlight
For instance this one was player well with Windows Media Player but never with my SL Player

mms://wm.microsoft.com/ms/Italy/MSDN/agile1.wmv

but this one works was played with my SL player mms://wm.microsoft.com/ms/Italy/technet/comdays/3__9_luglio_PBrambati_part_3.wmv
11/18/2008 9:41 AM | # re: Streaming media in Windows Server for Silverlight
Fadi: The one that doesn't work is using WMA Voice codec which is not supported.
11/18/2008 1:52 PM | # re: Streaming media in Windows Server for Silverlight
Thanks Tim for your feedback. May I know how did you know it is WMA Voice Codec for my own reference?

Fadi
11/18/2008 2:25 PM | # re: Streaming media in Windows Server for Silverlight
Fadi: when you view it in Windows Media Player look at the properties and you will see the audio/video codec information.
11/18/2008 2:53 PM | # re: Streaming media in Windows Server for Silverlight
My bad, you're totaly right... I didn't pay attention to Audio Codec as I was interested to know the video codec if it was supported silverlight. Thanks alot, you helped alot
12/1/2008 11:53 AM | # re: Streaming media in Windows Server for Silverlight
Hi,

I am having problems streaming to a media element from a windows media server. Below are the details; any help / direction would be greatly appreciated:

-> Using SL 2 final release
-> Using Expression blend and SL template to create a valid VC-1 file
-> Media server is in our lab under a different domain then development system
-> Media server is http enabled with a different port (1138)
-> On demand publishing point has been created; this can be accessed from dev system via browser with no errors
-> When accessing in SL app (via the MediaFailed event) get the error: "AG_E_NETWORK_ERROR"
12/30/2008 10:57 AM | # re: Streaming media in Windows Server for Silverlight
Hi;

I'm having an issue with Streaming Services & Silverlight. I have followed your instructions on how to configure Media Services and prepared publishing points. I can access the media via MS Media Player using mms URL via the LAN, but cannot access the same url via WAN. I have turned off all firewalls and checked all proxy's that might be getting in the way. The Windows Server is connected via a router and I have opened the ports (on the router) that were registered in Media Services. Is there something I'm missing here?

Also; using a Silverlight MediaElement control; I cannot access any streamed content; which from what I've read should be possible once the HTTP protocol in Media Services had been setup; I keep getting the AG_E_NETWORK_ERROR.

Any help would be greatly appreciated.

Peter
1/22/2009 9:29 AM | # re: Streaming media in Windows Server for Silverlight
Hi there,

Facing the same issue as last commenter. The videos are NTFS protected, and accordingly the NTFS authentication plugin is being used. When using windows media player it prompts for login credentials. How do we need to deal with the challenge to the mediaElement in Silverlight? It only throws the AG_E_NETWORK_ERROR.

Cheers,

Suly
1/22/2009 10:54 AM | # re: Streaming media in Windows Server for Silverlight
ZzZoel the hosting page for the Silverlight application would need to provide the authentication (and the same auth required for the media). At this time Silverlight will not prompt for credentials.
1/23/2009 9:22 AM | # re: Streaming media in Windows Server for Silverlight
Thanks Tim, but does this mean that crossdomain streaming video using Windows Media Service as the streaming server (with NTFS authorization) isn't supported by Silverlight at this moment?
1/23/2009 9:32 AM | # re: Streaming media in Windows Server for Silverlight
If you rely on authentication prompts in the browser for the media asset (which is different authentication than the hosting page), yes it wouldn't be supported right now.
7/5/2009 5:38 PM | # re: Streaming media in Windows Server for Silverlight
Can i stream a video connected on 20 Mbps Point to point ethernet link between India and NY.
I tried doing so and i get buffering on the link.. the latency is constant of 312 ms..

please help.
Gravatar
8/19/2009 2:22 PM | # re: Streaming media in Windows Server for Silverlight
Hi Tim, thanks for your interesting articles on Silverlight.
I have streamed successfully different movies to the silverlight streaming site. I can download them all, so I know it was a success.
However only some of them work when used as a source in the Mediaplayer. Apparently, I only get them to work when in 4:3, not in 16:9 format, so my video is kinda out of proportion. 16:9 always gives the ag_e_network error...
(I converted my high defintion movies to wmv, avi, mp4, ... with Pinnacle Studio 11)
Is there a way I can solve this, my site enables users to upload videos and I don't want them to be limited to 4:3 movies
9/16/2009 2:22 PM | # Streaming media in Windows Server
Hello Tim, we are on a mission. we are trying to setup a video conference for schools in Kenya. I setting up a pilot project and using Windows media encoder and Windows Server 2008. I see that you heard this a lot, that "I can stream live broadcast on our LAN but not over the Internet". I been working on this problem for weeks. The HTTP and RTSP in enabled, HTTP on port 80. I have IIS setup on port 81 I can see my stream in the media player 11 on network but not over the Internet. I opened the fire walls on the Verizon modem and port forwarding for port 81 and 554. The encoder is set up to push. when I use the ip address 173.67.62.113:81 on any Vista pc in our LAN it streams (XP is a story for another day). When I put mms://SpotBeam/PublishingPoint3 in the media player on the server pc it streams. I tried the various IP addresses in the server protocol properties. Please give us more insight. A lot of people are counting on us. Thanks, Preston
9/26/2010 4:35 AM | # re: Streaming media in Windows Server for Silverlight
Hi Tim,
I scan through the threads but have not seen any similiar to my problem.
- I have one web application (domain A) using a silverlight media player (stored in domain B) and the media player will plays a movie (stored in domain C). Surely, the movie is playable by Silverlight (i've already checked in silverlight app).
- I were able to load the silverlight media player crossdomain but the silverlight does not play the movie. There was an javascript error that: ... can not create an absolute URI .... Because i passed the video source paramater like http://www.domainC.com/silverlight/movie.wmv. When i directly accessed the movie, the movie is played in Window Media Player.
- Everything works well if i put them all in 1 domain (web application, silverlight media player and the movie), and i am currently using Linux - web server.
Could you please help me to figure it out. Many thanks Tim
1/17/2011 11:31 AM | # re: Streaming media in Windows Server for Silverlight
Greetings!

I'm using Windows Media Services on a Windows 2008 Server to create an HTTPS stream. I'm using Silverlight 4 MediaElement and everything is working great!

What I need to do now is get at the stream attributes so I can read the current track info - title, author, album, etc.

When getting a count of the attributes from the stream, I always get zero. I just can't find a way to get at the info. Obviously it's there... if you use an embedded Windows Media Player the info rotates in the status bar area of the player.

Anyone have any suggestions for fixing this? It's the last piece in a puzzle I've been working on, and I just can't find the one that fits.

Thanks.
3/2/2011 6:34 PM | # re: Streaming media in Windows Server for Silverlight
Hi Jim,


just wondering how you can use Windows Media Services to create HTTPS stream?

Cheers,
Ricky
3/19/2012 3:09 AM | # re: Streaming media in Windows Server for Silverlight
Hi Tim

I have configured window media server 2008 R2 and running on-demand video through it, the video plays well for few second and in the media player shows up 905K bits/sec optimized stream experience and after sometime video halt and gives the message SERVER IS SENDING TOO MUCH DATA CONNECTION HAS BEEN TERMINATED.

kindly help me to resolve this issue

Rohan Gaur
Network Engineer
GEU

 
Please add 2 and 3 and type the answer here:

DISCLAIMER:

The opinions/content expressed on this blog are provided "ASIS" with no warranties and are my own personal opinions/content (unless otherwise noted) and do not represent my employer's view in any way.