| Comments
test

| Comments

[Warning: A total, off-the-grid post for normal topics here]

Today, after 2 pretty long days with my kids while the wife was out with friends, I had lost a lot of patience.  My daughter fell asleep in our bedroom as she does sometimes, and I was preparing to bring her into her room.  I usually go into her room first and get it all ready so that I can quietly just pick her up from ours and put her in her bed.

Tonight as I did this routine, I pulled the sheets back and discovered something poking out beneath her pillow.  This is what I pulled out:

IMG_4325

This was unsolicited.  Something she probably was drawing today while keeping herself busy.  A HUGE smile came across my face and my eyes teared up.  I am so humbled to have been rewarded in my life with such a wonderful spirit in my daughter and son.  It is small things like this in unconditional form that remind me about what life is about.

I love my family too, Zoe.

| Comments

In an email dialog today I saw someone asking how he could use an existing Encoder 2 template for existing media or streaming URIs when you don’t have something to encode.  After a few explanations, he replied that someone should blog this – and I agree :-).

So what did he mean?  Well, when you use Expression Encoder, you are typically going to be encoding media to a format to consume.  Encoder also gives you an additional option in the output settings to generate a media player for that encoded content.  These are all based on templates that I’ve previously written about that are available in the product as well is the source code for you to extend.

But what if you have a media file that doesn’t need encoding or you have a streaming URI and you don’t need to encode anything, but want the player?  To some it might not be so obvious so let me try to walk you through the steps.

You need the player

First you need the player.  The XAP that is, of the template you want to use.  There are essentially two ways of going about getting this:

    1. Getting the MediaPlayerTemplate.xap file from an existing output you already did (that used the same template you want)
    2. Building the XAP using the source of the templates and building it from scratch (requires .NET compiler or Visual Studio)

Obviously if you have the XAP of your desired template, you are ready to proceed.  If you don’t, then you’ll need to proceed to step 2.  Here’s what you’ll do:

Building the Player

First, find the template you want.  These are located in C:\Program Files\Microsoft Expression\Encoder 2\Templates\en (note: if you are on 64-bit or a different language, this path may differ slightly).  Within here you’ll see a list of templates by name.  Find the one you want and within that folder there is a Source directory.  That’s what you want.  I highly recommend actually moving the source files to a different place rather than edit directly in the templates directory.  There is a Visual Studio 2008 solution/project file in there and you can open it up and compile. 

As long as you are in there…

If you don’t need all the features of the template (i.e., Adaptive Streaming, etc) consider reading James Clarke’s post on removing some of those references and still creating the same template, but with reduced functionality.

Once compiled (remember to choose the right configuration - i.e., Release, Debug - for your needs), you’ll have in the Bin directory of that project the MediaPlayerTemplate.xap file you need. 

Passing parameters

So how can you compile the player template without media?  The Encoder 2 Silvelright 2 templates are completely parameter driven.  If you notice in any existing encoded project output (look at the default.html file generated) you’ll see the object tag used to host the player.  It may look something like this:

   1: <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
   2:     <param name="source" value="MediaPlayerTemplate.xap"/>
   3:     <param name="onerror" value="onSilverlightError" />
   4:     <param name="initparams" value='autoplay=True,autoload=True,enablecaptions=True,muted=False,stretchmode=0,displaytimecode=False,playlist=&lt;playList><playListItems><playListItem title="Moonlight%201.0%20Install%20on%20OpenSuse" description="Screencast%20of%20Moonlight%20install%20on%20OpenSuse.%20%20Virtual%20image%20provided%20by%20http://susestudio.com." mediaSource="MoonlightInstall.wmv" adaptiveStreaming="False" thumbSource="" frameRate="14.9669006991039" width="800" height="600" ><chapters><chapter  position="9.674" thumbnailSource="MoonlightInstall_9.674.jpg" title="Silverlight%201.0%20Chess%20playback%20from%20Vertigo" /><chapter  position="13.967" thumbnailSource="MoonlightInstall_13.967.jpg" title="Standard%20Silverlight%20installer%20integrates%20with%20Moonlight%20install%20links." /><chapter  position="18.058" thumbnailSource="MoonlightInstall_18.058.jpg" title="Firefox%20first%20nag%20message%20to%20protect%20user%20from%20web%20installs." /><chapter  position="20.784" thumbnailSource="MoonlightInstall_20.784.jpg" title="Second%20Firefox%20nag%20message%20(plugin%20message%20from%20trusted%20sources)" /><chapter  position="24.543" thumbnailSource="MoonlightInstall_24.543.jpg" title="Plugin%20installation%20complete%252C%20Firefox%20restart" /><chapter  position="32.055" thumbnailSource="MoonlightInstall_32.055.jpg" title="Silverlight%201.0%20Chess%20now%20working%20with%20Linux/Moonlight" /><chapter  position="43.801" thumbnailSource="MoonlightInstall_43.801.jpg" title="Video.Show%20from%20Vertigo" /><chapter  position="46.675" thumbnailSource="MoonlightInstall_46.675.jpg" title="Launching%20a%20media%20player%20in%20Moonlight%20for%20first%20time" /><chapter  position="48.334" thumbnailSource="MoonlightInstall_48.334.jpg" title="Microsoft%20Media%20Pack%20(codecs)%20prompt%20for%20install" /><chapter  position="51.249" thumbnailSource="MoonlightInstall_51.249.jpg" title="Media%20Pack%20EULA" /><chapter  position="60.051" thumbnailSource="MoonlightInstall_60.051.jpg" title="Re-launch%20media%20player%20with%20Media%20Pack%20installed" /><chapter  position="71.010" thumbnailSource="MoonlightInstall_71.010.jpg" title="HD%20media%20playback%20via%20Moonlight%20on%20Linux" /><chapter  position="72.490" thumbnailSource="MoonlightInstall_72.490.jpg" title="Fullscreen%20mode" /><chapter  position="76.138" thumbnailSource="MoonlightInstall_76.138.jpg" title="Bubblemark%20application%20on%20Moonlight" /></chapters></playListItem></playListItems></playList>' />            
   5:     
   6:     <a href="http://go2.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
   7:          <img src="http://go2.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
   8:     </a>
   9: </object>
  10: <iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>

