Exemplo n.º 1
0
        private void PushNextVideo()
        {
            if (Queue.IsEmpty())
            {
                CurrentlyPlaying = null;
                return;
            }

            //1. Get the next video from the queue
            Video next = Queue.GiveNextVideo();

            //2. Set the path relative to the current running instance
            if (next.BasePath != null)
            {
                next.BasePath = Path.Combine(ResourcePath, next.BasePath);
            }
            if (next.OnScreenEndingPath != null)
            {
                next.OnScreenEndingPath = Path.Combine(ResourcePath, next.OnScreenEndingPath);
            }
            if (next.OffScreenEndingPath != null)
            {
                next.OffScreenEndingPath = Path.Combine(ResourcePath, next.OffScreenEndingPath);
            }

            //3. Check if the video is valid
            if (File.Exists(next.BasePath))
            {
                //4. Replace the field and order the screen to play
                CurrentlyPlaying = PlayingVideo.MakeFromVideo(next);
                CurrentlyPlaying.SetBase();
                Screen.PlayVideo(new Uri(next.BasePath));
            }
        }