Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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;
            }
        }