×

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!

i just put up another podcast video of how to "cheat" at creating a media player for silverlight.  have you been looking at some of these media experiences with all their fancy buttons and dvd player-type overlays, etc. but didn't want to take the time to code your own?  well, you don't have to :-) (man that sounds like an infomercial)

in this podcast i demonstrate using expression media encoder as a tool that will essentially generate stub code for you.  now keep in mind that expression media encoder itself generates some pretty kick arse templates that may perfectly suit you.  but perhaps you want a player that has more branding or a mix of certain elements, etc.  well, still use expression media encoder for this.  let it output the template and then just change the xaml! 

after you watch the podcast (subscribe links on the left panel of my web site if you are reading this in a reader), you'll hear me reference certain named elements for key function points of the player code that is generated.  i said i'd call them out here and that is what i'm doing :-).  these refer to the named elements in the xaml.  they could be canvas elements/groups or objects themselves like a rectangle.  as long as they are named specifically the code should work.  here's a list of the most popular that i've used and the heirarchy of any children objects they should have.  the names themselves are in bold, everything else is just description:

    • VideoWindow - this is the key element to display the media and must be a MediaElement node.  you can add clipping masks, etc. (as i show in the video), but you must have at least one MediaElement with this name
    • PlayPauseButton - the grouped canvas of your play and pause buttons.  named this way, the logic is already there to handle certain functions if you don't provide additional animations/timelines (like hide/show).
      • PlaySymbol - the symbol for the actual play button
      • PauseSymbol - the symbol for the actual pause button
      • PlayPauseButton_MouseEnter/MouseLeave/MouseDown - i'm only going to put this here once, but it applies to most of the other elements like StopButton and MuteButton, etc.  if you have a timeline named these, it will fire, if you don't some default actions will occur.
    • StopButton - the symbol for the actual stop button
    • Timeline - for displaying the playing progress of the media
      • TimeSliderDecoration - the element that shows the full progress
      • TimeSlider - the progress growing metere
      • TimeThumb - the arrow/object, etc. that shows the point in the progress and the user would drag to adjust the position
    • VolumeSlider - the elements making up the volume function
    • VolumeThumb - the arrow/object that shows the position of the current volume and the user would drag to adjust
    • VolumeUpButton/VolumeDownButton - if you were to use buttons for volume instead of a slider
    • MuteButton - self explanatory
    • CurrentTimeText - displays the time progress of the media element
    • ChapterArea - the area that would display the markers in the media file (dvd-style playback)
    • FullScreenArea - the full screen experience root node

there are, of course, more elements to mess with and i'd encourage you to look at one of the more advanced template outputs and start sniffing around to see what you find.  the cool thing is that you don't have to have all of them.  you'll notice in the podcast that i only put 3 elements on there and there are no errors.  the output code handles if an element is there or not for you.

i hope this helps get you started on creating great media experiences with silverlight and expression sooner!  if you want the sample player xaml that i used in the podcast, you can download that here.


9/1/2007 8:41 AM | # re: cheating at creating a silverlight media player
Great screencast, I've created and exported a video player from media encoder and am gonna start tweaking the player but was wondering how I could create an overlayed start button like you find on youtube and soapbox type videos. My player just auto starts, so if you posted it via a blog like I did on my live space and sl streaming, it just keeps playing everytime the page loads.
9/1/2007 10:11 AM | # re: cheating at creating a silverlight media player
josh:
on the MediaElement add the attribute AutoPlay="False" and it won't automatically play.
10/5/2007 12:52 PM | # re: cheating at creating a silverlight media player
Hi Tim
Great screen cast, Thanks.
Dou you know what it will take to make a custom media player, that plays a streamed vide file.
10/5/2007 1:23 PM | # re: cheating at creating a silverlight media player
jakob: the same media player will play streaming URLs as well -- just change the mediaUrl attribute in the javascript file to your URL for the stream (as long as the stream is a windows media stream)
10/7/2007 7:02 AM | # re: cheating at creating a silverlight media player
>on the MediaElement add the attribute AutoPlay="False" and it won't automatically play.

That works Josh but the problem is that it still starts downloaingd the wmv. My blog shows 10 posts at a time and if 6 posts contain silverlight videos of wmv files hosted on my server, all 6 videos will start downloading when someone loads the blog page leading to massive loss of bandwidth. Any solution for this?
10/7/2007 2:37 PM | # re: cheating at creating a silverlight media player
hurry: this will still download -- autoplay:false doesn't change the fact the url reference is there, it just controls the playback. the file is (as you've found) still downloading. if you want to download when someone clicks play, you will want to look at setting the mediaelement uri source when the user clicks play.
10/8/2007 1:18 AM | # re: cheating at creating a silverlight media player
>you will want to look at setting the mediaelement uri source when the user clicks play.

