×

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 received a comment regarding the new Expression Encoder SP1 Silverlight player templates and how they can be used within your own application.  Right now the templates appear to stand on their own.  That’s only because the output of an Encoder action will be an encoded file, the template you chose (XAP) and an HTML page to host the Silverlight player application.

But what if you already have an application and are trying to integrate media playback within it?  How can you take advantage of the Encoder templates, but just drop them in your existing application?  Let’s take a quick look.

Let’s say we have an existing application.  For the sake of this post, let’s just show some primitive controls and display a Button and TextBox within some StackPanel layouts:

   1: <UserControl
   2:     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   3:     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   4:     x:Class="ExPlayer.Page"
   5:     Width="640" Height="480" 
   6:     >
   7:  
   8:     <Grid x:Name="LayoutRoot" Background="White">
   9:         <StackPanel Orientation="Horizontal">
  10:             <StackPanel Height="Auto" Width="309">
  11:                 <Button Content="Button"/>
  12:                 <TextBox Text="TextBox" TextWrapping="Wrap"/>
  13:             </StackPanel>
  14:             <StackPanel Height="Auto" Width="250" x:Name="MediaArea"/>
  15:         </StackPanel>
  16:     </Grid>
  17: </UserControl>

Now we want to add a media player using the Encoder templates to our application in the StackPanel labeled MediaArea.  First, we need to get the media player from the template as a control.  Easy enough since the source code for the Expression Encoder Silverlight 2 templates are included.  Browse to your install directory for Expression (usually C:\Program Files\Microsoft Expression\Encoder\Templates\en\) and pick the Silverlight 2 template you want to use.  NOTE: This is only for Silverlight 2 templates, so be sure not to get frustrated at me :-) -- you’ve been forewarned.  I’ll choose the SL2Standard template.  Notice within that folder there is also a Source folder.  Within there is an ExpressionPlayer folder and associated C# source code project.  Open that project in Visual Studio 2008.

Now build the project.  Done.  You now have a control you can use.  Here’s how we’ll do it.

Going back to our own application we need to add a reference to the ExpressionPlayer.dll and MediaPlayer.dll we just built.  Go ahead and do that in your Silverlight application by choosing Add Reference and then pointing to the assembly location.  Now we need to inform our XAML that we’ll be using this control.  Of course if you add these controls to your Visual Studio 2008 toolbox you can drag-and-drop them onto the XAML code surface and it will append the xmlns attribute for you, or we can add it ourself:

   1: <UserControl
   2:     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   3:     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   4:     x:Class="ExPlayer.Page"
   5:     Width="640" Height="480" 
   6:     xmlns:expression="clr-namespace:ExpressionMediaPlayer;assembly=ExpressionPlayer"
   7:     xmlns:ExpressionMediaPlayer="clr-namespace:ExpressionMediaPlayer;assembly=MediaPlayer"
   8:     >

I’ve called my namespace “expression” and “ExpressionMediaPlayer” and you can see I’ve pointed (actually Visual Studio’s Intellisense did it all for me) the namespace to the assembly I just referenced.  Now we can use the control.  Here’s the XAML for adding it to my application and adding a media file that is in my applicaiton:

   1: <UserControl
   2:     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   3:     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   4:     x:Class="ExPlayer.Page"
   5:     Width="640" Height="480" 
   6:     xmlns:expression="clr-namespace:ExpressionMediaPlayer;assembly=ExpressionPlayer"
   7:     xmlns:ExpressionMediaPlayer="clr-namespace:ExpressionMediaPlayer;assembly=MediaPlayer"
   8:     >
   9:  
  10:     <Grid x:Name="LayoutRoot" Background="White">
  11:         <StackPanel Orientation="Horizontal">
  12:             <StackPanel Height="Auto" Width="309">
  13:                 <Button Content="Button"/>
  14:                 <TextBox Text="TextBox" TextWrapping="Wrap"/>
  15:             </StackPanel>
  16:             <StackPanel Height="Auto" Width="250" x:Name="MediaArea">
  17:                 <expression:ExpressionPlayer Width="242" Height="177">
  18:                     <expression:ExpressionPlayer.Playlist>
  19:                         <ExpressionMediaPlayer:PlaylistItem MediaUrl="Lake.wmv"/>
  20:                     </expression:ExpressionPlayer.Playlist>
  21:                 </expression:ExpressionPlayer>
  22:             </StackPanel>
  23:         </StackPanel>
  24:     </Grid>
  25: </UserControl>

