Exemplo n.º 1
0
    void correctAnswer()
    {
        print("Correct!");
        mp.Play();
        this.hideQuestions();

        resultText.text = "Correct!";
        resultTimer     = MoviePlayer.timeElapsed + 2;
    }
        /// <summary>
        /// Start playing a movie on a seperate thread
        /// </summary>
        /// <param name="movie">Movie to play</param>
        /// <param name="resume">Ask user to resume?</param>
        private static void DoPlayMovie(DBMovieInfo movie, bool resume, int startPosition)
        {
            if (GUIGraphicsContext.form.InvokeRequired)
            {
                PlayMovieAsyncDelegate d = new PlayMovieAsyncDelegate(DoPlayMovie);
                GUIGraphicsContext.form.Invoke(d, new object[] { movie, resume, startPosition });
                return;
            }
            WifiRemote.LogMessage("Play movie (resume: " + resume + ", pos: " + startPosition, WifiRemote.LogType.Debug);

            // Clear resume
            if (!resume && movie.UserSettings != null && movie.UserSettings.Count > 0)
            {
                DBUserMovieSettings userSetting = movie.ActiveUserSettings;
                userSetting.ResumePart = 0;
                userSetting.ResumeTime = 0;
                userSetting.ResumeData = null;
                userSetting.Commit();
            }

            if (player == null)
            {
                player = new MoviePlayer(new MovingPicturesGUI());
            }
            player.Play(movie);

            if (!resume && startPosition > 0)
            {
                g_Player.SeekAbsolute(startPosition);
            }
        }
Exemplo n.º 3
0
        void ContentPreloadDidFinish(NSNotification obj)
        {
            // once the movie is ready, hide the spinner
            if (MoviePlayer.PlaybackState != MPMoviePlaybackState.Playing)
            {
                ActivityIndicator.Hidden = true;

                // jump to the spot that was preloaded.
                MoviePlayer.CurrentPlaybackTime = MoviePlayer.InitialPlaybackTime;

                MoviePlayer.Play( );

                // now that the content is preloaded, update our layout so that
                // we size the window according to the video dimensions.
                LayoutChanged( );

                if (AudioOnly)
                {
                    MessageAnalytic.Instance.Trigger(MessageAnalytic.Listen, Name);
                }
                else
                {
                    MessageAnalytic.Instance.Trigger(MessageAnalytic.Watch, Name);
                }
            }
        }
Exemplo n.º 4
0
        internal void PlayMovingPicture(int index)
        {
            if (moviePlayer == null)
            {
                moviePlayer = new MoviePlayer(new MovingPicturesGUI());
            }

            moviePlayer.Play((DBMovieInfo)latestMovingPictures[index]);
        }
Exemplo n.º 5
0
    IEnumerator StartSequence()
    {
        yield return(null);

        MoviePlayer.Play(Logo);
        yield return(new WaitWhile(MoviePlayer.IsPlaying));

        Permission1.TurnON();
        yield return(new WaitUntil(Permission1.IsDone));

        Permission1.TurnOFF();
        MoviePlayer.Play(IntroCommercial);
        yield return(new WaitWhile(MoviePlayer.IsPlaying));

        Daphne.TurnON();
        Runner.StartDialogue();
        DialogueCanvas.TurnON();
        yield return(null);
    }
Exemplo n.º 6
0
 public override void ViewDidAppear(bool animated)
 {
     base.ViewDidAppear(animated);
     if (MoviePlayer != null)
     {
         MoviePlayer.SourceType = MPMovieSourceType.Streaming;
         MoviePlayer.ContentUrl = Url;
         MoviePlayer.Play();
     }
 }
Exemplo n.º 7
0
 public void LogoEnded()
 {
     if (++currentLogo < gameLogos.Length)
     {
         gameLogos[currentLogo].Play();
     }
     else
     {
         gameMovie.Play();
     }
 }
Exemplo n.º 8
0
    // Use this for initialization
    void Start()
    {
        mp = movie.GetComponent <MoviePlayer> ();
        mp.Play();

        this.hideQuestions();

        //changeQuestionText ("Do this", "Do that", "Don't do anything", "Help, I'm stuck on this project");
        //correct = 2;

        Cursor.visible   = true;
        Cursor.lockState = CursorLockMode.None;

        this.hideQuestions();
    }
Exemplo n.º 9
0
 public void LogoEnded()
 {
     if (++currentLogo < gameLogos.Length)
     {
         gameLogos[currentLogo].Play();
     }
     else
     {
         if (gameMovie.movie != null)
         {
             gameMovie.Play();
         }
         else
         {
             FinishIntro();
         }
     }
 }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            DVDMovie lostArk = new DVDMovie
            {
                Title       = "Raiders of the Lost Ark",
                Genre       = "Action/Adventure",
                ReleaseDate = new DateTime(1980, 1, 1)
            };

            var player = new MoviePlayer();

            MoviePlayer.ShowHandler handler = PrintMessage;

            // subscribe to an event.
            player.Show += handler;

            // unsubscribe from an event.
            //player.Show -= handler;
            // now NO delegate is subscribed to the event!

            //player.Show += handler;

            MoviePlayer.ShowHandler handler2 = (string s) => Console.WriteLine(s);
            //void handler2(string s) => Console.WriteLine(s);

            handler2("Running handler2");

            Action <string> handler3 = (string s) => Console.WriteLine(s);

            var actionDict = new Dictionary <string, Action <string> >();

            player.Show += (string s) => Console.WriteLine("Handle with lambda");

            player.Show += (string s) =>
            {
                if (s.Length > 10)
                {
                    Console.WriteLine("long title");
                }
            };

            player.Play(lostArk);
        }
Exemplo n.º 11
0
 private void Media(FrameInfoKey key)
 {
     if (argus.MeidaHit(viewer.ResultCode))
     {
         frameNum += 60;
         if (!Catched)
         {
             playboxFlag = !playboxFlag;
             if (playboxFlag)
             {
                 moviePlayer.Play(true);
                 moviePlayer.PlayAudio(true);
             }
             else
             {
                 moviePlayer.Stop();
             }
         }
     }
 }