public void Setup(BaseMediaPlayer player)
        {
            BasePhotoPlayer photoPlayer = player as BasePhotoPlayer;

            gameObject.SetActive(photoPlayer != null);
            timer.enabled = false;
        }
Exemple #2
0
        public void Setup(BaseMediaPlayer player)
        {
            mediaPlayer = player;
            mediaPlayer.OnMediaScreenChanged += OnMediaScreenChanged;

            IPlaybackControl[] controls = GetComponentsInChildren <IPlaybackControl>(true);
            foreach (IPlaybackControl control in controls)
            {
                control.Setup(player);
            }

            RefreshLayout();
        }
        public void Setup(BaseMediaPlayer player)
        {
            mediaPlayer = player;
            videoPlayer = mediaPlayer as BaseVideoPlayer;

            // Stereo
            Assert.IsNotNull(monoToggle);
            monoToggle.onValueChanged.AddListener(OnMonoToggleChanged);
            Assert.IsNotNull(leftRightToggle);
            leftRightToggle.onValueChanged.AddListener(OnLeftRightToggleChanged);
            Assert.IsNotNull(topBottomToggle);
            topBottomToggle.onValueChanged.AddListener(OnTopBottomToggleChanged);

            // Make sure all Stereo toggles are in the same toggle group.
            Assert.IsTrue(monoToggle.group != null &&
                          monoToggle.group == leftRightToggle.group &&
                          monoToggle.group == topBottomToggle.group);

            // Projection
            Assert.IsNotNull(flatToggle);
            flatToggle.onValueChanged.AddListener(OnFlatToggleChanged);
            Assert.IsNotNull(projection180Toggle);
            projection180Toggle.onValueChanged.AddListener(OnProjection180ToggleChanged);
            Assert.IsNotNull(projection360Toggle);
            projection360Toggle.onValueChanged.AddListener(OnProjection360ToggleChanged);

            // Make sure all Projection toggles are in the same toggle group.
            Assert.IsTrue(flatToggle.group != null &&
                          flatToggle.group == projection180Toggle.group &&
                          flatToggle.group == projection360Toggle.group);

            SetStereoModeToggle(mediaPlayer.CurrentStereoMode);
            SetProjectionModeToggle(mediaPlayer.CurrentProjectionMode);
            SetTogglesInteractable(mediaPlayer.MediaScreen != null);

            mediaPlayer.OnStereoModeChanged     += SetStereoModeToggle;
            mediaPlayer.OnProjectionModeChanged += SetProjectionModeToggle;
            mediaPlayer.OnMediaScreenChanged    += OnMediaScreenChanged;
        }
        private void CreateMediaPlayer(MediaHelpers.MediaType mediaType)
        {
            DestroyMediaPlayer();

            switch (mediaType)
            {
            case MediaHelpers.MediaType.Video:
                currentPlayerObject = GameObject.Instantiate(videoPlayerPrefab);
                BaseVideoPlayer videoPlayer = currentPlayerObject.GetComponentInChildren <BaseVideoPlayer>();
                currentPlayer = videoPlayer;
                break;

            case MediaHelpers.MediaType.Photo:
                currentPlayerObject = GameObject.Instantiate(photoPlayerPrefab);
                BasePhotoPlayer photoPlayer = currentPlayerObject.GetComponentInChildren <BasePhotoPlayer>();
                currentPlayer = photoPlayer;
                break;

            default:
                Debug.LogError("Invalid Media Type.");
                break;
            }
        }
Exemple #5
0
 public void Setup(BaseMediaPlayer player)
 {
     videoPlayer = player as BaseVideoPlayer;
     gameObject.SetActive(videoPlayer != null);
 }
Exemple #6
0
 public VideoMetadataProjectionDetector(BaseMediaPlayer mediaPlayer)
     : base(mediaPlayer)
 {
 }
Exemple #7
0
 public LocalVideoImageBasedProjectionDetector(BaseMediaPlayer mediaPlayer)
     : base(mediaPlayer)
 {
 }
 public SavedStereoProjectionDetector(BaseMediaPlayer mediaPlayer)
     : base(mediaPlayer)
 {
 }
        private static bool TryPlayMedia(MediaHelpers.MediaType mediaType, FileInfo file, BaseMediaPlayer player)
        {
            switch (mediaType)
            {
            case MediaHelpers.MediaType.Video:
                BaseVideoPlayer videoPlayer = player as BaseVideoPlayer;
                if (videoPlayer != null)
                {
                    PlayOptions options = new PlayOptions();
                    options.Path = PATH_PREFIX + file.FullName;
                    options.Type = BaseVideoPlayer.VideoType.Other;
                    videoPlayer.Play(options);
                    return(true);
                }
                break;

            case MediaHelpers.MediaType.Photo:
                BasePhotoPlayer photoPlayer = player as BasePhotoPlayer;
                if (photoPlayer != null)
                {
                    photoPlayer.ShowPhoto(file);
                    return(true);
                }
                break;

            default:
                Debug.LogError("Invalid Media Type.");
                break;
            }

            return(false);
        }
Exemple #10
0
 public ProjectionDetectorQueue(BaseMediaPlayer mediaPlayer)
     : base(mediaPlayer)
 {
 }
 public BaseStereoProjectionDetector(BaseMediaPlayer mediaPlayer)
 {
     MediaPlayer = mediaPlayer;
 }
 public void Setup(BaseMediaPlayer player)
 {
     mediaPlayer = player;
     RefreshTitleLabel();
 }
Exemple #13
0
 public PhotoImageBasedProjectionDetector(BaseMediaPlayer mediaPlayer)
     : base(mediaPlayer)
 {
 }