Captions not showing

Mar 16, 2011 at 9:14 PM

I create playlists at runtime from a RIA service.  The code snippet below shows how I'm doing this.
Reading through the howto's I modified my playlist create code to include setting the MarkerResource property of the PlayListItem.  

I have verified via Fiddler that the Source url that I set to my xml file does indeed get downloaded.  But, my captions never display.  Am I missing something?  

I have included the Plugins.TimedText, SmoothStreaming, and Progressive assemblies in my project.  If I add a reference to ClearTextCaptions assembly I see a black box but no captions.

        private IEnumerable<PlaylistItem> CreatePlayerPlayList( IEnumerable<ContentItem> items )
        {
            var playList = items.Select(m => new PlaylistItem
            {
                Title = m.Title,
                Description = m.Description,
                ThumbSource = new Uri(m.ThumbSource),
                MediaSource = new Uri(m.MediaSource),
                DeliveryMethod = m.IsAdaptiveStreaming ? DeliveryMethods.AdaptiveStreaming : DeliveryMethods.Streaming,
                MarkerResource = m.CaptionSources != null &&  m.CaptionSources.Count() > 0 ?
                m.CaptionSources.Select(caption => new MarkerResource { Source = new Uri(caption.Location + ".xml") }).SingleOrDefault() : null
            });

            return playList;
        }

Mar 16, 2011 at 11:16 PM

Ok so I figured out the captions file generated from Expression Encoder 4 SP1 does not work with SMF but the sample file does.  Is this a known issue?  Is there a workaround?

This file does not work...

 

<?xml version="1.0" encoding="utf-8"?>
<tt xmlns:tt="http://www.w3.org/ns/ttml" xmlns:ttm="http://www.w3.org/ns/ttml#metadata" xmlns:tts="http://www.w3.org/ns/ttml#styling" xmlns:ttp="http://www.w3.org/ns/ttml#parameter" xml:lang="en" xmlns="http://www.w3.org/ns/ttml">
  <tt:head>
    <tt:metadata>
      <ttm:title />
      <ttm:desc />
      <ttm:copyright />
    </tt:metadata>
    <tt:styling>
      <tt:style xml:id="backgroundStyle" tts:fontFamily="proportionalSansSerif" tts:fontSize="1.5c" tts:textAlign="center" tts:origin="0% 90%" tts:extent="100% 8%" tts:backgroundColor="rgba(0,0,0,0)" tts:displayAlign="center" />
      <tt:style xml:id="speakerStyle" tt:style="backgroundStyle" tts:color="white" tts:textOutline="0px 1px" tts:backgroundColor="transparent" />
    </tt:styling>
    <tt:layout>
      <tt:region xml:id="speaker" tt:style="speakerStyle" tts:zIndex="1" />
      <tt:region xml:id="background" tt:style="backgroundStyle" tts:zIndex="0" />
    </tt:layout>
  </tt:head>
  <tt:body>
    <tt:div>
      <tt:p tt:region="speaker" tt:begin="00:00:03:04" tt:end="00:00:04:02"> WELL, </tt:p>
      <tt:p tt:region="speaker" tt:begin="00:00:04:02" tt:end="00:00:04:04"></tt:p>
      <tt:p tt:region="speaker" tt:begin="00:00:04:04" tt:end="00:00:06:02"> THAT'S THE LAST OF IT. </tt:p>
      <tt:p tt:region="speaker" tt:begin="00:00:06:02" tt:end="00:00:06:04"></tt:p>
      <tt:p tt:region="speaker" tt:begin="00:00:06:04" tt:end="00:00:09:27"> I'M ALL PACKED AND READY TO GO. </tt:p>
      <tt:p tt:region="speaker" tt:begin="00:00:09:27" tt:end="00:00:09:29"></tt:p>
      <tt:p tt:region="speaker" tt:begin="00:00:09:29" tt:end="00:00:13:02"> EDWARD, YOU'RE FINALLY LEAVING THE NEST, </tt:p>
      <tt:p tt:region="speaker" tt:begin="00:00:13:02" tt:end="00:00:13:04"></tt:p>
      <tt:p tt:region="speaker" tt:begin="00:00:13:04" tt:end="00:00:17:08"> BUT THERE'S SOMETHING I WANT YOU TO KNOW, SON. </tt:p>
      <tt:p tt:region="speaker" tt:begin="00:00:17:08" tt:end="00:02:27:06"></tt:p>
    </tt:div>
  </tt:body>
</tt>

Coordinator
Mar 17, 2011 at 1:07 AM

andyb13, this is a known issue that will be fixed in the release scheduled around the MIX 2011 timeframe. The problem is that the text is displaying too small to see. The 'cell' unit specified by tts:fontSize="1.5c" is calculating to a extermely tiny pixel size. If you change the unit to px or bump the size up to 100c you should see the text.

Thanks for reporting this and sorry for the problem,

Tim Greenfield

Mar 17, 2011 at 3:36 PM

Thanks for the tip.  I modified my copy of TimedTextStyleParser.cs to fix this until a solution is available.  

                if (fontSize.EndsWith("c"))        {       fontSize = "15px";      }

I also noticed the file generated from Expression Encoder 4 does not have a background color for the captions.  White text on a transparent background doesn't show up very well...

Andy