Thanks Josh. Please kindly explain how to do this exactly in what files and what code to change as it will help all the bloggers who want to embed Silverlight video. This will save a lot of bandwidth for the bloggers if they are hosting the Silverligtht videos. All flash videos have this feature and do not start auto-download when the post is loaded. I am a novice at Silverlight code.

I had other few questions:

(1) When I substitute another wmv-vc1 video not encoded by EME in place of my ouputted EME encoded video and give it the same file name, the silverlight players goes blank and does not play. Why is it like this? Do I change anything in the xaml?

I saw in the MS presentations that Silverlight players will support wmv videos encoded by any software. How do I make one common Silverlight player which will play any wmv video and I can just change it's path in the mediaUrl setting in StartPlayer.js. Do your nicer player file support this? If Silverlight wants to compete with Flash in web video, they should make it easy like Flash to embed any video without having to compulsorily go through via the EME. Thanks.
10/26/2007 9:07 AM | # re: cheating at creating a silverlight media player
Hi Tim,

Would I have any problems integrating the video player I exported from Expression Encoder with a Silverlight 1.1 application that I'm creating?

Is there any Silverlight 1.1 projects that can be created from Expression Encoder?
10/26/2007 1:38 PM | # re: cheating at creating a silverlight media player
vince: you shouldn't if your silverlight application is separate from the template that encoder emits. the encoder emits javascript code only at the moment. if i didn't understand the question fully, let me know.
10/29/2007 10:46 AM | # re: cheating at creating a silverlight media player
scottalx: make sure you are using Blend 2 September Preview version -- that is the one that understands Silverlight.
10/30/2007 6:47 AM | # re: cheating at creating a silverlight media player
nice get ready to see next step in tweaking:
slide synchronisation to video
and effect on slide click.
https://simplywebcast.experience.orange.fr:445/pages/consultation.php?F1E6214A-F0FF-41E0-B56A-B5B985C073B6

11/2/2007 8:56 PM | # re: cheating at creating a silverlight media player
Jakob above asks about streaming with this solution. I cannot seem to be able to get this player to work with anything other than media files on the local directory.

For instance an ASX file in the local directory that links to a live stream does not work. I get the following error on the page: Unable to load text.asx

This ASX file works if the file is in the local directory. But even linking to the same file via a web URL I get the error.

Is there a fix for this?
11/3/2007 7:28 AM | # re: cheating at creating a silverlight media player
mark: this is likely because of cross-protocol. when you run the player the address bar is probably c:\yadayada but is trying to access something eventually at an HTTP endpoint. you have to be using the same protocols for it to work. you can open the project as a web site in visual studio and hit F5 to run it under HTTP and then should work.
11/4/2007 8:09 PM | # re: cheating at creating a silverlight media player
Hi, Tim.

I am most interested in using this "cheat" mainly for the ability to use the "preloading/buffering animation". Is it possible to grab this element for the provided code?
11/5/2007 7:38 AM | # re: cheating at creating a silverlight media player
kaan: yes you could do this. if you generate one based on the templates, you can see the storyboards for the buffering animation, etc. and you could leverage those. the code to start/stop them would still have to be put in the right place when you'd want to use it. the javascript from encoder is mostly obfuscated, but essentially you are turning on/off the buffering animation you create.
11/5/2007 3:26 PM | # re: cheating at creating a silverlight media player
I do not have the option to add a Media Element in Expression Blend September Preview.

What do I need to do to have that available to me.

Mark Dahl
11/5/2007 4:26 PM | # re: cheating at creating a silverlight media player
mark: click the asset library icon ">>" on the last option of the toolbar, then click the 'show all' checkbox on the upper right of the asset library...the mediaelement will show there
11/12/2007 4:14 AM | # re: cheating at creating a silverlight media player
Hey how to do this with SilverLight1.1 alpha in this it is being done by Silverlight 1.0 right so i want Timeline slider in Alpha 1.1 Help me out thanx in advance
11/15/2007 6:08 PM | # re: cheating at creating a silverlight media player
What's the best way to have a list of videos played automatically one after another? And also to be able to easily re-sequence the video clips. FYI these clips will all be served up from a Windows Media Server.
11/23/2007 8:29 PM | # re: cheating at creating a silverlight media player
Tim-
This blog entry was immensely helpful! As are a number of other readers (Ravi and Vince) I am porting the Expression Encoder-generated Javascript to C# to use in Silverlight 1.1. I think what we're asking is:

