UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

Support for WebVTT Cue Settings

Open christianYS opened this issue 4 years ago • 1 comments

AvPro supports displaying WebVTT subtitles when streaming with HLS (supported platforms are shown in the documentation). However, only the text is available for displaying. WebVTT format allows to specify extra settings for controlling the appearance of the text cue on the screen, which is not supported by AvPro. these settings are: vertical, line, position, size, align. A more in-deep description of these settings can be found here

Example 1:

WEBVTT

1
00:00:00.000 --> 00:00:04.000 position:10%,line-left align:left size:35%
A Long Time Ago in a Galaxy Far, Far Away... 

Example 2: The Apple BipBop example has WebVTT subtitles with Cue Settings. https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8

Describe the solution you'd like I'd like to have a way to access the Cue Settings together with the text Cue. For example, they can be included in the class TextCue as a List<CueSetting>, where CueSetting would represent a single cue setting.

Describe alternatives you've considered An alternative solution would be to serve subtitles that contain custom tags, for example <settings size:30%, align:left>Subtitle here</settings> and then write a custom parser for them. But this approach would not work if we had to display the content with a different player, or we have to show an already existing stream we don't have control over.

christianYS avatar Oct 08 '21 11:10 christianYS

This may be possible on Windows by adding support for this API: https://docs.microsoft.com/en-us/windows/win32/api/mfmediaengine/nn-mfmediaengine-imftimedtextregion

AndrewRH avatar Oct 10 '21 21:10 AndrewRH