-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video/Screen Frame Padding for Subtitle Display #389
Comments
Hi, |
Thanks a lot for the pointer, I'll try this now. |
Oh yeah, on winui 3 you will probably be blocked by microsoft/microsoft-ui-xaml#8973 Lovely, isn't it? |
Despicable...
That's the more important one. For Windows (i.e. non-xbox) we'll probably use mpv player anyway, but I'm targeting implementation for FFmpegInteropX as well, so we have two options available. |
So this can actually be solved without subclassing the MediaPlayerElement. If you locally override the style of the MediaPlayerElement, you can change the template in place <MediaPlayerElement.Style>
<Style TargetType="MediaPlayerElement">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MediaPlayerElement">
<Grid x:Name="LayoutRoot">
<Border Background="Transparent"/>
<MediaPlayerPresenter x:Name="MediaPlayerPresenter" IsFullWindow="{TemplateBinding IsFullWindow}" MediaPlayer="{TemplateBinding MediaPlayer}" Stretch="{TemplateBinding Stretch}"/>
<Image x:Name="PosterImage" Stretch="{TemplateBinding Stretch}" Source="{TemplateBinding PosterSource}" Visibility="Visible"/>
<ContentPresenter x:Name="TransportControlsPresenter" Visibility="{TemplateBinding AreTransportControlsEnabled}"/>
<Grid x:Name="TimedTextSourcePresenter"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</MediaPlayerElement.Style> You can then technically bind the TimedTextSourcePresenter to apply your padding. |
Hi,
do you have any way to set a padding at the screen or video frame level?
We have two values in our config which allow to set a minimum distance from the top and from the bottom for subtitle areas, so when the bottom value is 5%, no subtitles will be shown in that bottom 5% area.
Any idea how I can achieve this?
(easily would be good - LOL)
Thanks,
sw
The text was updated successfully, but these errors were encountered: