Configuration Files for Silverlight HVP - Jesse Liberty - Silverlight Geek Page view counter

Configuration Files for Silverlight HVP

MiniTutorialLogo

SLHvpLogo
This mini-tutorial is part of the Silverlight HyperVideo Project documentation.

Taking Risks

One of the great pleasures, and total terrors of documenting this open-source application is that occasionally I have to offer up some half-baked ideas that risk displaying how little I know about a particular topic, but which are necessary to generate discussion. Caveat: this is such an entry.  I could have put this into the project documentation but I saw an opportunity to widen the audience on a topic that is important to Silverlight Programmers, even if not part of Silverlight itself.

Goal

 

We want the modules in the Silverlight HVP to be as flexibile as possible. Towards that end we’ve adopted two strategies:

  • Using the Managed Extensibility Framework (MEF) to make every module composable and extensible.
  • Using XML files to provide Just In Time configuration for each module.

XML Schemas

It will greatly simplify everyone’s work if we have agreed upon schemas, at least for the configuration files we know about:

  • slhvpInit.xml – initialize the application
  • slhvpTOC.xml – create a table of contents for a video
  • slhvpLinks.xml – establish which links will appear while a video runs and what to do when the user clicks on each

As a necessary first step, I’ve sketched out examples of slhvpTOC.xml and slhvpLinks.xml – these are not intended to be complete, but to generate discussion. They are posted here as a way to invite more folks into that discussion.

slhvpTOC.xml (draft example)

   1: <?xml version="1.0" encoding="utf-8"?>
   2: <ConfigFile Name="TOC Configuration File" 
   3:             Guid="687DA074-8F94-43a9-AC23-46DF823F8A65"  
   4:             xmlns=http://slhvp.com/TOC>
   5:   <ConfigurationMetaData>
   6:     <Version>0.0.1</Version>
   7:     <Purpose Summary="Create a Table of Contents for a video" />
   8:     <![CDATA[
   9:     This configuration file is used to create the table of contents. The topics are listed as links, which cause
  10:   the video to seek forward or backward to the designated topic.
  11:     ]]>
  12:     <Module Name="slHVP Standard TOC Module version 0.1" 
  13:             Guid="D3E2AC2B-FD34-40b4-BC42-308F7956C7D9" />
  14:     <CreatedDate Format="AmericanShort" Date="01/01/2001" />
  15:     <Conditions>
  16:       <Condition Name="Advanced"
  17:                  Value="True" />
  18:     </Conditions>
  19:   </ConfigurationMetaData>
  20:  
  21:   <ConfigurationData>
  22:   <TOCEntries>
  23:     <TOC>
  24:       <Type> TOC </Type>
  25:       <SeekTo>
  26:         <SeekToTime>00:00:10:000</SeekToTime>
  27:       </SeekTo>
  28:       <Text> Introduction </Text>
  29:     </TOC>
  30:     <TOC>
  31:       <Type> TOC </Type>
  32:       <SeekTo>
  33:         <!-- Seek directly to an injected or existing marker -->
  34:         <SeekToMarker ID="LINQ" />
  35:       </SeekTo>
  36:       <Text> Introduction to LinQ </Text>
  37:     </TOC>
  38:     <TOC>
  39:       <Type> TOC </Type>
  40:       <SeekTo>
  41:         <SeekToTime>00:20:10:010</SeekToTime>
  42:       </SeekTo>
  43:       <Text> MVVM </Text>
  44:       <!-- Designate that this entry in toc is only idsplayed if 
  45:       the Advanced condition has been set to true -->
  46:       <Visibility Condition="Advanced" RequiredValue="True" />
  47:     </TOC>
  48:   </TOCEntries>
  49:   </ConfigurationData>
  50: </ConfigFile>
  51:  

