Porter l'éditeur du replay sur Android

En portrait, le panneau des marques et des plages passe sous la vidéo
native. La barre native du replay affiche l'image pendant le glissement
(dernière position, au plus toutes les 60 ms). Les miniatures des marques
sont copiées depuis la surface native avec PixelCopy via la nouvelle
interface IVideoFrameCapture, l'instantané LibVLC ne lisant pas le
décodage matériel.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paul Schneider 2026-11-16 17:21:38 +00:00
commit 852f684d82
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
7 changed files with 157 additions and 16 deletions

View file

@ -1,5 +1,8 @@
using System.Net;
using Avalonia.Controls;
using Avalonia.Threading;
using PostIt.ViewModels;
using PostIt.Views.Blogs;
using Yavsc.Abstract.Streaming;
using Yavsc.Api.Client;
@ -178,6 +181,40 @@ public sealed class ReplayEditorTests(AvaloniaUiFixture ui)
return Task.CompletedTask;
}, TestContext.Current.CancellationToken);
[Fact]
public Task The_editor_stacks_its_panel_under_the_video_in_portrait()
=> ui.RunAsync(async () =>
{
var api = new DraftApi();
// Without a draft source the page skips the native player.
api.Podcast = api.Podcast with { Draft = api.Podcast.Draft! with { SourceBytes = 0 } };
var page = new ReplayEditorPage { DataContext = Editor(api) };
var nav = new NavigationPage();
await nav.PushAsync(page);
var window = new Window { Width = 360, Height = 800, Content = nav };
try
{
window.Show();
foreach (var (width, height) in new[] { (360, 800), (1000, 500), (360, 800) })
{
window.Width = width;
window.Height = height;
Dispatcher.UIThread.RunJobs();
window.UpdateLayout();
var wide = width >= height;
var grid = page.FindControl<Grid>("EditorGrid")!;
var panel = page.FindControl<ScrollViewer>("EditPanel")!;
Assert.Equal(wide ? 2 : 1, grid.ColumnDefinitions.Count);
Assert.Equal(wide ? 1 : 0, Grid.GetColumn(panel));
Assert.Equal(wide ? 1 : 4, Grid.GetRow(panel));
Assert.True(panel.Bounds.Top >= (wide ? 0 : page.FindControl<Border>("VideoBorder")!.Bounds.Bottom));
}
Assert.Contains("source du brouillon", page.FindControl<TextBlock>("PlaybackStatus")!.Text);
}
finally { window.Close(); }
}, TestContext.Current.CancellationToken);
private static ReplayEditorPageViewModel Editor(DraftApi api)
=> new(new PodcastApiClient(api, () => "https://api.example/"), api.Podcast);