public LoadingResult StartLoad([NotNull] string path) { LoadingResult result = new LoadingResult(); lock (this.mpv) { this.mpv.FileLoaded += result.MpvOnFileLoaded; this.mpv.EndFile += result.MpvOnEndFile; this.mpv.SetPropertyString("pause", "yes"); this.mpv.Command("loadfile", path, "replace"); } return(result); }
public void FinalizeLoad(LoadingResult result) { if (result.Success) { this.IsPlaying = true; ReadTracks(); lock (this.mpv) { var durationSeconds = this.mpv.GetPropertyDouble("duration"); this.Duration = durationSeconds; this.mpv.FileLoaded -= result.MpvOnFileLoaded; this.mpv.EndFile -= result.MpvOnEndFile; this.HasVideo = this.VideoTracks.Any(); } } else { this.HasVideo = false; } }