1) Has anyone done this already, to your knowledge?
2) If not, is there a human-readable (i.e., not minified) version of the auto-generated BasePlayer.js class, to make this porting easier?

Thanks in advance!
-Rolf
11/25/2007 11:46 PM | # re: cheating at creating a silverlight media player
Ya Correct did any one tried to Do Player in C# if any one have it Please Share it here so that it will be Helpful for EveryOne (including me :))
11/26/2007 5:03 PM | # re: cheating at creating a silverlight media player
variousartist: a mediaelement can have a source that is a playlist from a media server

rolf/ravi/vince: i haven't seen any 1.1 templates yet and would hold off until another 1.1 update. regarding an unobfuscated baseplayer.js -- unfortunately i cannot distribute :-(
11/29/2007 9:23 AM | # Sys.Silverlight.createDelegate
Hello Tim,

Great screen cast.

I was wondering where can I find documentation on Sys.Silverlight.createDelegate? I've seen it in screen casts such as this, but haven't found anything official in the 1.0 SDK or even online.

Thanks,

- Scott
11/29/2007 9:45 AM | # re: cheating at creating a silverlight media player
scott: great question. the createDelegate is really a function of the project templates, not the default API. if you create a silverlight project from expression blend for example, look at the default_html.js file it creates and you'll see the createDelegate signature and functionality...it is pretty lean.
12/3/2007 9:35 AM | # re: cheating at creating a silverlight media player
Tim, I followed your screen cast step by step in order to create an audio player for my site. The problem I have is I can never get file uploaded on this page. I'm uploading a valid zip, but it never accepts the upload and always takes me back to the file upload page..https://silverlight.live.com/FileUpload.aspx

any advice / is this problem known?
12/30/2007 11:14 PM | # re: cheating at creating a silverlight media player
Hey I just want to play a silverlight video in SharePoint...
Any Idea how to do it..
The webpart just gives me a download error.. sometimes error code 1001,3000
Gravatar
1/2/2008 10:21 AM | # re: cheating at creating a silverlight media player
I am trying to modify this to run as a simple, standalone mp3 player with Silverlight 1.0. You provided the XAML but I didn't see the JavaScript that would be associated with the control clicking/hiding/etc. Where can I find that?

Great work, the video HOWTO is excellent.

Thanks.
1/2/2008 10:59 AM | # re: cheating at creating a silverlight media player
SC: check out this follow up post that contains a document explaining the various parts as well: http://timheuer.com/blog/archive/2007/12/18/creating-silverlight-media-player-skins-expression-encoder.aspx
1/3/2008 10:15 AM | # re: cheating at creating a silverlight media player
Tim,
Agreed, great screencast. After I encoded the file I followed Tim Sneath's steps to upload the file to my Silverlight Applications; http://blogs.msdn.com/tims/archive/2007/04/30/silverlight-streaming-is-now-live.aspx.

I uploaded my application, but when I preview the application in the test page, I get a few JS errors and the player doesn't render.

Should I not be using Tim Sneath's blog? I got the VideoPlayer sample app from the Quickstarts and it seems to be remarkably different. If you could point me in the right direction on encoding, it would go a long way. Thanks!
1/3/2008 4:50 PM | # re: cheating at creating a silverlight media player
matt: see my follow-up here: http://timheuer.com/blog/archive/2007/12/18/creating-silverlight-media-player-skins-expression-encoder.aspx and this plugin which automates everything that TimS' blog post does for you -- his blog post is valid still, but this plugin to encoder does it all automatically in one click
1/15/2008 7:25 AM | # re: cheating at creating a silverlight media player
Where do you see the timeline controls that have been created, where are the event handlers. I can't find them in any of the files that i get from encoding the video.
Thanks
1/15/2008 9:14 AM | # re: cheating at creating a silverlight media player
anjali: the event handlers are all storyboards in the player.xaml file as are the timeline controls are in that xaml file as well -- look at the reference document referred to in this post http://timheuer.com/blog/archive/2007/12/18/creating-silverlight-media-player-skins-expression-encoder.aspx as well.
1/22/2008 1:14 AM | # re: cheating at creating a silverlight media player
grty
1/28/2008 8:26 AM | # re: cheating at creating a silverlight media player
Tim,

Awesome! Just plain awesome!

FYI: I have an article here:

