Exemplo n.º 1
0
 public TvLocalStreaming(TvMenuFactory menuFact, PlayFunc playFunc)
 {
     path          = "C:/Users/giuli/Videos/";
     this.menuFact = menuFact;
     streamingTex  = Resources.Load("Images/SmartTv/LocalStreaming") as Texture2D;
     play          = playFunc;
 }
Exemplo n.º 2
0
        // Use this for initialization
        void Start()
        {
            // Creates component to render video.
            display = transform.Find("Display").gameObject;

            closeVideo = false;
            RenderTexture texture = new RenderTexture(1024, 720, 24);

            display.GetComponent <Renderer>().material.SetTexture("_MainTex", texture);
            audioSource = display.GetComponent <AudioSource>();
            player      = display.AddComponent <VideoPlayer>();

            player.playOnAwake      = false;
            audioSource.playOnAwake = false;

            //Set Audio Output to AudioSource
            player.audioOutputMode = VideoAudioOutputMode.AudioSource;

            // Cretes panel menu.
            menuFactory = GetComponent <TvMenuFactory>();
            apps        = new List <ITvApp> {
                new TvLocalStreaming(menuFactory, PlayVideo),
                new TvTwitter(display, menuFactory)
            };

            Menu currMenu = menuFactory.CreateMenu(TvMenuFactory.Type.PANEL_MENU, "main");

            foreach (ITvApp app in apps)
            {
                currMenu.AddMenuItem(new Menu.MenuItem(app.GetName(), app.GetTexture(), null), app.ItemCallback);
            }

            menuFactory.SetActiveMenu("main");

            // Go back in Menu view.
            KeyboardHandler.AddCallback(KeyboardHandler.Map.KEY_DOWN, KeyCode.Escape, menuFactory.GoBack);
            KeyboardHandler.AddCallback(KeyboardHandler.Map.KEY_DOWN, KeyCode.D, NextTab);
            KeyboardHandler.AddCallback(KeyboardHandler.Map.KEY_DOWN, KeyCode.A, PreviousTab);
        }
Exemplo n.º 3
0
 public TvTwitter(GameObject display, TvMenuFactory fact)
 {
     this.display  = display;
     this.menuFact = fact;
     this.texture  = Resources.Load("Images/SmartTv/Twitter") as Texture2D;
 }