Beispiel #1
0
        public SignDemonstration(Sign tappedSign)
        {
            // BindingContexts allow the object to be used within the XAML file
            BindingContext = tappedSign;

            InitializeComponent();

            // Prep the VideoPlayer with the correct video file
            sign = tappedSign;
            videoPlayer.Source = VideoSource.FromResource(sign.Name + ".mp4");

            // Set up pause/play icons to switch based on player state
            videoPlayer.Paused += (object sender, VideoPlayerEventArgs e) => {
                videoButton.Source = "icon_play";
            };
            videoPlayer.Playing
                += (object sender, VideoPlayerEventArgs e) => {
                videoButton.Source = "icon_pause";
                };

            // Set up the play icon to reset when video completes
            videoPlayer.Completed += (object sender, VideoPlayerEventArgs e) => {
                videoButton.Source = "icon_play";
            };
        }
Beispiel #2
0
        /// <summary>
        /// Begins playing the demonstration video associated with this sign.
        ///
        /// The FlashCards are set up with two Grids, one on top of the other.
        /// This allows for the easy positioning of the video player right on
        /// top of the underlying "card."
        ///
        /// The underlying static image of the sign as well as its descriptive
        /// text is hidden from view, and the VideoPlayer is revealed. As
        /// defined in the cosntructor, the VideoPlayer will hide and the static
        /// information will reappear once the video terminates.
        ///
        /// </summary>
        private void DemonstrateSign(object sender, System.EventArgs e)
        {
            if (videoPlayer.State.Equals(PlayerState.Playing))
            {
                videoPlayer.Pause();
            }
            else if (videoPlayer.State.Equals(PlayerState.Paused))
            {
                videoPlayer.Play();
            }
            else
            {
                videoPlayer.AutoPlay = true; // So the video plays when loaded
                videoPlayer.Source   = VideoSource.FromResource(sign.Name + ".mp4");

                // Hide underlying text and static image
                signDescription.FadeTo(0.1, 300);
                signImage.FadeTo(0.1, 300);

                // Set up and start the video
                cardInVideoMode       = true;
                videoPlayer.Opacity   = 0;
                videoPlayer.IsVisible = true;
                videoPlayer.FadeTo(1, 200);
            }
        }
        internal void PlayIntro()
        {
            VideoPlayerView.Source = VideoSource.FromResource("AvanadeStudioIntro.mp4");

            VideoPlayerView.Play();
            this.ForceLayout();

            VideoPlayerView.VideoEnded += VideoPlayerView_IntroVideoEnded;
        }
Beispiel #4
0
        public VideoPage(Exhibition ex)
        {
            InitializeComponent();

            BindingContext = viewModel = new ExhibitsViewModel(ex);
            VideoSource vid = VideoSource.FromResource(ex.Exhibition_Video);

            videoPlayer.Source = vid;
        }
Beispiel #5
0
 /// <summary>
 /// Used by the FlashCardCarousel to completely hide a video when the
 /// user swipes away from a video to another card.
 /// </summary>
 internal void HideVideoAfterSwipe()
 {
     videoPlayer.Pause();
     signImage.Opacity       = 1;
     signDescription.Opacity = 1;
     cardInVideoMode         = false;
     videoPlayer.IsVisible   = false;
     videoPlayer.AutoPlay    = false;
     videoPlayer.Source      = VideoSource.FromResource(sign.Name + ".mp4");
 }
Beispiel #6
0
        public object ProvideValue(IServiceProvider serviceProvider)
        {
            if (Resource == null)
            {
                return(null);
            }
            var videoSource = VideoSource.FromResource(Resource);

            return(videoSource);
        }
        public override object ConvertFromInvariantString(string value)
        {
            if (!String.IsNullOrWhiteSpace(value))
            {
                Uri uri;
                return(Uri.TryCreate(value, UriKind.Absolute, out uri) && uri.Scheme != "file" ?
                       VideoSource.FromUri(value) : VideoSource.FromResource(value));
            }

            throw new InvalidOperationException("Cannot convert null or whitespace to ImageSource");
        }
Beispiel #8
0
        public numbers(string numberInput)

        {
            InitializeComponent();
            number = numberInput;

            if (number == "1")
            {
                videoPlayer.Source = VideoSource.FromResource("Numbers - 1.mp4");
            }

            else if (number == "2")
            {
                videoPlayer.Source = VideoSource.FromResource("Numbers - 2.mp4");
            }

            else if (number == "3")
            {
                videoPlayer.Source = VideoSource.FromResource("Numbers - 3.mp4");
            }

            else if (number == "4")
            {
                videoPlayer.Source = VideoSource.FromResource("Numbers - 4.mp4");
            }

            else if (number == "5")
            {
                videoPlayer.Source = VideoSource.FromResource("Numbers - 5.mp4");
            }

            else if (number == "6")
            {
                videoPlayer.Source = VideoSource.FromResource("Numbers - 6.mp4");
            }

            else if (number == "7")
            {
                videoPlayer.Source = VideoSource.FromResource("Numbers - 7.mp4");
            }

            else if (number == "8")
            {
                videoPlayer.Source = VideoSource.FromResource("Numbers - 8.mp4");
            }
            else if (number == "9")
            {
                videoPlayer.Source = VideoSource.FromResource("Numbers - 9.mp4");
            }
        }
Beispiel #9
0
 /// <summary>
 /// Togles whether the video is playing or paused.
 /// </summary>
 private void ToggleVideoPlayback(object sender, System.EventArgs e)
 {
     if (videoPlayer.State.Equals(PlayerState.Playing))
     {
         videoPlayer.Pause();
     }
     else if (videoPlayer.State.Equals(PlayerState.Paused))
     {
         videoPlayer.Play();
     }
     else if (videoPlayer.State.Equals(PlayerState.Completed))
     {
         videoPlayer.Source = VideoSource.FromResource(sign.Name + ".mp4");
     }
 }
        // Constructor for normal and hardcore game
        // recieves if it is a new game or saved game, the difficulty, and the player class
        public Game(bool continueGame, bool hardcore, CharacterClass charClass)
        {
            InitializeComponent();
            this.continueGame = continueGame;
            this.hardcore     = hardcore;
            this.charClass    = charClass;

            // Play music in background video because Urho will not play sounds on the second game
            VideoPlayer music = new VideoPlayer()
            {
                Source = VideoSource.FromResource("GameData/sounds/gameLoop.mp4"),
                AreTransportControlsEnabled = false,
                IsVisible = false
            };

            layout.Children.Add(music);
        }
        // Constructor for Schaub Mode
        // This will be called by the schaub mode button and does not need any parameters
        public Game()
        {
            InitializeComponent();
            continueGame = false;
            hardcore     = true;
            charClass    = CharacterClass.Schaub;
            cheat        = true;

            // Play music in background video because Urho will not play sounds on the second game
            VideoPlayer music = new VideoPlayer()
            {
                Source = VideoSource.FromResource("GameData/sounds/schaubGame.mp4"),
                AreTransportControlsEnabled = false,
                IsVisible = false
            };

            layout.Children.Add(music);
        }
Beispiel #12
0
        private VideoSource VideoSourceFromType(string videoSource, VideoType videoType)
        {
            VideoSource source = null;

            if (videoType == VideoType.YouTube)
            {
                source = YouTubeVideoSourceConstructor(videoSource);
            }
            else if (videoType == VideoType.Url)
            {
                source = VideoSource.FromUri(videoSource);
            }
            else if (videoType == VideoType.Resource)
            {
                source = VideoSource.FromResource(videoSource, resourceAssembly);
            }
            else if (videoType == VideoType.File)
            {
                source = VideoSource.FromFile(videoSource);
            }

            return(source);
        }
Beispiel #13
0
        public letters(string letterInput)

        {
            InitializeComponent();
            letter = letterInput;

            if (letter == "a")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - A.mp4");
            }
            else if (letter == "b")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - B.mp4");
            }
            else if (letter == "c")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - C.mp4");
            }
            else if (letter == "d")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - D.mp4");
            }
            else if (letter == "e")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - E.mp4");
            }
            else if (letter == "f")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - F.mp4");
            }
            else if (letter == "g")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - G.mp4");
            }
            else if (letter == "h")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - H.mp4");
            }
            else if (letter == "i")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - I.mp4");
            }
            else if (letter == "j")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - J.mp4");
            }
            else if (letter == "k")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - K.mp4");
            }
            else if (letter == "l")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - L.mp4");
            }
            else if (letter == "m")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - M.mp4");
            }
            else if (letter == "n")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - N.mp4");
            }
            else if (letter == "o")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - O.mp4");
            }
            else if (letter == "p")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - P.mp4");
            }
            else if (letter == "q")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - Q.mp4");
            }
            else if (letter == "r")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - R.mp4");
            }
            else if (letter == "s")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - S.mp4");
            }
            else if (letter == "t")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - T.mp4");
            }
            else if (letter == "u")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - U.mp4");
            }
            else if (letter == "v")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - V.mp4");
            }
            else if (letter == "w")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - W.mp4");
            }
            else if (letter == "x")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - X.mp4");
            }
            else if (letter == "y")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - Y.mp4");
            }
            else if (letter == "z")
            {
                videoPlayer.Source = VideoSource.FromResource("Alphabet - Z.mp4");
            }
        }
Beispiel #14
0
        public Greeting(string greetingInput)

        {
            InitializeComponent();
            string greeting = greetingInput;

            if (greeting == "Bad")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Bad.mp4");
            }

            else if (greeting == "Fabulous")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Fabulous.mp4");
            }
            else if (greeting == "FeelingGood")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Feeling Good.mp4");
            }
            else if (greeting == "Good")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Good.mp4");
            }
            else if (greeting == "GoodBye")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Goodbye.mp4");
            }
            else if (greeting == "Great")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Great.mp4");
            }
            else if (greeting == "Happy")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Happy.mp4");
            }
            else if (greeting == "Hello")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Hello.mp4");
            }
            else if (greeting == "HowAreYou")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - How Are You.mp4");
            }
            else if (greeting == "Name")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Name.mp4");
            }
            else if (greeting == "NiceToMeetYou")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Nice To Meet You.mp4");
            }
            else if (greeting == "Sad")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Sad.mp4");
            }
            else if (greeting == "SeeYouLater")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - See You Later.mp4");
            }
            else if (greeting == "Sick")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Sick.mp4");
            }
            else if (greeting == "Tired")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Tired.mp4");
            }
            else if (greeting == "Welcome")
            {
                videoPlayer.Source = VideoSource.FromResource("Greetings - Welcome.mp4");
            }
        }