Of course you can interact with it via code as well, but getting the control in your app is easy once you know these steps.  Now my application has a fully-functional media playback without me writing any code and being able to integrate it within my existing application.  I might want to change the style of course to fit my application’s experience, but dropping in a few style attributes wouldn’t be that difficult…and I an always make that a part of the Encoder template as well!  Here’s the “after” screenshot of it in play:

You get full functionality out of the player…with one exception.  I’ve noticed that the fullscreen option doesn’t act the same as if the player was the only app.  To be honest I haven’t looked at what it would take to do that,but remember that now the media player is a part of a bigger app and isn’t the application itself.  So “fullscreen” mode is a part of the container Silverlight application and not just the media player…something to watch out for if you expected your embedded media player now to automatically have the same fullscreen functionality.


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


11/3/2008 5:15 PM | # re: Using Encoder Templates in your Silverlight Application
Tim, thanks for the great tip.
How many templates does Encoder offer? Or is the above Look & Feel we get?

Thanks!
..Ben
11/3/2008 8:15 PM | # re: Using Encoder Templates in your Silverlight Application
Ben: There currently are 21 templates overall (audio/video SL 1 and SL 2). There are 6 new Silverlight 2 templates.
11/3/2008 10:40 PM | # re: Using Encoder Templates in your Silverlight Application
I haven't replicated your implementation for the templates, but may be able to lend some guidance on the full screen aspects of the player.

I've found that when going full screen with a silverlight media element, all other items must be set to a non-shown dimension to allow only the player to go full screen. What we've done is with our own player added soem overloaded events on the control to allow for respective handing of those controls that need to be minimized to be shown.

In your example it would be the first stackpanel in the parent stackpanel, and set it's width to 0 on the click event for full screen. I dont' know if the templates expose that event though.

You could also handl the OnFullScreen event of the sl application (I think that is what its called) and set the height or width of those controls or control containers to 0. Add some animations to the events and operates rather gracefully.

hth
11/4/2008 5:56 AM | # re: Using Encoder Templates in your Silverlight Application
Matt: Thanks for the comment. Yes it is entirely possible to do this. I was merely pointing out that if a user is expecting the *same* functionality by just dropping in the control in their application, they needed to understand that the FullScreen mode is a part of the entire application and not just the media player element they put in there. So when embedding one of these templates you would, as you note, have to handle the event and change your hosting application to respond accordingly.
11/4/2008 11:15 AM | # re: Using Encoder Templates in your Silverlight Application
Tim,

Thanks for this great article. Can tooltips be added to the player button? Also,is there a way to disable/hide the fullscreen, closed caption, chapter list, etc... icons?
11/4/2008 11:18 AM | # re: Using Encoder Templates in your Silverlight Application
Mauro: Absolutely -- the source is available to you...you can go into the media player and remove those buttons, skin them, whatever.
11/5/2008 12:58 PM | # re: Using Encoder Templates in your Silverlight Application
Hi Tim,
I have added the control to xaml page and depending on some button click want to play the video and here is the code and its not playing the video, I don't knw why? can you please help me?

PlaylistItem item = new PlaylistItem();
item.MediaUrl = new Uri(videoInfo.Url, UriKind.RelativeOrAbsolute);
item.Title = videoInfo.Title;
item.IsAdaptiveStreaming = true;
item.FrameRate = SmpteFrameRate.Unknown;

ExpMediaPlayer.Playlist.Add(item);

if (ExpMediaPlayer.Playlist.Count > 0)
{
ExpMediaPlayer.GoToPlaylistItem(0);
ExpMediaPlayer.Play();
}
11/5/2008 1:37 PM | # re: Using Encoder Templates in your Silverlight Application
kumar: have you checked the traffic to make sure you aren't running into any cross-domain issues?

11/5/2008 1:53 PM | # re: Using Encoder Templates in your Silverlight Application
I'm having a similar issue - calling .Play() doesn't seem to do anything. My videos are all on the same domain as the control.
11/5/2008 2:20 PM | # re: Using Encoder Templates in your Silverlight Application
Can someone send me a sample app to look at?
11/5/2008 3:14 PM | # re: Using Encoder Templates in your Silverlight Application
Hi Tim,

Its working now. I used ExpressionMediaPlayer before and it din't work, and when i used ExpressionPlayer it worked.
Tim, Can you please let us know the difference between ExpressionPlayer and ExpressionMediaPlayer.
Our videos are on other 'X' website.

I am new to Silverlight.

Your blog saved lot of my time and i bacame hero.

Thank you.
11/5/2008 3:25 PM | # re: Using Encoder Templates in your Silverlight Application
kumar: Aha. The difference really is only how the Encoder templates are build. The core player is actually the MediaPlayer (if you look at the source files) and the ExpressionPlayer wraps some functionality around that...thus the need for both assemblies and the difference in controls. Because they are named so similar our eyes didn't catch them :-)
11/5/2008 3:52 PM | # re: Using Encoder Templates in your Silverlight Application
Switching the control to ExpressionMediaPlayer:MediaPlayer worked for me too. Thanks!
11/5/2008 11:57 PM | # re: Using Encoder Templates in your Silverlight Application
Also if you want to see what is going on with the controls, James is dissecting them for us: www.clarkezone.net/default.aspx
11/6/2008 11:29 AM | # re: Using Encoder Templates in your Silverlight Application
Hi Tim,

can two seperate silverlight apps use same ISO storage using Site Settings. Like you use one silverlight app to store some object in ISO Storage and then use that object from another silverlight app.

I have read your blog and understood that its not possible even with SiteSettings because each Iso storage is based on XAP Uri.right ?

Thank you
11/6/2008 1:13 PM | # re: Using Encoder Templates in your Silverlight Application
kumar: If the apps are served from the same domain (i.e., foo.mydomain.com/app1.xap and foo.mydomain.com/app2.xap) they can share SiteSettings as they are a part of the same IsoStore group. Each will have it's own area of AppSettings though.
11/7/2008 6:58 AM | # re: Using Encoder Templates in your Silverlight Application
Hi Tim,

Thank you for the Quick response.

I am using two separate apps.(separate visual studio instances). Both run under localhost right?please Correct me if i am wrong or making a blunder. both run under localhost domain right? but why the apps are not sharing the ISO Storage.

My code is :

1) IN First SilverLight App

private IsolatedStorageSettings siteSettings = IsolatedStorageSettings.SiteSettings;

var galleryitem = (sender as HyperlinkButton).DataContext as MediaInfo;
siteSettings.Clear();
siteSettings.Add("GalleryItem", "galleryitem");
siteSettings.Save();

2) In Second Silverlight App

private IsolatedStorageSettings siteSettings = IsolatedStorageSettings.SiteSettings;

private TimeSpan currentMediaElementPosition;
private Popup popUp = new Popup();

