Пример #1
0
    private GameObject VideoTextureScreen; // Target Object to use this movie Texture

    #endregion Fields

    #region Methods

    // Functions ///////////////////////////////////////////////////////////////////////////////////////
    IEnumerator LoadVideo(zVideo loadTarget)
    {
        MediaPlayerCtrl vc = loadTarget.videoPlayerCtrl;    // mediaPlayerCtrl we will be messing with

        vc.Load(loadTarget.videoUrl);   // Load video

        while(vc.GetCurrentState() != MediaPlayerCtrl.MEDIAPLAYER_STATE.READY)
            yield return false;  // Wait until video has been loaded

        vc.Play();

        Debug.Log("Done");

        yield return true;
    }
Пример #2
0
    // Functions ///////////////////////////////////////////////////////////////////////////////////////
    IEnumerator LoadVideo(zVideo loadTarget)
    {
        MediaPlayerCtrl vc = loadTarget.videoPlayerCtrl; // mediaPlayerCtrl we will be messing with

        vc.Load(loadTarget.videoUrl);                    // Load video

        while (vc.GetCurrentState() != MediaPlayerCtrl.MEDIAPLAYER_STATE.READY)
        {
            yield return(false);  // Wait until video has been loaded
        }
        vc.Play();

        Debug.Log("Done");

        yield return(true);
    }
Пример #3
0
    void Start()
    {
        foreach(zVideo v in allVideos)
        {
            GameObject g = new GameObject();
            g.transform.parent = transform;
            g.AddComponent<MediaPlayerCtrl>();

            v.videoPlayerCtrl = g.GetComponent<MediaPlayerCtrl>();      //
            v.videoPlayerCtrl.m_strFileName = v.videoUrl;   // Setting each video's target path to the value passed into the list
            v.videoPlayerCtrl.m_TargetMaterial = new GameObject[1];
            v.videoPlayerCtrl.m_TargetMaterial[0] = VideoTextureScreen; // Setting video's screens. In this case only the one
            v.videoPlayerCtrl.m_bLoop = v.loop;             // Does Video loop
        }

        //currentVideo = allVideos[0];

        if(allVideos.Count > 0) // As long as there is something in the list of videos
        {
            currentVideo = allVideos[0]; // Set intial video
            StartCoroutine(LoadVideo(currentVideo));
        }
    }
Пример #4
0
    void Start()    // Use this for initialization
    {
        foreach (zVideo v in allVideos)
        {
            GameObject g = new GameObject();
            g.transform.parent = transform;
            g.AddComponent <MediaPlayerCtrl>();

            v.videoPlayerCtrl = g.GetComponent <MediaPlayerCtrl>();     //
            v.videoPlayerCtrl.m_strFileName       = v.videoUrl;         // Setting each video's target path to the value passed into the list
            v.videoPlayerCtrl.m_TargetMaterial    = new GameObject[1];
            v.videoPlayerCtrl.m_TargetMaterial[0] = VideoTextureScreen; // Setting video's screens. In this case only the one
            v.videoPlayerCtrl.m_bLoop             = v.loop;             // Does Video loop
        }

        //currentVideo = allVideos[0];

        if (allVideos.Count > 0)         // As long as there is something in the list of videos
        {
            currentVideo = allVideos[0]; // Set intial video
            StartCoroutine(LoadVideo(currentVideo));
        }
    }