OSMF & Strobe Media Playback insert subtitles (xml, srt)

First off I need to explain that the srt support comes from converting the .srt file into .xml

The xml structure that must be achieved is the following:

[cc lang=”XML”]

At the left we can see…

At the right we can see the…


and the source XML is here: sample.xml

If I can convince my friend that did the conversion script from .srt to XML to release his code I will post it here too. But it should not be difficult just make sure to convert frames into seconds. (Flowplayer captions plugin source code can help a lot with this).

Tagged , , , , , , . Bookmark the permalink.

10 Responses to OSMF & Strobe Media Playback insert subtitles (xml, srt)

  1. Thanks for the post. Very nice. I needed something like that but I ended up using the REOPS based player since SMP didn’t support captioning out of the box and REOPS OSMF does.

    For SRT to XML though there is this for OS X

    SRT to DXFP tool

  2. Javier says:

    You have provided me the job.
    Thank you very much.

  3. Starchicken says:


    Tks for sharing this. I do not understand something. Why have you converted a srt to xml. I think you could do the same by parsing a srt file… do you ?

    ex : http://blog.base42.nl/2009/07/29/as3-srt-subtitle-parser/

  4. coder says:

    Basically I wanted to convert a batch of files, and php does that on the server. However I believe something like that (a parse from srt with php) is possible.

    Doing it in the client is too much work and the subtitles might end up losing sync because of the background processing…

  5. aravindakumar says:

    Hi ,
    Can you post the full source code?

  6. coder says:

    Well believe it or not, this is the full code, I simply add these functions to the Strobe OSMF main class and play from there. These cover the part of the call to the server, the handling of the response and the creation of cue points on the video. These functions are made to work on their own with little tweaking. I also think that nowadays the OSMF platform offers an example with their own implementation of subtitles (although I never liked that way….), but make sure to check it out as it is the “official” way of handling subtitles.

  7. Pablo says:

    Is there any example we could check to see how it works ?



  8. Unfortunately I don’t have some sample anymore, besides OSMF had some major updates since this post was published and I’m not sure that captions still work like that anymore.

  9. David says:

    why do you use another var “subitem” but not a member var “subtext”?

  10. Because subtext is a private var and thus not accessible from other classes. Subitem is a public var and exposes “subtext” properties.

    But one could use this.getChildByName(‘subtext’); to reference subtext…

    I hope it hepls.

Leave a Reply

Your email address will not be published. Required fields are marked *