I've created a custom CAF receiver for playing back MPEG-DASH content which is encrypted using Widewine. My content also has TTML subtitles embedded in the manifest which can be changed dynamically.
Playing my encrypted content works like a charm - even better than on the V2 receiver. I can even select between my different subtitles.
However, the positioning of the subtitles is way off. They aren't centered in they player and sometimes they're cut off in the middle of a cue (see my attached image).
I can tell that the CAF Receiver uses the shaka-player which, from what I can tell, handles parsing of subtitles itself - https://github.com/google/shaka-player/tree/master/lib/text
As far as I can tell from the CAF receiver documentation, there's no way of manipulating the positioning of the subtitles on the receiver. They aren't added to the DOM or anything, so you can't hack it with css. Only thing you can do is set a TextTrackStyle
on the TextTracksManager
, which only allows setting colors and the like. You have no option to do textAlign
or similar.
My questions:
- Is this a known bug in the CAF Receiver/shaka-player?
- Has anyone else had a similar problem? If so, did you manage to fix it?
Any help is greatly appreciated!
Example 1
ttml example:
<tt xmlns="http://www.w3.org/ns/ttml"
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"
xmlns:ebutts="urn:ebu:tt:style" xmlns:ebuttm="urn:ebu:tt:metadata"
xml:lang="" ttp:timeBase="media">
<head>
<metadata>
<ebuttm:documentMetadata>
<ebuttm:conformsToStandard>urn:ebu:tt:distribution:2014-01</ebuttm:conformsToStandard>
</ebuttm:documentMetadata>
</metadata>
<styling>
<style xml:id="Style0_0" tts:fontFamily="proportionalSansSerif" tts:backgroundColor="#00000099" tts:color="#FFFF00" tts:fontSize="100%" tts:lineHeight="normal" ebutts:linePadding="0.5c" />
<style xml:id="textAlignment_0" tts:textAlign="center" />
</styling>
<layout>
<region xml:id="Region" tts:origin="10% 10%" tts:extent="80% 80%" tts:displayAlign="after" />
</layout>
</head>
<body>
<div>
<p region="Region" style="textAlignment_0" begin="114:24:22.120" end="114:24:24.120" xml:id="sub_0">
<span style="Style0_0">Das hat sich im Grunde</span>
<br />
<span style="Style0_0">aus dem Spiel des Seins so ergeben.</span>
</p>
</div>
</body>
</tt>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…