This is a ffmpeg.autogen binding library, for wpf and avalonia.
in Avalonia,To enable extension should be present in your Program.cs file:
AppBuilder.Configure<App>()
.UsePlatformDetect()
.UseFFmpeg()
.LogToTrace();
then use the FFmpegView
in axaml or charp code, and you need handle audio stream here.
in Wpf,To enable extension should be present in your App.xaml.cs file:
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
BassCore.Initialize();
Core.Instance.Initialize();
}
then use the FFmpegView
in xaml,and you should set audio handle after InitializeComponent
like:
public MainWindow()
{
InitializeComponent();
playerView.SetAudioHandler(new NAudioStreamDecoder());
}
for http protocol header setting,just coding like
playerView.Play(url,headers);
playerView.SetHeader(headers);
for Audio Handle,you can use FFmpegView.Bass or FFmpegView.NAudio Bass:
var playerView = this.FindControl<FFmpegView>("playerView");
playerView.SetAudioHandler(new BassAudioStreamDecoder());
playerView.Play("http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4");
NAudio:
playerView.SetAudioHandler(new NAudioStreamDecoder());
you can use the MediaItem
class the define the resources info,coding like
var mediaItem = new MediaItem(url);
playerView.Play(mediaItem);