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);
 }
        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);
        }
    }
Exemple #5
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);
            }
        }
Exemple #7
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);
        }
    }