Notice the initParams option?  If you aren’t familiar, you can send Silverlight 2 applications parameters using this method.  There’s a video walk-through on using initParams you can view on the Silverlight community site.  The key area here (among the other options) for media URIs is the playlist parameter.  Singling that one out you’ll see the structure looks like this:

   1: <?xml version="1.0" encoding="utf-8" ?>
   2: <playList>
   3:   <playListItems>
   4:     <playListItem title="Moonlight%201.0%20Install%20on%20OpenSuse" description="Screencast%20of%20Moonlight%20install%20on%20OpenSuse.%20%20Virtual%20image%20provided%20by%20http://susestudio.com." mediaSource="MoonlightInstall.wmv" adaptiveStreaming="False" thumbSource="" frameRate="14.9669006991039" width="800" height="600" >
   5:       <chapters>
   6:         <chapter  position="9.674" thumbnailSource="MoonlightInstall_9.674.jpg" title="Silverlight%201.0%20Chess%20playback%20from%20Vertigo" />
   7:         <chapter  position="13.967" thumbnailSource="MoonlightInstall_13.967.jpg" title="Standard%20Silverlight%20installer%20integrates%20with%20Moonlight%20install%20links." />
   8:         <chapter  position="18.058" thumbnailSource="MoonlightInstall_18.058.jpg" title="Firefox%20first%20nag%20message%20to%20protect%20user%20from%20web%20installs." />
   9:         <chapter  position="20.784" thumbnailSource="MoonlightInstall_20.784.jpg" title="Second%20Firefox%20nag%20message%20(plugin%20message%20from%20trusted%20sources)" />
  10:         <chapter  position="24.543" thumbnailSource="MoonlightInstall_24.543.jpg" title="Plugin%20installation%20complete%252C%20Firefox%20restart" />
  11:         <chapter  position="32.055" thumbnailSource="MoonlightInstall_32.055.jpg" title="Silverlight%201.0%20Chess%20now%20working%20with%20Linux/Moonlight" />
  12:         <chapter  position="43.801" thumbnailSource="MoonlightInstall_43.801.jpg" title="Video.Show%20from%20Vertigo" />
  13:         <chapter  position="46.675" thumbnailSource="MoonlightInstall_46.675.jpg" title="Launching%20a%20media%20player%20in%20Moonlight%20for%20first%20time" />
  14:         <chapter  position="48.334" thumbnailSource="MoonlightInstall_48.334.jpg" title="Microsoft%20Media%20Pack%20(codecs)%20prompt%20for%20install" />
  15:         <chapter  position="51.249" thumbnailSource="MoonlightInstall_51.249.jpg" title="Media%20Pack%20EULA" />
  16:         <chapter  position="60.051" thumbnailSource="MoonlightInstall_60.051.jpg" title="Re-launch%20media%20player%20with%20Media%20Pack%20installed" />
  17:         <chapter  position="71.010" thumbnailSource="MoonlightInstall_71.010.jpg" title="HD%20media%20playback%20via%20Moonlight%20on%20Linux" />
  18:         <chapter  position="72.490" thumbnailSource="MoonlightInstall_72.490.jpg" title="Fullscreen%20mode" />
  19:         <chapter  position="76.138" thumbnailSource="MoonlightInstall_76.138.jpg" title="Bubblemark%20application%20on%20Moonlight" />
  20:       </chapters>
  21:     </playListItem>
  22:   </playListItems>
  23: </playList>

