WPF: Invalid track duration when playing video from url
Summary
When playing video from URL in WPF .net Core app, no Duration (=0) is available on Media and also no Length (=0) on MediaPlayer
Minimal project and steps to reproduce
In Loaded event handler:
Core.Initialize();
var libVLC = new LibVLC();
var media = new Media(libVLC, new Uri("PLACE HERE url source i.e. https://vip.3.dl.webshare.cz/.../video.avi", UriKind.Absolute));
media.DurationChanged += (s,e) => System.Diagnostics.Debug.WriteLine($"Duration: {e.Duration}");
var player = new MediaPlayer(libVLC);
player.LengthChanged += (s,e) => System.Diagnostics.Debug.WriteLine($"Length: {e.Length}");
Then run app and make video play. Then watch output window. Only change happened was from -1 to 0 for both properties
What is the current bug behavior?
Only change happened was from -1 to 0 for both properties
What is the expected correct behavior?
Correct media duration (length)
Does it work on other plaforms? Does it work with the official VLC apps?
When I call similar code on my desktop VLC using its HTTP api, I can see the media duration when playing video
Environment
- OS: WINDOWS 10
- Device: PC
- LibVLC version and architecture 3.0.11 (LibVLC.Windows)
- LibVLCSharp version 3.4.7