Example #1
0
        private void OpenVideoFile(string filename)
        {
            if (File.Exists(filename))
            {
                if (video == null)
                {
                    video         = VideoPlayer.FromFile(filename);
                    video.Ending += Video_Ending;
                }
                else
                {
                    video.Open(filename);
                }
            }
            else
            if (video == null)
            {
                video         = VideoPlayer.FromUrl(new Uri(filename));
                video.Ending += Video_Ending;
            }
            else
            {
                video.Open(new Uri(filename));
            }

            ContainsAudio       = false;
            trkPosition.Minimum = 0;
            trkPosition.Maximum = video.Duration;
            trkPosition.Value   = 0;
        }