This sample above represents a single media file with chapter markers.  The bare minimum for a single media URI would be:

   1: <playList>
   2:   <playListItems>
   3:     <playListItem mediaSource="MoonlightInstall.wmv"></playListItem>
   4:   </playListItems>
   5: </playList>

So if you have a streaming URI (i.e., mms://mysite.com/live-baseball-game.asx) you would use this playlist structure:

   1: <playList>
   2:   <playListItems>
   3:     <playListItem mediaSource="mms://mysite.com/live-baseball-game.asx"></playListItem>
   4:   </playListItems>
   5: </playList>

and then in your HTML page you could have something like this for the full implementation (noting to use the appropriate width/height for your needs):

   1: <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
   2:     <param name="source" value="MediaPlayerTemplate.xap"/>
   3:     <param name="onerror" value="onSilverlightError" />
   4:     <param name="initparams" value='autoplay=True,autoload=True,enablecaptions=True,muted=False,stretchmode=0,displaytimecode=False,playlist=&lt;playList><playListItems><playListItem mediaSource="mms://mysite.com/live-baseball-game.asx"></playListItem></playListItems></playList>' />            
   5:     
   6:     <a href="http://go2.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
   7:          <img src="http://go2.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
   8:     </a>
   9: </object>
  10: <iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>

It is important to note that if you know the other parameters like framerate, etc. you should provide as much information you can for the playListItem node, but I’m just noting the bare minimum above.

Can I do this in code?

Yes, if you were using the media player in code you can still use this method in either XAML as noted in a previous post of mine or in code using something like this:

   1: public Page()
   2:         {
   3:             InitializeComponent();
   4:             Loaded += new RoutedEventHandler(Page_Loaded);
   5:         }
   6:  
   7:         void Page_Loaded(object sender, RoutedEventArgs e)
   8:         {
   9:             ExpressionMediaPlayer.MediaPlayer mp = new ExpressionMediaPlayer.MediaPlayer();
  10:             mp.Width = 800;
  11:             mp.Height = 600;
  12:             ExpressionMediaPlayer.PlaylistItem playListItem = new ExpressionMediaPlayer.PlaylistItem();
  13:             playListItem.MediaUrl = new Uri("mms://mysite.com/live-baseball-game.asx");
  14:             mp.Playlist.Add(playListItem);
  15:             LayoutRoot.Children.Add(mp);
  16:         }

I suspect people would not be using the code concept as much but I just wanted to point it out here.

Summary

So having the MediaPlayerTemplate.xap file is really all you need.  Anything else can be sent as parameters either via the object tag, the XAML control or in code.  This enables being able to really re-use the template you desire without having to run an encoder job just to get the template and change the code.

Hope this helps!

| Comments

I wish to tell you a story.  A while back I purchased a Nokia E71 mobile phone.  It’s one of the latest from Nokia and has been given rave reviews for a smart phone.  I ultimately didn’t like it as it wasn’t for me.  After a few weeks, I listed it on eBay as I’ve done approximately 100 times before with other items around the house.  Now the item sold quickly and sold for roughly USD $490.  I demand in my eBay listings that the buyers use PayPal and that they have a verified PayPal account and a verified PayPal address.  I figure this is the safest route for both parties.

The transaction was completed as it was many times before.  I received the funds in my PayPal account, got the notice, and promptly used the PayPal UPS shipping service to print a label and have the shipping fees deducted from my account.  The process took about < 5 minutes and I was happy…again, as I’ve been many times before…never an issue.  Remember this was a $400+ item and in a category that usually has a lot of fraud (electronics).  This was 29 NOV 2008 when this all happened.  Transaction complete, funds immediately available, shipped, UPS deducted fees…all fine.

Fast forward (but only about a month and a week).

Every month we try to go around our house and look for things we don’t use and either donate them locally or if we think we can sell them, we list them on eBay.  This is a practice I generally recommend.  I sold Dell computer manuals for $25 one time.  Just the manuals that come with your computer (which are worthless mostly)…amazing.  This time around I had a Russian replica submarine clock that I had bought about 11 years ago.  A quick check on eBay showed they were getting bought, so what the heck.  Here was my listing: Russian Submarine Clock Vostok Hammer/Sickle RARE (note: this link might not be available in 60 days).  It’s a clock.  Not even an automatic one, it requires being wound every 4 days or so.  Something substantially less “valuable” than modern day sought-after electronics I’d argue.  Keep this in mind for later reading.

It sold and the buyer paid via PayPal and was a verified buyer and a verified/confirmed address.  Note that both of these are required for seller/buyer protection for PayPal transactions – again, following the guidelines set forth.  I went through my normal process and began printing out the label.  While the screen said this:

The error message read this:

So I was thinking What gives? and called support.  As I was talking to them I noticed the header of the “details” page of the transaction:

Payment review?!  First time I’ve ever heard of it.  At first I was thinking this was a good thing and PayPal just protected me from fraud.  Then I read the link which details out the reasons why something would be “on hold”:

    • You have been an eBay member for less than 6 months, and you sell an item for more than $100
    • You have an eBay feedback score of less than 100, and you sell an item for more than $100
    • You have a buyer dissatisfaction percentage* greater than 5%
    • You have an average DSR of less than 4.5
    • You have received fewer than 20 Detailed Seller Ratings in the last 12 months
    • You are listing your item in a high-risk category such as gift certificates, video games, cell phones, computers, or consumer electronics.

None of which applied to me.  I was now livid and let the customer service supervisor (I had asked to escalate), Marie 6168, know how unappreciative I was of this and explained that even *if* I fell into one of those buckets why did my November transaction (which fell into the last bucket of electronics) give me no problems and was for an amount significantly greater?  Her answer then moved from explaining that I was “in review” because of one of the above to “it’s random.”  Great.  Warm feelings all around now.  I was also then told that my hand-crank wall clock with no electronics was flagged because it is a high-risk category.  LMAO!

NOTE: I’m curious if the actual flag was because of the word “Russian” in the title.  I’ve had problems with dealing with legitimate commerce with anything Russian related in the past because financial institutions are leery.  Even if this is the case, the buyer and seller followed all rules for verification for all systems (eBay and PayPal) and therefore doesn’t seem like the title of the item should throw a flag!

At this point I’m pretty pissed.  I was told by Marie 6168 that I wasn’t being forced into doing anything and didn’t have to ship the item.  WHAT?!  How is that?  By not shipping the item (or waiting for the hold to be released), the buyer gets screwed and leaves negative feedback and my eBay reputation takes a hit (something very important in eBay land).  I felt like my eBay reputation was being held hostage.

So at this point I’ve been informed:

    • I’ve sold something and the verified buyer has sent funds to the verified seller.
    • The funds have been put on hold and I don’t have access to them.
    • The funds will be released sometime within 21 days
    • That I should ship the item.

That’s right.  PayPal, as the broker of the funds, has received money for an item I sold.  Then they are asking me to go ahead and ship that item to the buyer.  WTF?!  How is this protection for me?  It seems the buyer is the only one protected.  They will ultimately get the goods and if there were any issues with the funds, I’d be out the goods.  How is that protection on my end AT ALL?

It looks like I’m not alone either based on a conversation at Get Satisfaction.  I was not afforded any opportunity to escalate any further beyond Marie 6168 despite my best attempts.  All I could get was an email address I was told to be the executive offices – [email protected].  I hope their reading this.

I feel as a verified/Premier customer of PayPal since 2000 and a customer of eBay since 1998 (with a 100% rating) that some discretion should have been made here and the funds should be available.  This idea of PayPal managing when I get funds based on their rules versus standard commerce is ridiculous.

The problem is that the eBay/PayPal relationship is almost a requirement for online auction commerce.  Where else are you going to go for a world of buyers and a broker, which up until now, helped put a protective wall between the money?  Craigslist?  Sure that’s fine, but I knew that my local market wasn’t big enough for a Russian Sub clock!

PayPal – you currently are on my suck list.  Whatever systems in place that automate this payment holding process need revisiting.  You’ve made a verified/premier/long-term customer who follows the rules very angry. 

Win me back.

UPDATE 1: I shipped the item from my local UPS store.  Cost me $7 more than if I would have used my UPS account tied to my PayPal account.  So this process has cost me additional money in addition to not receiving funds for my item yet.

| Comments

The source code for the Silverlight 2 controls was just published!  This is the source for the controls as shipped in the runtime and the SDK.  When you download the project you’ll see the structure:

Image of source project tree in Visual Studio

The source, released under the Microsoft Public License (Ms-PL), includes the source for the following controls in the runtime:

    • ButtonBase
    • Button
    • HyperlinkButton
    • CheckBox
    • RadioButton
    • ToggleButton
    • RangeBase
    • ProgressBar
    • Slider
    • ScrollBar
    • Thumb

and the following from the SDK (part of the Silverlight Tools for Visual Studio):

    • Calendar
    • DatePicker
    • DataGrid
    • TabControl
    • GridSplitter

Unit tests for the SDK controls have also been included as well!

With the release of this source code as well as having access to the source for the Silverlight Toolkit, you should have some great base implementations to extend and learn from!  Get the code here: Source code for Silverlight 2 controls.