http://www.codeproject.com/KB/scrapbook/HowToCreateArticleVideos.aspx

That teaches how to create tutorial vidoes that meeting the requirements of free Silverlight Streaming, max bitrate 300KB.

Let me know what you think.

I'll update my article and point the readers to your blog for creating their own players.

Thanks again for your great post!

Karl
2/6/2008 10:19 PM | # re: cheating at creating a silverlight media player
Hi, I am beating down the doors trying to find a media player that will play preferably flash video (harder to steal) and flash audio and get this... open or trigger a reader. This would be a web app for a membership site. NOT desktop. ANY thought? I have looked at open source (songbird), considered "orange" and now found this silverlight but don't see the fit. I do have a respectable budget but not any where near what some of these "companies" want to do it for. I've got 4-5K to get it done. It would have to mange about 1000 files to start and have an easy user interface. Sorry to post such a long post but i am hopin a pro like you might have some more insight.
6/13/2008 7:12 AM | # re: cheating at creating a silverlight media player
Hi

Following your webcast I've created a nice Silverlight video Player:

http://www.silverlight-blog.it/ontheroad/videoplayer/index.html

It currently work with Silverlight 2 Beta 2
6/16/2008 3:38 AM | # re: cheating at creating a silverlight media player
Hi Tim, I am trying to make a media player following your video.But when I encode in the expression encoder I do not get a csproj file so that I can open it in the Blend.I only get few js files and the video file.And when try to open project from Blend the folder shows empty.please advice.
6/16/2008 9:30 AM | # re: cheating at creating a silverlight media player
@Tapas: really? odd -- in Blend or Visual Studio choose to open web site and point to the folder where all those files exist.
6/17/2008 1:30 AM | # re: cheating at creating a silverlight media player
Hi Tim, thanks for your quick response.I badly need the media player codes in C#.I made a simple media player only with START STOP PAUSE button in C# code behind.But I also need Timeline,volumecontrol etc. in C# codes as well.
I tried to open website in Blend as well as VS2008 pointing to the folder, and the media Player ran really well.But the thing is that I want codes in C# which my encoder is unable to provide.Can you please provide me with the CS code of the so called cheating-media-player demo?I hv downloaded the XAML.Thanks again, for all the help!
6/17/2008 1:33 AM | # re: cheating at creating a silverlight media player
Hi Tim, thanks for your quick response.I opened Blend as well as VS2008 pointing to the folder, and the media Player ran really well.But the thing is that I want codes in C# which my encoder is unable to provide.Can you please provide me with the CS code of the so called cheating-media-player demo?I hv downloaded the XAML.Thanks again, for all the help!
6/17/2008 8:29 AM | # re: cheating at creating a silverlight media player
@Tapas: see http://timheuer.com/blog/archive/2008/06/10/updating-skinnable-media-player-using-visualstatemanager.aspx for a managed code media player
7/9/2008 7:52 AM | # re: cheating at creating a silverlight media player
Every time I tried to playback some sort of file browser is alerting that I need some sort of plugin an there is a mention about this silverlight thing. Can you please explain what do I have to do, I'm not familiarized with this.
Thank you
7/22/2008 5:20 PM | # re: cheating at creating a silverlight media player
Hello Tim,

Thanks for all your good work. I can't get a player created by EE template to link to a video source on a WM server.

Regarding this earlier exchange:

Hi Tim
Great screen cast, Thanks.
Dou you know what it will take to make a custom media player, that plays a streamed vide file.

jakob: the same media player will play streaming URLs as well -- just change the mediaUrl attribute in the javascript file to your URL for the stream (as long as the stream is a windows media stream)

Sorry, but I can't find a mediaUrl attribute in any of the js files that EE creates. There is a mediaSource attribute in the MediaDefinition.xml file, but changing that to an URL does not work.

Sorry if this has been answered elsewhere. I have looked.

Chuck Allen
8/13/2008 9:53 PM | # re: cheating at creating a silverlight media player
HI Tim

Thanks for all your work..
I am using silverlight2.0... i am developing a media player...I had created alomost all the controls for the media player... But i am facing some difficulty regarding the PROGRESS BAR... i was unable to make the progress bar functional... please do suggest me ..
Thanks in advance...


Jimie
8/13/2008 10:15 PM | # re: cheating at creating a silverlight media player
10/1/2008 12:07 AM | # re: cheating at creating a silverlight media player
After I have encoded my video, there is no project file in output folder although the other files appear there. Is there a setting I am missing? Thanks
10/21/2008 8:52 PM | # re: cheating at creating a silverlight media player
I have the same problem as lyntonS. There is no Blend project file. Same question as lyntonS. Thanks
10/21/2008 9:06 PM | # re: cheating at creating a silverlight media player
Jonathon/lyntonS: In Blend choose File...Open...Site and point to the output folder.
11/9/2008 7:18 AM | # re: cheating at creating a silverlight media player
Hi Tim,

