Example #1
0
 void LiveItemClick(Transform button)
 {
     LauncherUIManager.instance.panelBackStatus = PanelBackStatus.LivePlayer;
     //  LivePlayerManager.instance.LiveVideoCanvasRoot.gameObject.SetActive(true );
     if (Application.platform == RuntimePlatform.Android)
     {
         VideoItem data = JsonDataManager.liceItemDic[button.name];
         AndroidAPI.StartActivityForUnityTV189(data.contentId, data.clickType, data.clickParam, data.title, 0);
         // SceneManager.LoadScene("PlayerLive");
     }
     else
     {
         LivePlayDisplay();
         // SceneManager.LoadScene("PlayerLive", LoadSceneMode.Single);
         // mediaPlayerCtrl.Load(MediaPlayerCtrl.m_videoID);
     }
 }
Example #2
0
    private void PlayVideoClick()
    {
        //  if (Application.platform == RuntimePlatform.WindowsEditor)
        //  {
        Transform VideoPlayFather = GameObject.Find("VideoPlayFather").transform;

        //处于哪种场景状态也更新
        if (SceneManager.GetActiveScene().name == "Main")
        {
            SceneStatus.sceneEnum = SceneEnum.Main;

            TV189MsgReciver.instance.mediaPlayerCtrl =
                VideoPlayFather.Find("Cinema/VideoScreen").GetComponent <MediaPlayerCtrl>();
        }
        else
        {
            SceneStatus.sceneEnum = SceneEnum.MainVR;
            if (LauncherUIManager.instance.columnType == ColumnType.VR)    //vr播放情况
            {
                TV189MsgReciver.instance.mediaPlayerCtrl =
                    VideoPlayFather.Find("VideoScreenVR").GetComponent <MediaPlayerCtrl>();
            }
            else
            {
                TV189MsgReciver.instance.mediaPlayerCtrl =
                    VideoPlayFather.Find("Cinema/VideoScreen").GetComponent <MediaPlayerCtrl>();
            }
        }


        // }

        if (Application.platform == RuntimePlatform.WindowsEditor)
        {
            TV189MsgReciver.instance.mediaPlayerCtrl.Load(MediaPlayerCtrl.m_videoID);
        }

        if (Application.internetReachability == NetworkReachability.NotReachable)
        {
            Debug.Log("no intent content");
            //GameObject.Find("Directional Light").GetComponent<Main>().toast("网络无连接");
            return;
        }
        if (LauncherUIManager.instance.columnType == ColumnType.RecommendVideo)
        {
            VideoItem data = JsonDataManager.VideosDic[JsonDataManager.currentId];
            Debug.Log("data.clickParam:" + data.clickParam);
            if (Application.platform == RuntimePlatform.Android)
            {
                AndroidAPI.StartActivityForUnityTV189(data.contentId, data.clickType, data.clickParam, data.title, 0);
            }
            VideoDetailRoot.gameObject.SetActive(false);


            if (SceneManager.GetActiveScene().name == "MainVR")
            {
                LightManger.instance.VideoCanvasRootVR.SetActive(false);
                LightManger.instance.VideoScreen.SetActive(true);
                LightManger.instance.VideoScreenVR.SetActive(false);
                LightManger.instance.VideoCanvasRoot.SetActive(true);
            }
            else
            {
                Transform videoCanvas = GameObject.Find("UI/VideoCanvas").transform;
                videoCanvas.Find("VideoCanvasRoot").gameObject.SetActive(true);
                //  VideoUImanager.instance.VideoCanvasRoot.SetActive(true);
                LightManger.instance.VideoScreenVR.SetActive(false);
                LightManger.instance.VideoScreen.SetActive(true);
            }
        }
        else if (LauncherUIManager.instance.columnType == ColumnType.VR)
        {
            Debug.Log(" ColumnType.VR");
            VideoDetailRoot.gameObject.SetActive(false);
            ClassifyVideoItem item = TV189MsgReciver.classifyVideosDic[JsonDataManager.currentId];

            if (Application.platform == RuntimePlatform.Android)
            {
                int ClickParam = TV189MsgReciver.getClickParam(int.Parse(item.categoryId), int.Parse(item.contentType));

                AndroidAPI.StartActivityForUnityTV189(item.contentId, 0, "7", item.title, 0);
            }
            else//在window平台
            {
                //在vr界面
                if (SceneManager.GetActiveScene().name == "MainVR")
                {
                    LightManger.instance.VideoCanvasRootVR.SetActive(true);
                    LightManger.instance.VideoScreen.SetActive(false);
                    LightManger.instance.VideoScreenVR.SetActive(true);
                    LightManger.instance.VideoCanvasRoot.SetActive(false);
                }
                else
                {
                    SceneManager.LoadScene("PlayerVR");
                }
            }

            // VideoDetailRoot.gameObject.SetActive(false);
        }

        else
        {
            if (Application.platform == RuntimePlatform.Android)
            {
                ClassifyVideoItem item = TV189MsgReciver.classifyVideosDic[JsonDataManager.currentId];
                int ClickParam         = TV189MsgReciver.getClickParam(int.Parse(item.categoryId), int.Parse(item.contentType));

                AndroidAPI.StartActivityForUnityTV189(item.contentId, 0, ClickParam.ToString(), item.title, 0);

                //return;
            }


            VideoDetailRoot.gameObject.SetActive(false);
            GameObject.Find("VideoCanvas").transform.Find("VideoCanvasRoot").gameObject.SetActive(true);

            LightManger.instance.VideoScreenVR.SetActive(false);
            LightManger.instance.VideoScreen.SetActive(true);
        }
        //    VideoDetailRoot.gameObject.SetActive(false);
    }