public MultimediaHome()
{
InitializeComponent();
//******************* Isolated Storage Stuff ********************/
if (siteSettings.Contains("GalleryItem"))
{
object ISOItem = siteSettings["GalleryItem"];
MediaInfo galleryitem = ISOItem as MediaInfo;


Thank you Tim.
11/7/2008 9:52 AM | # re: Using Encoder Templates in your Silverlight Application
Tim,

Thank you for this valuable info.

"So “fullscreen” mode is a part of the container Silverlight application and not just the media player"

I really need to have this feature enabled.

Is there any work around please?
11/7/2008 11:00 AM | # re: Using Encoder Templates in your Silverlight Application
Donovan: The workaround is to to handle the event. "Full Screen" is a mode of a silverlight application, not just a control/component of a part of the application. While the media player has that function...it simply announces to the *application* to change to full screen mode. If you want the media to go full screen, you'll have to watch that event and re-paint the media to your needs over your application.
11/26/2008 12:38 AM | # re: Using Encoder Templates in your Silverlight Application
i wan d diagram n code
12/2/2008 3:29 PM | # re: Using Encoder Templates in your Silverlight Application
kumar: Are both XAP files served from the same domain?
12/3/2008 10:53 AM | # re: Using Encoder Templates in your Silverlight Application
Hi, I tried this and I'm getting the following error in my media player:
"System.Exception: AG_E_NETWORK_ERROR"

How I've tried it:
Giving the MediaUrl value a Relative Path in the SilverLight App
Giving the MediaUrl value just the FileName and copying the file into the Web App's ClientBin dirctory
Hosting the media file (wma audio... I've tried mp3 too) on a local website and giving the MediaUrl value that URL (localhost/JMedia/Assets/Audio/01_In_Disguise.wma)

... All of these efforts produce the exact same error message.

Example XAML (that's fun to say :-) )


localhost/JMedia/Assets/Audio/01_In_Disguise.wma"/>


Any thoughts?

12/3/2008 10:58 AM | # re: Using Encoder Templates in your Silverlight Application
Oops, my XAML didn't come out right in the last post.

<expression:ExpressionPlayer Width="500" Height="400">
<expression:ExpressionPlayer.Playlist>
<ExpressionMediaPlayer:PlaylistItem MediaUrl="localhost/JMedia/Assets/Audio/01_In_Disguise.wma"/>
</expression:ExpressionPlayer.Playlist>
</expression:ExpressionPlayer>
12/3/2008 10:59 AM | # re: Using Encoder Templates in your Silverlight Application
Tim: when you run the application, what is in the address bar of the browser? Does it start with c:\ or http://? Make sure you aren't running into a cross-scheme situation.
12/3/2008 11:10 AM | # re: Using Encoder Templates in your Silverlight Application
The address is:
http://localhost:4211/Run.aspx

Run.aspx is calling the Silverlight App.

Not sure how to tell if it's a cross-scheme situation, or how to correct that.

-Tim
12/3/2008 11:15 AM | # re: Using Encoder Templates in your Silverlight Application
So.

Copying the wma file into the web app that calls the Silverlight app, then changing the MediaUrl value to: "http://localhost:4211/01_In_Disguise.wma" fixes it.

Interesting.


12/3/2008 11:16 AM | # re: Using Encoder Templates in your Silverlight Application
Weird, it should not make a different if it is the same scheme -- would be interesting to watch the network traffic to see where requests are failing.
12/3/2008 11:17 AM | # re: Using Encoder Templates in your Silverlight Application
cross-scheme... duh.
12/18/2008 2:10 PM | # re: Using Encoder Templates in your Silverlight Application
Hi Tim,

I've been reading your blog for some time and would like to seize this opportunity to thank you.

I'm using a similar user control and would like to host this control on an asp.net page. My problem is that My video library is on an SQL data base, My question is: is there a way to bind programatically the ExpressionMediaPlayer:PlaylistItem to an asp:ObjectDataSource Adapter? if yes How? if not what will be the best approach to achieve this: querying the Videos from the database and then building the PlayListItem from the SQL query result?

Thanks again
Moctar
12/18/2008 2:25 PM | # re: Using Encoder Templates in your Silverlight Application
Moctar: you'd probably have to modify the source and perhaps expose a public property to set this information or something. or you can wrap the control into some other class and set the initialization parameters accordingly.
1/2/2009 7:23 PM | # re: Using Encoder Templates in your Silverlight Application
Thank you Tim for the tip.

I tried to do what you suggested but I'm runing through the following problem:

When I try to play any video that is not in the application(control host Application)ClientBin or a subfolder of it the following exception is raised: System.Exception:AG_E_NETWORK_ERROR. do you know of any approach by which I can play videos that are not stored in the same location as the ClientBin or even hosted on a remote server.

Remark: I implemented a function that will get the absolute URI of the media source which is passed to the PlayListItem.MediaUrl and I verified that the Path passed by this function to the PlayListItem.MediaUrl is correct.

Thanks
Moctar
1/2/2009 10:19 PM | # re: Using Encoder Templates in your Silverlight Application
Moctor: if you are using a relative URI the "root" is the location of the XAP file...anything else requires an absolute URI
1/3/2009 1:19 AM | # re: Using Encoder Templates in your Silverlight Application
Hi Tim

Thank you for the quick feedback. My problem seems to be related to any absoluteUri with file:/// as the Scheme for example any videos associated with an absoluteUri like: file:///C:/Experiences/Bear.wmv will throw AG_E_NETWORK_ERROR Exception. at the same time videos associated with an absoluteUri whose scheme is like http:// work fine.
is the file:// scheme recognized by silverlight2 or is this cross-scheme access issue? Please help

Thanks
Moctar
1/7/2009 11:27 AM | # re: Using Encoder Templates in your Silverlight Application
Hi Moctar, even though the schemes match, Silverlight isn't aware of anything other than it's application space. So even thought it is rendered using the file scheme, Silverlight cannot arbitrarily seek out a local file that doesn't exist within it's own web application relative to the Silverlight application. This is because it is still a browser application which runs in the secure sandbox.
1/9/2009 6:53 AM | # re: Using Encoder Templates in your Silverlight Application
Hi, I uploaded my videos in my silverlight.live.com acct. How can i add it as the source of the media player, almost all the sample is using a video file within the application.

Thanks,
Bermo
2/6/2009 7:34 AM | # re: Using Encoder Templates in your Silverlight Application
Hi Tim,

I tried your example above wit the Black Glass template.
I see the standard player (like the one in your example) but i dont see the Black Glass skin. Do you have any idea?

Thanks in adcance, Hans.
2/10/2009 10:17 PM | # re: Using Encoder Templates in your Silverlight Application
I went through the steps and was successful but the only player I get is the Expression Player not one of the templates. I compiled from the csproj in the SL2AudioOnly folder but the player I get in VS 2008 isn't the SL2AudioOnly but the Expression Media Player. Is there a way to use the other templates or is this one the only one we can pull out? Thanks.
2/11/2009 10:13 AM | # re: Using Encoder Templates in your Silverlight Application
David -- each template has an associated Source folder with it, make sure you're grabbing the right one you want to use. Most of the logic is identical with the page.xaml being the difference in the UI.
2/18/2009 8:50 AM | # re: Using Encoder Templates in your Silverlight Application
Tim,

Is it possible to use the templates-skin? I think its the same question as David had, David did you manage to use the skin from the expression 2 players?

I use the players, after making the dll files available as reference, as a custom user control in the assets library.

Thanks in advance,

Hans.
2/18/2009 8:52 AM | # re: Using Encoder Templates in your Silverlight Application
Hans, the styles used in the templates are also a part of the source files -- look for player.xaml for those resources.
2/19/2009 8:14 AM | # re: Using Encoder Templates in your Silverlight Application
Tim,

Thanks for your response, but i can't find the player.xaml file in the source folder.

The xaml files in the Source folder are;
App
Page
generic

Hans
2/19/2009 9:02 AM | # re: Using Encoder Templates in your Silverlight Application
The generic.xaml would be the one where the control templates/styles are defined.
3/24/2009 6:16 PM | # re: Using Encoder Templates in your Silverlight Application
Hi, I've successfully embedded one of the templated players into my silverlight application (which is fantastic), but what I can't seem to do is get the selected playlistitem.

So when I select a playlistitem there doesn't seem to be any event that I can hook into.

Am I just missing this, or is there some way to add this to the player?

Thanks,

Grant.
4/3/2009 2:20 AM | # re: Using Encoder Templates in your Silverlight Application
Hello Tim,

First off, your articles have already helped me out a great deal. So I'd like to thank you in advance.
I've been trying to add an existing stream to a Silverlight Player template, but I can't seem to find the templates, or more specifically, I can find the templates, but none of them contain a "Source" folder. They just have the MediaDefinition.xml, the player.xaml, a Default.html and a bunch of javascript files, but no XAP files to be found.

Could this be because I'm running a trial copy of Encoder 2?

Thanks,
Pieter
4/3/2009 8:48 AM | # re: Using Encoder Templates in your Silverlight Application
Pieter -- make sure you have SP1 for Encoder which will install the Silverlight 2 templates.
4/3/2009 11:57 AM | # re: Using Encoder Templates in your Silverlight Application
Ah, I'm sure that's it. Thanks again for your help!
4/3/2009 9:37 PM | # with silverlight , video rotating and scaling
Respceted Sir.

I got your mail id through www.blogs.msdn.com.Sir, i don't have much knowledge in silverlight.Please suggest me some referal sample code links that i can achieve some what as per my requirements where the sample link like http://1dc.net/album.I did not get ant drag and drop option for mediaplayer control but i find the drag and drop with mediaelements.How to do rotation and scaling in video, example,
One canvas having 6 videos, if we want each video with rotate and scaling icon along with canvas too.
How to place a video haffazardly or may be overlapped like the above sample url.
Most of the like youtube with volume increaser icon.
Thanks in advance Sir.

With Regards
Ch.Gayatri subudhi
4/14/2009 3:45 AM | # re: Using Encoder Templates in your Silverlight Application
After using encoder templates in my applicatoins I can't hear nothing. The volume control does nothing. Can you any solutions for this issue ?
5/15/2009 4:29 PM | # re: Using Encoder Templates in your Silverlight Application
I just downloaded Encoder 2 and there are no Source folders or C# code in the Templates directories. I searched everywhere in the Encoder2 directory and it's child directories. Is this something that is no longer available?
5/31/2009 1:36 PM | # re: Using Encoder Templates in your Silverlight Application
I figured out the issue I had in the post above, I needed to use the ExpressionMediaPlayer:MediaPlayer instead of ExpressionPlayer, see below:

<ExpressionMediaPlayer:MediaPlayer Width="Auto" Height="Auto" x:Name="expPlayer">
<ExpressionMediaPlayer:MediaPlayer.Playlist>
<ExpressionMediaPlayer:PlaylistItem MediaUrl=""/>
</ExpressionMediaPlayer:MediaPlayer.Playlist>

</ExpressionMediaPlayer:MediaPlayer >
5/31/2009 1:40 PM | # re: Using Encoder Templates in your Silverlight Application
Quick question, I am using this template player now but it does not seem to recognize markers. I used Expression Encoder 2 to add markers to a video file and I can preview it in the browser in Expression Encoder and that works fine. When I drop the same video file (and supporting files) into this template player in my app (built using the steps in this blog), the markers don't show up in the chapter button.

Should this functionality be packaged in the template?
5/31/2009 1:49 PM | # re: Using Encoder Templates in your Silverlight Application
Jack -- I believe it should, but I'd have to look at the code...you may have to ensure that that marker code is included as well and not interfering with other XAML elements that might exist in the application.
6/3/2009 3:35 PM | # re: Using Encoder Templates in your Silverlight Application
Tim, there's a problem with customizing a template and then using it in your own app. I did everything as you described and it worked, but even though I edited the template it shows the original version of it. The reason for this is because there doesn't appear to be a way to apply a Style to the player once you get it into your own app. You cannot edit the core template, you can only create a new style. But when you do that and build the new template, importing the dll's into your app brings the template in and the default Style is applied to your player. I tried adding the proper style attribute to the xaml: <expression:ExpressionPlayer Width="640" Height="360" Name="ExpPlayer" Style="{StaticResource MyStyle}"/> and even copying the Style resource from the template app into my app. None of these solutions work.

How can I use a customized encoder template in my silverlight app?
6/3/2009 5:09 PM | # re: Using Encoder Templates in your Silverlight Application
6/5/2009 12:23 PM | # re: Using Encoder Templates in your Silverlight Application
Jack -- you'd have to modify the code to expose some scriptable methods.
6/5/2009 2:25 PM | # re: Using Encoder Templates in your Silverlight Application
I tried this and it seems to do what I need in just a couple lines of code:

In the MediaPlayer.OnMediaElementMarkerReached() method:

HtmlPage.Window.Invoke("globalJSMethod_MarkerReached", e.Marker.Time);
this.Pause();

-JL
6/8/2009 5:17 PM | # re: Using Encoder Templates in your Silverlight Application
Asking again. Please help:

I just downloaded Encoder 2 and there are no Source folders or C# code in the Templates directories. I searched everywhere in the Encoder2 directory and it's child directories. Is this something that is no longer available?
7/9/2009 6:07 AM | # re: Using Encoder Templates in your Silverlight Application
@J Silver
You have to install Service Pack 1 to get the templates. The current service pack is not included in the trial download.

Greetings Carlos
8/9/2009 10:05 AM | # re: Using Encoder Templates in your Silverlight Application
I know it's possible to reskin the template once you get it into your own app, but how do you add new functionality to the template? For example, let's say I want the player controls to transition in a certain way when the user hovers over a certain portion of the player. I can go into the player style, add elements and storyboards, but I have no way of telling the storyboard to begin from the main project. There appears to be no path to a storyboard within the style. So my question really comes down to this: How do you modify the template in a deeper way than by merely creating/editing a Style? I think you need to get to it's core in some way, but I haven't found a way to do this.
8/11/2009 7:01 PM | # re: Using Encoder Templates in your Silverlight Application
I can't experience the smooth streaming for I'm a rookie. Would you please send me the source code,or tell me how to add some codes in the source code detailedly. Thank you!
8/11/2009 8:47 PM | # re: Using Encoder Templates in your Silverlight Application
Aaron -- the new Encoder 3 templates include source code for smooth streaming media sources.
8/19/2009 9:29 AM | # re: Using Encoder Templates in your Silverlight Application
I am working with Encoder 3: using the (Frosted Gallery) template I would like to add an automatic pause function between clips. I require a simular template that displays all the encoded clips with metadata.

The way the template works the clips play continous one after another and I need the video to stop when the end of a clip is reached and the user would start the next clip when ready or replay the clip it desired.

My question is does such a template exist that has that function? or where should I look to make code modifications?
8/20/2009 1:27 PM | # re: Using Encoder Templates in your Silverlight Application
How can I get the encoder template "Chrome" to be used in my silverlight applicaiton that uses the MediaPlayer. I can only get the default one.
8/20/2009 1:43 PM | # re: Using Encoder Templates in your Silverlight Application
Matt - You need to get the styles from the desired template you want and be sure to include them in your app.
9/14/2009 1:48 AM | # re: Using Encoder Templates in your Silverlight Application
The tag 'MediaPlayer' does not exist in XML namespace 'clr-namespace:ExpressionMediaPlayer;assembly=MediaPlayer'
this is my project error.
help me
9/14/2009 3:29 AM | # re: Using Encoder Templates in your Silverlight Application
I'm chinese,so I need encoder template provide localize resources.
after I run and built template project ,I looked MediaPlayer.resources.dll file in "/bin/debug/zh-Hans" folder.
how to add resources file in my silverlight app?
my english is poor ,I hope you can understand!
9/14/2009 7:24 AM | # re: Using Encoder Templates in your Silverlight Application
Hello Tim,
Is there a programmatic way of enabling a continual loop in the playlist for this type of control?

I've made a post to the forums here: http://forums.silverlight.net/forums/t/127967.aspx

I am still unsure of a viable approach to a loop. The mediaElement has a MediaEnded event that can be leveraged... is there one for this control?
9/25/2009 2:20 AM | # re: Using Encoder Templates in your Silverlight Application
Hi Tim,

Is this player capable of playing broadcasts from media services? If not, is it possible to make it support it by doing any changes to source?

I'm currently using the MediaElement control to do this, but it lacks professional video player look & feel.

Thanks
Uchitha.
Gravatar
10/4/2009 11:50 AM | # re: Using Encoder Templates in your Silverlight Application
You Rule!!

You saved me bigtime!
2/8/2010 10:18 AM | # SL3, template style
I've tried this in SL3, but i always got the default theme no matter which dll's I replaced. I had to extract the style from MediaPlayerTemplate.dll > Resources > page.xaml and apply it to my ExpressionPlayer.
5/8/2010 6:23 AM | # re: Using Encoder Templates in your Silverlight Application
Jason -- there is a MarkerCollection property on the media element. After MediaOpened events fire, that will be populated and you should be able to get to whatever markers where embedded.
6/7/2010 2:22 PM | # re: Using Encoder Templates in your Silverlight Application
Hi Tim, how can I set a file, which is in the isolated storage, as a playlist item?
thanks...
7/14/2011 1:05 PM | # re: Using Encoder Templates in your Silverlight Application
Tim,

We are using the player from the Expressions Encoder 4 templates in an html page with Javascript to launch based on querystring parameters (like mediaSource). I'm attempting to customize the player to allow passing the url for the settings.dat file or a playlist.xml file and having the player parse the file for playlist, playlistitem, mediasource, and chapter information. Is there any example code available showing how to parse from a file url into a playlist that can be consumed by the player?

Thanks for any help you can provide, Eric
2/23/2013 9:56 AM | # re: Using Encoder Templates in your Silverlight Application
Hello,

But Silverlight always run default player even I tried different templates. Why?

Thank you.

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