public void PlayNormalVideo(VideoInfo video)
 {
     m_ScreenController.SetScreenType(m_ScreenController.GetScreenType(video.videoType));
     m_Player.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, NRealTool.GetNrealResPath() + "/" + video.videoPath);
     videoNameTxt.text = video.videoName;
     //m_ScreenChangeBtn.gameObject.SetActive(false);
     Messenger.Broadcast(VideoPlayEvent);
 }
Esempio n. 2
0
        public void SetData(VideoInfo info)
        {
            this._videoInfo  = info;
            m_VideoName.text = info.videoName;
            m_Descripe.text  = info.describe;

            if (_videoInfo != null && !string.IsNullOrEmpty(_videoInfo.thumbnail))
            {
                StartCoroutine(LoadThumnail(NRealTool.GetNrealResPath() + "/" + _videoInfo.thumbnail));
            }
        }
 private IEnumerator LoadVideoList()
 {
     string path = NRealTool.GetNrealResPath() + "/MultiScreenVideoList/MultiScreenVideoConfig.xml";
     WWW www = new WWW(path);
     yield return www;
     if (www.isDone && string.IsNullOrEmpty(www.error))
     {
         videoConfig = XmlSerializeHelper.DeSerialize<VideoConfig>(www.text);
         CreateVideoItems();
         www.Dispose();
         www = null;
     }
     else
     {
         NRDebug.LogError(www.error);
     }
 }
    IEnumerator LoadThumbTexByIndex(int index)
    {
        string path = NRealTool.GetNrealResPath() + "/" + videoConfig.videos[index].thumbnail + ".jpg";
        WWW    www  = new WWW(path);

        yield return(www);

        if (www.isDone && string.IsNullOrEmpty(www.error))
        {
            m_ThumbTexDict.Add(videoConfig.videos[index].thumbnail, www.texture);
            www.Dispose();
            www = null;
        }
        else
        {
            Debug.LogError(www.error);
        }
    }
        private void Update()
        {
            if (isPlaying)
            {
                currentTime       += Time.deltaTime;
                m_Slider.value     = currentTime * 1000 / (long)m_Player.Info.GetDurationMs();
                m_CurrentTime.text = NRealTool.GetTimeByMSeconds((long)(currentTime * 1000)) + " / " + NRealTool.GetTimeByMSeconds((long)m_Player.Info.GetDurationMs());
            }

            if (Input.GetKeyUp(KeyCode.Space))
            {
                OnPlayBtnClick(null);
            }

            if (NRInput.GetButtonDown(ControllerButton.HOME))
            {
                CancleLock();
            }
        }
Esempio n. 6
0
    private void PlayHoverVideo()
    {
        string hoverPath = "";

        try
        {
            hoverPath = NRealTool.GetNrealResPath() + "/" + m_CurrentBindPlayer.Info.videoPath;
            hoverPath = hoverPath.Replace(@"/Videos/", @"/HoverVideos/").Replace(".mp4", "_hover.mp4");
        }
        catch (System.Exception e)
        {
            Debug.LogError(e.ToString());
            hoverPath = "";
        }
        if (!string.IsNullOrEmpty(hoverPath))
        {
            m_VideoPlayer.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, hoverPath);
            m_VideoPlayer.Play();
        }
    }
        public void PlayVideo(VideoInfo video)
        {
            m_ScreenController.SetScreenType(m_ScreenController.GetScreenType(video.videoType));
            //string path = System.IO.Path.Combine(Application.streamingAssetsPath, video.videoPath);
            //Debug.LogError(path);
            Debug.Log("start load video:" + video.videoPath);
            m_Player.m_VideoPath = video.videoPath;
            m_Player.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, NRealTool.GetNrealResPath() + "/" + video.videoPath, true);
            Messenger.Broadcast(VideoPlayEvent);

            //特殊逻辑,FOV这个视频需要锁屏
            if (video.videoPath.Contains("FOV"))
            {
                LockScreen(true);
                //GameObject.Find("ARCameraManager").GetComponent<StereoCameraParam>().SwitchCameraParam(true);
            }
            else
            {
                LockScreen(false);
            }
        }
Esempio n. 8
0
    public IEnumerator LoadThumnail()
    {
        if (Info == null || string.IsNullOrEmpty(Info.thumbnail))
        {
            yield break;
        }
        string path = NRealTool.GetNrealResPath() + "/" + Info.thumbnail + ".jpg";
        WWW    www  = new WWW(path);

        yield return(www);

        if (www.isDone && string.IsNullOrEmpty(www.error))
        {
            m_Render.material.mainTexture = www.texture;
            www.Dispose();
            www = null;
        }
        else
        {
            Debug.LogError(www.error);
        }
    }