Пример #1
0
 // Token: 0x060059C9 RID: 22985 RVA: 0x001F2844 File Offset: 0x001F0C44
 private void VidPlayer_errorReceived(VideoPlayer source, string message)
 {
     if (this.currentPlaylistIndex >= 0 && this.currentPlaylistIndex < this.playlist.Length)
     {
         VRC_SyncVideoPlayer.VideoEntry videoEntry = this.syncVid.Videos[this.currentPlaylistIndex];
         if (videoEntry.Source == VideoSource.Url)
         {
             this.foundURIs[videoEntry.URL].RemoveAt(0);
             if (this.foundURIs[videoEntry.URL].Count > 0)
             {
                 this.vidPlayer.url = this.foundURIs[videoEntry.URL].FirstOrDefault <string>();
                 if (this.isPlaying)
                 {
                     this.vidPlayer.Play();
                 }
                 return;
             }
         }
     }
     Debug.LogError(message);
     source.url = SyncVideoPlayer.silence;
 }
Пример #2
0
 // Token: 0x060059D3 RID: 22995 RVA: 0x001F2CA8 File Offset: 0x001F10A8
 public void SetVideoIndex(int i)
 {
     if (i >= 0 && i < this.syncVid.Videos.Length)
     {
         if (this.vidPlayer.isPlaying)
         {
             this.vidPlayer.Stop();
         }
         Debug.Log(base.name + " play index: " + i);
         this.currentPlaylistIndex = i;
         VRC_SyncVideoPlayer.VideoEntry videoEntry = this.syncVid.Videos[i];
         if (videoEntry.Source == VideoSource.Url)
         {
             this.vidPlayer.url = this.foundURIs[videoEntry.URL].FirstOrDefault <string>();
         }
         this.vidPlayer.source            = videoEntry.Source;
         this.vidPlayer.playbackSpeed     = videoEntry.PlaybackSpeed;
         this.vidPlayer.loopPointReached += this.TrackFinished;
         if (this.isPlaying)
         {
             this.vidPlayer.Play();
         }
     }
 }
Пример #3
0
        private void applyPlaylist()
        {
            savePlaylist();

            try
            {
                if (videoPlayers[videoPlayerSelected].GetComponent <VRC_SyncVideoPlayer>())
                {
                    VRC_SyncVideoPlayer videoPlayer = videoPlayers[videoPlayerSelected].GetComponent <VRC_SyncVideoPlayer>();

                    videoPlayer.Videos = null;

                    List <VRC_SyncVideoPlayer.VideoEntry> videos = new List <VRC_SyncVideoPlayer.VideoEntry>();

                    string[] links = selectedPlaylist.Contents.Split(new[] { '\r', '\n' });

                    foreach (string link in links)
                    {
                        VRC_SyncVideoPlayer.VideoEntry tmp = new VRC_SyncVideoPlayer.VideoEntry
                        {
                            Source        = UnityEngine.Video.VideoSource.Url,
                            PlaybackSpeed = 1.0f,
                            AspectRatio   = UnityEngine.Video.VideoAspectRatio.FitInside,
                            URL           = link
                        };

                        videos.Add(tmp);
                    }

                    videoPlayer.Videos = videos.ToArray();
                }

                if (videoPlayers[videoPlayerSelected].GetComponent <VRC_SyncVideoStream>())
                {
                    VRC_SyncVideoStream videoPlayer = videoPlayers[videoPlayerSelected].GetComponent <VRC_SyncVideoStream>();

                    videoPlayer.Videos = null;

                    List <VRC_SyncVideoStream.VideoEntry> videos = new List <VRC_SyncVideoStream.VideoEntry>();

                    string[] links = selectedPlaylist.Contents.Split(new[] { '\r', '\n' });

                    foreach (string link in links)
                    {
                        VRC_SyncVideoStream.VideoEntry tmp = new VRC_SyncVideoStream.VideoEntry
                        {
                            Source        = UnityEngine.Video.VideoSource.Url,
                            PlaybackSpeed = 1.0f,
                            URL           = link
                        };
                        videos.Add(tmp);
                    }

                    videoPlayer.Videos = videos.ToArray();
                }

                ShowNotification(new GUIContent(notification));
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
                ShowNotification(new GUIContent("Could not create playlist"));
            }
        }