Microsoft Media Platform Player Framework for windows 8 – closed caption support

This blog is for demoing how to add closed caption for video by using Microsoft Media Platform Player Framework (MMPPF). MMPPF supports both Plain text and Timed Text closed caption.

This sample is build with Windows 8 RTM and Player framework preview 5, using Visual Studio 2012 RTM.

1. Open Visual studio 2012, Select File -> New -> Project…, Choose under JavaScript -> Blank App.

2. In Solution Explorer, right click on Reference folder, and select Add Reference…

You need to add  Microsoft Media Platform:Player Framework and Microsoft Media Platform: Player Framework Timed Text Plugin. For this sample, I will be using a .Mp4 source file for progressive download. If you are having a Smooth Streaming video source, you will need to add plugin Microsoft Media Platform: Player Framework Adaptive Streaming.

Player framework uses Plugin Architecture. You only need to install the reference library when you needed.

3. Add two TTML files into the project. Here I have a subtitle file in English and one in Spanish. Please download here.

4. Double click on default.html and we need to add library reference to use those plugins. After app reference and please add the following code:

5. Now add TTML closed caption and video src as properties through data-win-options for JavaScript control.

6. If you take a look at the sample TTML file, for instance, timedtext-captions.es.xml. It has styling support. You could define styling in <Styling> tag, define each region with styling and assign each caption into different region. Here is fragment of TTML file.

7. Now you could press F5 and enjoy a sample .mp4 video with both English and Spanish closed caption. You could see these two video have different subtitle styling.

You could download this project here.

Microsoft Media Platform Player Framework is an opensource project, led by Tim Greenfield.

4 Responses to Microsoft Media Platform Player Framework for windows 8 – closed caption support
  1. Huy Tran Reply

    Hi Ming,
    I did it, but can’t see the caption area below the video. I built it by VS2012 RTM and Windows 8 RTM.

    • eran Reply

      Hi,

      I Updated the last version of the Player Framework for Windows 8 (Preview 7)

      and suddenly it does not appear any more in my video player…

      It was and dissapear afther the update…

  2. [...] • Microsoft Media Platform Player Framework for windows 8 – closed caption support (link) [...]... mingfeiy.com/building-video-application-on-windows-8-all-you-need-to-know
  3. [...] Part 3: Microsoft Media Platform Player Framework for windows 8 – closed caption support (link) [...]... mingfeiy.com/media-services-for-build-2012

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">