The file consists of a header (lines 2-4) and two major sections – the meta-data (lines 5-19) and the listing of the (abridged) Table of Contents entries (lines 22 – 48). Notice that the final TOC entry (lines 38-47) is visible only if the condition “Advanced” is set to true, which it is in the Conditions section int eh meta-data (lines 15-18.

slhvpLinks.xml (draft)

   1: <?xml version="1.0" encoding="utf-8"?>
   2: <ConfigFile Name="Links Configuration File" 
   3:             Guid="83ca650e-25ff-414d-adef-7aa790f9d858"  
   4:             xmlns="http://slhvp.com/Links">
   5:   <ConfigurationMetaData>
   6:     <Version>0.0.1</Version>
   7:     <Purpose Summary="Link time to hyperlink to action" />
   8:     <![CDATA[
   9:     This configuration file is used to create linkage among an elapsed time in a How Do I video with
  10:     the text of a new link to display at that time and then with the action to take based on the new link being clicked.
  11:     ]]>
  12:     <Module Name="slHVP Standard Link Module version 0.1" 
  13:             Guid="FB252D52-A603-4bf4-89C8-AA64E52D0343" />
  14:     <CreatedDate Format="AmericanShort" Date="01/01/2001" />
  15:     <Conditions />
  16:   </ConfigurationMetaData>
  17:  
  18:   <ConfigurationData>
  19:   <Links>
  20:     <Link>
  21:       <Type> Hyperlink </Type>
  22:       <Time>
  23:         <!--Time format is hh:mm:ss:msmsms-->
  24:         <StartTime>00:00:00:000</StartTime>
  25:         <!--Undefined end time - visible to end of video-->
  26:         <EndTime>0</EndTime> 
  27:       </Time>
  28:       <Text> About this video </Text>
  29:       <Action> WebPage </Action>
  30:       <URL> http://jliberty.com/aboutHyperlink.htm </URL>
  31:     </Link>
  32:     <Link>
  33:       <Type> Hyperlink </Type>
  34:       <Time>
  35:         <StartTime>00:05:11:010</StartTime>
  36:         <!--End time of 0 or missing end time both mean no end time, run to end-->
  37:       </Time>
  38:       <Text> What is Linq </Text>
  39:       <Action> Video </Action>
  40:       <URL> http://silverlight.net/learn/video#103 </URL>
  41:     </Link>
  42:     <Link>
  43:       <Type> Hyperlink </Type>
  44:       <Time>
  45:         <StartTime>00:12:00:110</StartTime>
  46:       </Time>
  47:       <Text> Linq Programming Animation </Text>
  48:       <!-- video pauses and is replaced by animation frame -->
  49:       <Action> Animation </Action>
  50:       <!--Required either a URL or a guid to a frame-->
  51:       <GUID>
  52:         E40D045A-4AC4-4ea9-8501-58F0E0407F61
  53:       </GUID>
  54:     </Link>
  55:   </Links>
  56:   </ConfigurationData>
  57: </ConfigFile>
  58:  

You can see that this format is quite similar to the TOC format, and one open question is whether we need an inclusive schema.

In this file, each Link has a type, where some of the possible values are

  • HyperLink (link to a URL)
  • Animation (link to a frame that supports animation
  • Text (link to a frame that displays non-html text)

 

Purpose of this posting

To reiterate, briefly, I have two goals with this posting:

  1. Generate discussion about what needs to be in the configuration files and whether this is a reasonable starting point and
  2. Follow through on the implications of my thinking about markers, links, etc.

Note that this topic is also under discussion here which is a great place to continue the discussion.

Published Sunday, January 03, 2010 2:05 PM by jesseliberty

Comments

# Social comments and analytics for this post

This post was mentioned on Twitter by JesseLiberty: New blog post: http://tinyurl.com/ya9kltw - Configuration Files for Silvelright HVP - An invitation to XML experts and others to comment.

Sunday, January 03, 2010 2:55 PM by uberVU - social comments

# re: Configuration Files for Silvelright HVP

Why don't you start with an object model and build your player, then come back and build a serializer/deserializer for that object model?  Why try to lock down a file format so early when you haven't fully fleshed out the player and all its extensibility points in a working scenario?

Sunday, January 03, 2010 4:00 PM by rob.eisenberg

# Configuration Files for Silvelright HVP - Jesse Liberty &#8230; Silverlight Web

Pingback from  Configuration Files for Silvelright HVP - Jesse Liberty &#8230; Silverlight Web

# Configuration Files for Silvelright HVP - Jesse Liberty &#8230; Silverlight Blog

Pingback from  Configuration Files for Silvelright HVP - Jesse Liberty &#8230; Silverlight Blog

# Configuration Files for Silvelright HVP - Jesse Liberty &#8230; iSilverlight

Pingback from  Configuration Files for Silvelright HVP - Jesse Liberty &#8230; iSilverlight

# re: Configuration Files for Silvelright HVP

>>Why don't you start with an object model and build your player, then come back and build a serializer/deserializer for that object model?  Why try to lock down a file format so early when you haven't fully fleshed out the player and all its extensibility points in a working scenario? <<

A couple points. First the goal of the config files is not to serialize or deserialize the player, unless i'm completely misunderstanding you.

Second, the core object architecture is now understood and will be documented over the next couple days, but we understand pretty well that we'll be building a viewer that will contain frames, where frames contain one or more control. The first frame will be derived from the SMF player.  We'll also have a TOC object and a LinksDisplay object, and we have a pretty good idea of what they look like.

It also turns out that WL has a developer who is about ready to show me a first cut at this, complete with a more robust configuration file approach.

Our overall methodology is somewhat lean; designing what we need pretty much just as we need it, and given that the first version needs to be ready in about 2 months, this is appropriate.

I'm not trying to shut down your comment, just responding about my thinking; I'm very open to hearing ways any of this can be improved.

Sunday, January 03, 2010 11:18 PM by jesseliberty

# re: Configuration Files for Silvelright HVP

* Update - just published the emerging design and feature list: http://slhvp.com/wikipage?title=Emerging">slhvp.com/wikipage

Please do review and add comments to the Discussion area on http://slhvp.com

Thanks.

Sunday, January 03, 2010 11:40 PM by jesseliberty

# Daily tech links for .net and related technologies - Jan 4-6, 2010

Daily tech links for .net and related technologies - Jan 4-6, 2010 Web Development Thoughts on ASP.NET

Tuesday, January 05, 2010 1:12 AM by Sanjeev Agarwal

# NFL Week 17 Review: Baltimore Ravens @ Oakland Raiders &#8211; Fourth &#8230; | Oakland Raiders NFL Announcer

Pingback from  NFL Week 17 Review: Baltimore Ravens @ Oakland Raiders &#8211; Fourth &#8230; | Oakland Raiders NFL Announcer