VLC.Dotnet.WPF 控件拉伸纵向视频。如何让控件不拉伸视频。横向视频播放正常,当我在手机上录制视频时,例如 .mov 在纵向模式下它会拉伸视频。
如何在不被拉伸的情况下播放视频?有没有可以通过 CreatePlayer 方法的选项?
.xaml
<Grid>
<vlc:VlcControl x:Name="MediaPlayerOne"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
。CS
var currentAssembly = Assembly.GetEntryAssembly();
var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;
// Default installation path of VideoLAN.LibVLC.Windows
var libDirectory = new DirectoryInfo(Path.Combine(currentDirectory, "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64"));
MediaPlayerOne.SourceProvider.CreatePlayer(libDirectory);
MediaPlayerOne.SourceProvider.MediaPlayer.Play(new Uri("text.mov"));