I am retrieving SMPTE
Timed Text xml files remotely which I need to parse and draw to a surface as captions.
The full file format is defined here:
https://www.smpte.org/sites/default/files/st2052-1-2010.pdf
The xml looks like this:
<tt xmlns="http://www.w3.org/ns/ttml">
<head>
...
</head>
<body>
<p begin="00:00:33:03" end="00:00:37:24" region="pop1" style="basic" tts:origin="20% 79.33%" tts:extent="60% 5.33%">It is on a little world,</p>
<p begin="00:01:29:23" end="00:01:31:10" region="pop2" style="basic" tts:origin="30% 84.67%" tts:extent="50% 5.33%">GIVING INSTRUCTIONS)</p>
...
</body>
</tt>
Basically each p
tag defined a time and position and some text to draw. I haven't been able to find any native or third party libraries to help with this on android.
I'm looking for a library to read the xml file into an organized data structure of some sort. From there I can handle the drawing if need be.
Any pointers would be helpful before I start writing it myself, as taking into account all the different arguments can become quite involved.
Thankyou.
I was able to use the simple library to marshal into the following classes. Setters and getters removed for brevity. At this point the code is just a proof of concept, but you get the idea.
Caption.java
TimedText.java