microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.34k stars 677 forks source link

Caption files (.WebVTT and .SRT) that have positional information, cause caption to appear off screen or are ignored #8044

Open lbracegirdle opened 1 year ago

lbracegirdle commented 1 year ago

Describe the bug

When a VTT (WebVTT) file contains positional information for the caption, the styling causes the MediaElement to display the caption off centre.

The same issue occurs if you use a .srt caption file. Any markers in the file (e.g. {\an8} ) are ignored.

Steps to reproduce the bug

  1. Use a MediaElement to display an mp4 video and attach a TimedTextSource that is a WebVTT caption file.
  2. In the caption file, use positional information for a timed caption to request it is displayed any other location than bottom centre (the default position). In WebVTT this will look similar to this extract (Note the line:10% to position the caption at the top to the timed caption)
    00:00:18.034 --> 00:00:20.070 line:10% position:50% align:center
    Caption Text
  3. Run the application. Play the video file and enable the captions. When the caption is displayed, it will be off the screen, not at the top center.

A working project (based on the UWP Samples repo to demonstrate the MediaElement) has been adapted to experiment and repro the bug.

You can download the code for this adapted repo here to try the repro on your own system: https://github.com/lbracegirdle/UWPVideoCaptionRepro

Expected behavior

When positional data is included in a WebVTT caption file (e.g. line:10%), it should display the caption in the location requested, not off screen or ignore the positional data all together.

When positional data is included in a SRT caption file (e.g. {\an8}), it should display the caption in the location requested, not off screen or ignore the positional data all together.

Screenshots

CaptionsRepro CpatinOffScreen

NuGet package version

None

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

karlingen commented 1 year ago

+1

velocitysystems commented 1 year ago

Good find @lbracegirdle. This definitely needs to be fixed.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

lbracegirdle commented 1 year ago

@gabbybilka Just commenting on this to keep alive as it's still an issue.

lbracegirdle commented 1 year ago

HI @gabbybilka Could you advise if this has been scheduled to fix at any point? Its still an issue affecting the captions on videos, where it ignores the instructions for on-screen positions in the .vtt or .srt file.

gabbybilka commented 1 year ago

Fwding to @bpulliam @chigy for next steps.

paranoiddroid42 commented 7 months ago

@gabbybilka @bpulliam @chigy Is there any update on when this might be looked at? Its an issue when conveying information in a video to those using subtitles, when an on screen 'name badge' or graphic conveys information that the subtitles hide in their default bottom centre position. Thanks