First... Thanks for the inspiring information! I didn't realize such a powerful tool was at my disposal.

Unfortunately… As the two posts suggested, there seems to be a change with the output in service pack 1. I am not seeing the project files in the output either.

Is there an output option for the project files or did we just get cut off in SPK1?

I am using

Many thanks again!
Sharka
11/9/2008 8:16 AM | # re: cheating at creating a silverlight media player
Sharka: See my previous comment. There are no project files, but in Blend or Visual Studio just open the folder location as a web site project. (File...Open Web Site)
11/9/2008 8:21 AM | # re: cheating at creating a silverlight media player
Tim,

Please disregard the last message!

I failed to see your recent updated article on your home page; "Using Encoder Templates in your Silverlight Application".

I found this to be extremely useful information, brilliant!

Many thanks again,

Sharka
11/25/2008 3:19 AM | # re: cheating at creating a silverlight media player
Hi Tim,

When creating a media player project via this method, does Expression Media Encoder create a .NET 3.5 / SL2 project (C#) or is JavaScript created?

Thanks
11/25/2008 7:59 AM | # re: cheating at creating a silverlight media player
Nalgey: The updated Encoder SP1 provides both Silverlight 1.0 and Silverlight 2 templates. Your code/project type will depend on which template you choose. If you don't have SP1, then they are all Silverlight 1.0 projects.
Gravatar
11/25/2008 4:01 PM | # re: cheating at creating a silverlight media player
Shame, it seems like they have changed the code. When I try to create a new UI from scratch, leaving out some elements, it throws JavaScript errors.

A super handy trick, nonetheless! Thank you for sharing.
11/26/2008 3:25 AM | # re: cheating at creating a silverlight media player
Hi Tim,

Thanks for the quick response.

I am trying to get this thing working with SL2. However when I select an SL2 template I don't get any of the following files {.sln .proj .cs} in the output directory. I only get {.xap .jpg .dat .wmv}. Is there anything you can suggest?

Thanks
11/26/2008 6:52 AM | # re: cheating at creating a silverlight media player
Nagley: Correct, the SL2 templates output a final Silverlight application. You can modify the template if you want by looking at the Source directory for the template that you want to modify. All the source code is there.
11/26/2008 7:13 AM | # re: cheating at creating a silverlight media player
OK, I thought that Expression Encoder produced also produced a '.sln' file that was written to the output directory. I thought that it would then be possible to open that '.sln' in VS2008 and have access to the xaml as well as the c#.

Is this possible?

11/26/2008 7:50 AM | # re: cheating at creating a silverlight media player
Nagley: It does, it is in the Source directory of the templates though, not the output -- the output represents the final product, compiled into a XAP. See: timheuer.com/.../...n-silverlight-application.aspx
11/26/2008 10:42 AM | # re: cheating at creating a silverlight media player
Perfect - A good template to learn from. Thanks.
12/4/2008 5:58 AM | # re: cheating at creating a silverlight media player
Hi Tim.

Thank you for helpfull post.

I am just starting with the Expression Encoder and Blend and this sems to be a good start.

I have on or two doubts that I could't resolve:

Is there a way to instruct Encoder to generate a c# project instead of generating a web project?

I use Firefox and it looks like Silverlight does not work there if I am using local host to see the results - is there any solution to this?

BTW - I tried copying the output files to my Linux web server and it works - however, silverlight only works for IE, not for Firefox (it keeps saying I need to install Silverlight even though I already did).

Thanks in advance,

dinis
12/4/2008 6:38 AM | # re: cheating at creating a silverlight media player
dinis: It sounds like you are using the Silverlight 1.0 templates. The Firefox issue is due to an update needed to the Silverlight.js file that is a part of those templates. Take a look at timheuer.com/.../...ight-javascript-detection.aspx for how to replace this in your template files for future outputs.
12/4/2008 7:10 AM | # re: cheating at creating a silverlight media player
Hi Tim.

Great*. Thanks for your fast reply.

It works fine now.

Still, the other question ....


Is there a way to instruct Encoder to generate a c# project instead of generating a web project?


I am using Expression Blend 2 SP1 and Expression Encoder 2 (downloaded trials yesterday).

Thanks again, in advance.

Dinis


12/4/2008 7:18 AM | # re: cheating at creating a silverlight media player
Dinis: If you are selecting the Silverlight 1.0 templates it generates files using the web site model and Silverlight 1.0 which is XAML and Javascript (no c#). If using the Silverlight 2 templates it does the same thing with the OUTPUT of the project (XAP and HTML host file) but the source code in C# is available for these templates in the Source folder of the template you wish to alter/use.
12/4/2008 8:05 AM | # re: cheating at creating a silverlight media player
Tim: Thanks again.

Now I am trying to upgrade to Encoder SP2 so that I can choose between SL 1 or 2 templates (as I understood from your reply to Nalgey). I am having some unexpected problems with the update(keeps asking for Encoder_en.msi file that I don't have) but I guess that I'll have to check with Windows update support.

Thanks for your great job in helping us.

Dinis
12/5/2008 7:53 AM | # re: cheating at creating a silverlight media player
Hi again.

I hope this s not a too technical question:

I used Encoder to create a job from 4 media content itms and choose the "hidden dark" template. When I open it on Blend, the chapter area is there and has a visible property but never shows in the output. Not even when I mouse over the hotspot.
I have been trying to check the xaml to find if there is something for me to change there but cannot find.
Now I think mabe I am doing something wrong and the Chapters are not being created and if so, I should do something while encoding so that the paragraphs are created ...
Is this question in the scope of your kind service or am I pushing to hard to get a free online trainer? ;).

Regards,
Dinis
12/10/2008 3:39 PM | # re: cheating at creating a silverlight media player
Hi Tim

I'm making a desktop player using Expression Blend.

I can get it to play stream videos and audio (thanks to you), but I don't know how to copy that stream to computer, can I do it with MediaElement, or do I have to look for another way?

I tried WebClient.DownloadAsync, but I get a file with zero bytes.

Please help me :-)
12/10/2008 3:49 PM | # re: cheating at creating a silverlight media player
Isaac: Are you trying to "save" the streaming data to the local computer/client? If so, no you can't do that using Silverlight.
12/12/2008 7:03 AM | # re: cheating at creating a silverlight media player
Marc: If you have Encoder 2, install SP1 (free) and you'll get the Silverlight 2 templates.
12/12/2008 1:30 PM | # re: cheating at creating a silverlight media player
First, let me say thanks for all the great information you've shared!

My question is support for *.mpg? I've inserted a MediaPlayer into a Asp.net(VB) page, selected the skin I wanted, and made minor changes to the xaml. The page works great when I use a *.wmv file, but doesn't work for *.mpg. Am I missing something? Is there an easy way to work with mpeg that I'm not aware of? I feel like I must be overlooking something.
12/12/2008 3:24 PM | # re: cheating at creating a silverlight media player
Carl: MPG is not a supported container right now. You will have to encode in a supported format/container.
2/5/2009 9:53 AM | # re: cheating at creating a silverlight media player
One quick question about the nice video tutorial you gave: (I posted as feedback question, but I realized this Blog was the more appropriate place for questions)

I just downloaded Expression Encoder 2 with SP1 installed and I encoded a very simple short video clip. In the 'Output tab' I choose a Silverlight 2 Template under 'Job Output' and then pressed 'Encode' and the video came up in a browser window as expected.

However, acoording to the video tutorial you gave, this should output a VB project file, that I can then open up in Expression Blend. In my \Expression Encoder\Output directory, no .vbproj file was created. Only the .wmv, .xap, Settings.dat, and Default.html files were created.

Do you have any ideas on why I am not getting a project file?
2/10/2009 1:54 PM | # re: cheating at creating a silverlight media player
atconway: This post was before the Silverlight 2 templates. The SL2 templates produce a runnable application with a compiled XAP for the media player. If you wanted to see the code behind that media player you can look at the code included with the template -- here's a post with a pointer to where the code is: timheuer.com/.../...n-silverlight-application.aspx and timheuer.com/.../...lates-for-streaming-media.aspx
2/11/2009 2:09 PM | # re: cheating at creating a silverlight media player
Thanks for the reply Tim. I did find the code for the template and was able to open it up in VS.NET 2008. Unfortunantly the code is so involved and specific, I was finding it hard to interact with the control via my own code. The 'Frosted Gallery' SL2 template is exactly what I needed in design. However, the template appears to need the user to build up the video list (videos to be played by the player) in Expresssion Encoder and then recompile the .xap for deployment, thus giving a static list of videos.

My requirement is to load that list at runtime, and pull the top 10 newest videos from my database as load the video library list. With the templates provided from Expression Encoder, I did not see how that was possible.

Therefore, I am making a player from scratch and using pieces of other players and your tips at the beginning of this page to create it in SL2. My thoughts are I need to make either a WCF or web service call to the database in order to get the video list back at runtime. I can preform this functionality from scratch at runtime, but I have no idea how to 'surgically' introduce that functionality into those SL2 Encoder templates, unless you have any ideas or suggestions for me on this requirement and using the exsting template.

It seems that all of these templates are created for users who want to continually encode videos using 'Expression Encoder' and then redeploy the .xap with a static video library as opposed to my requirement.

Any thought on all of this?

Thank you,
2/11/2009 3:05 PM | # re: cheating at creating a silverlight media player
atconway - yes you are correct that the existing templates wouldn't specifically support your scenario as-is. The playlists are provided via an initialization parameter on the plugin -- check out timheuer.com/.../...n-silverlight-application.aspx for some ideas of how to use the existing code. What you want is possible, but yes you'll likely have to change some things -- but hey, you've got a big head start!
2/13/2009 3:39 PM | # re: cheating at creating a silverlight media player
Hi Tim, I basically followed your steps in the video. But I was wondering if I can take the player.xaml and then in my asp.net website, when i drop a Silverlight Mediaplyer, import the player.xaml skin and just use that? I tried it by encoding a video with the popup skin, and then created a new website in VS08 and pointed to that player.xaml skin, but I dont get the popup or any controls. What changes do i need to make any, or how would I achieve this?
Thanks
4/22/2009 5:19 AM | # re: cheating at creating a silverlight media player
Tim-

Do you by chance know if there is a named element for displaying the filename of the currently loaded audio/video file? For example, if I have loaded MyMovie.wmv into the player (from say c:\MyVideos\MyMovie.wmv), is there a named element like 'VideoFileName' or something that would extract the name and display it? This is easy to do with a code behind file, but I am using just the .xaml as a 'MediaSkinSource' for an asp:MediaPlayer element in my web app.

Thank you!
4/22/2009 3:44 PM | # re: cheating at creating a silverlight media player
atconway -- there is a media properties on the MediaElement, but i can't recall if these are exposed in the Javascript API.
4/23/2009 6:40 AM | # re: cheating at creating a silverlight media player
I was hoping there was an exposed element for displaying the file name, but right now it is not looking good. I found a document containing all of the reserved keywords for making a MediaPlayer skin from the following link: download.microsoft.com/.../...yer%20templates.docx

The document showed nothing for displaying the filename of the loaded file. If you can think of any other way to expose the filename within a TextBlock in my .xaml without re-writing the control please let me know.

At this point I do not plan on re-writing all of the functionality of this control just to get the name displayed. If I have to, I will show it in a label or something above the control.

As always, thank you for your help Tim!
4/30/2009 5:59 AM | # re: cheating at creating a silverlight media player
When I ecoded the video in encoder then went to open the project in blend there was no .csproj do you have a solution, or place I can download the .csproj's?
4/30/2009 7:40 AM | # re: cheating at creating a silverlight media player
Sandmonkey - you're using a Silverlight 2 template likely. The source code for those are in the template's folder in another foldered labeled 'Source.' This post talks about the previous template types in Silverlight 1.0.
Gravatar
6/4/2009 9:34 AM | # re: cheating at creating a silverlight media player
Hi Tim,

I am trying to make a page that has silverlight and asp.net/ajax/javascript. I've tried so many different ways to embed the silverlight player and play .wmv files but each time I get the same result. The wmv will play fine, but if I put my mouse over one of the other thumbnails of the videos the player skips like crazy! Any ideas? It'd be very much appreciated.
6/15/2009 8:28 AM | # re: cheating at creating a silverlight media player
Clyde - you would set the MediaSource.Position property to your timecode.
6/16/2009 4:17 PM | # re: cheating at creating a silverlight media player
Clyde -- the code for calling into a position isn't built into the templates I don't recall. You'd have to add that function and expose it. You can take a look at some of the code on http://sl2videoplayer.codeplex.com for some ideas. In that project we have some functions to set position from script.
7/17/2009 9:37 AM | # re: cheating at creating a silverlight media player
Thanks for all the insight. Can you take an.xaml file and embed it into my website? I use a vbulletin skin for my forum.
Thanks
7/17/2009 1:50 PM | # re: cheating at creating a silverlight media player
you can't 'embed' a XAML file, but you could use an iframe -- or use Silverlight 2 or higher and you can embed the application (.xap file)
8/19/2009 9:36 AM | # re: cheating at creating a silverlight media player
How do you break up video segments automatically, I want to put in house ads during the video?
8/21/2009 8:44 PM | # re: cheating at creating a silverlight media player
I am going to ask a really vague question a hope to get a really good response since i think you know what your talking about. I have netflicks and silverlight 3 on my dell2.4 ghz, nvidia mx4000 128mb, and 512mb ram, I am having buffering issues, It buffers 10 sec of movie, then progressively slows the buffering down while the movie plays untill the buffering and the movie stop, I watch 3 min if movie it buffers 3min, and on and on it sucks, I have cricket broadband as isp. No problems on any other player just this one, Can you tell whats up is it SL3, netflicks,or me.
8/22/2009 4:29 AM | # re: cheating at creating a silverlight media player
jake I'd recommend contacting Netflix support.
8/22/2009 9:36 PM | # re: cheating at creating a silverlight media player
really thanks sl3 just is a stupid platform for guys to build on for so future projects like ie. conecting people with cell phone and they will be able to video conference on thier cell phone or some thinking like that while we netflicks guys just want to watch a movie great SL123 suck
9/23/2009 12:05 AM | # re: cheating at creating a silverlight media player
Hello I'm really a new for this n Thank you for the great tutorial, it worked on blend n encoder 2

but when I started the video in the website, it ask me to download silverlight, but I already use the newest version silverlight 3.

And I want to ask how to embed the video player to the website.

Thx
9/23/2009 9:48 AM | # re: cheating at creating a silverlight media player
Ivan, Encoder 2 ships with an incorrect Silverlight.js file that is likely causing your issue (I'm guessing your browser is Firefox?). Replace with the latest from http://code.msdn.microsoft.com/silverlightjs in your project and see if that works.
9/24/2009 6:56 AM | # re: cheating at creating a silverlight media player
Thx tim, it finally worked and yes I use firefox

but in blend 3 there is no open site, only open project so it can't be done in Blend 3

Thx again I really appreciate it
Gravatar
10/6/2009 2:37 AM | # re: cheating at creating a silverlight media player
I've created videospokeperson and trying to upload through silverlight on my webpage...but i don't want to show silverlight player on my page...just i need only videospokeperson with few controls...how can i do this thing...can you help me out...
10/18/2009 10:34 AM | # re: cheating at creating a silverlight media player
Hi i was wondering if the same can be done using blend 3 and encoder 3 as there is no "open site" button in blend 3 only "open project or solution"?

It would be a great help to know if you can or cant.
Thanks Tim for the great Tut!

Rich
11/3/2009 6:32 AM | # davetiyeci
güzel davetiye sözleri ve davetiye modelleri
11/13/2009 1:00 PM | # re: cheating at creating a silverlight media player
Hello,

Great article.
Question,
Is there an automatic way to integrate the Expression output to web solution I created using ASP.NET with C#? Would I have to do this manually? If so, could you point me to a reference that does this? Thanks in advance.
2/16/2010 7:38 AM | # Play local files with media element
Hi , I want to play local audio files hosted on my drive in media element.
is there any way for addressing the source property of media element to look in my local drive.
my silverlight app works in a gadget , I want that users can play their audio locally
3/31/2010 9:56 PM | # re: cheating at creating a silverlight media player
Hi Tim, Really nice post. But I want to create a silverlight video player displaying all sort of ads( linear, overlay etc.).Can you please let me find a way to proceed.
12/8/2010 10:31 AM | # Encoder Won't Create Project File
Help: I've tried Encoder 3 and Encoder 4 and neither will create a project only xap files. Has Microsoft crippled the recent releases of Encoder?

Furthermore, it was interesting to note Encoder 4 actually "branded" an Encoder 4 logo into the lower right corner of the Corporate Silver player.

Finally, reusing the XAML and the .cs files in some other solution is something I think we can all use some help figuring out if anybody is up to it.
1/15/2011 9:52 PM | # re: cheating at creating a silverlight media player
That's cool that the same media player will play streaming URLs as well! Lightyear Wireless
6/4/2011 3:31 AM | # re: cheating at creating a silverlight media player
I think being fashionable has become a must for each person.
Freshersworld||IT jobs
6/14/2014 6:28 AM | # re: cheating at creating a silverlight media player
Help: I've tried Encoder 3 and Encoder 4 and neither will create a project only xap files. Has Microsoft crippled the recent releases of Encoder?

 
Please add 7 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.