public void DrawSlackConfig(VimeoRecorder recorder)
        {
            var so = serializedObject;

            GUILayout.BeginHorizontal();
            slackFold = EditorGUILayout.Foldout(slackFold, "Slack");
            if (recorder.SlackAuthenticated() && GUILayout.Button("Sign out", GUILayout.Width(60)))
            {
                recorder.SetSlackToken(null);
            }
            GUILayout.EndHorizontal();

            if (slackFold)
            {
                EditorGUI.indentLevel++;
                if (recorder.SlackAuthenticated())
                {
                    EditorGUILayout.PropertyField(so.FindProperty("slackChannel"));
                    EditorGUILayout.PropertyField(so.FindProperty("defaultShareLink"), new GUIContent("Share Link"));
                    EditorGUILayout.PropertyField(so.FindProperty("autoPostToChannel"), new GUIContent("Post to Channel"));
                }

                DrawSlackAuth(recorder);
                EditorGUI.indentLevel--;
            }
        }
Beispiel #2
0
        public void DrawConfig(VimeoRecorder recorder)
        {
            var so = serializedObject;

            // Help Nav
            GUILayout.BeginHorizontal();
            var style = new GUIStyle();

            style.border = new RectOffset(0, 0, 0, 0);
            GUILayout.Box("", style);

            GUIManageVideosButton();
            GUIHelpButton();
            GUISignOutButton();

            GUILayout.EndHorizontal();
            EditorGUILayout.Space();

            // Vimeo Settings
            if (recorder.Authenticated() && recorder.vimeoSignIn)
            {
                if (!recorder.isRecording)
                {
                    DrawRecorderConfig(recorder);
                }

                publishFold = EditorGUILayout.Foldout(publishFold, "Upload to Vimeo");

                if (publishFold)
                {
                    EditorGUI.indentLevel++;

                    EditorGUILayout.PropertyField(so.FindProperty("videoName"));
                    EditorGUILayout.PropertyField(so.FindProperty("privacyMode"));

                    if (VimeoApi.PrivacyModeDisplay.OnlyPeopleWithAPassword == recorder.privacyMode)
                    {
                        EditorGUILayout.PropertyField(so.FindProperty("videoPassword"), new GUIContent("Password"));
                    }

                    GUISelectFolder();

                    EditorGUILayout.PropertyField(so.FindProperty("commentMode"), new GUIContent("Comments"));
                    EditorGUILayout.PropertyField(so.FindProperty("enableDownloads"));
                    EditorGUILayout.PropertyField(so.FindProperty("enableReviewPage"));

                    EditorGUILayout.PropertyField(so.FindProperty("openInBrowser"));

                    EditorGUI.indentLevel--;
                }

                DrawRecordingControls();
            }

            DrawVimeoAuth(recorder);

            so.ApplyModifiedProperties();
        }
Beispiel #3
0
        public void Init(VimeoRecorder _recorder, int _chunkSize = 1024 * 1024 * 128)
        {
            recorder = _recorder;

            if (m_vimeoUploader == null)
            {
                m_vimeoUploader = gameObject.AddComponent <VimeoUploader>();
                m_vimeoUploader.Init(recorder.GetVimeoToken(), _chunkSize);

                m_vimeoUploader.OnUploadProgress  += UploadProgress;
                m_vimeoUploader.OnUploadComplete  += UploadComplete;
                m_vimeoUploader.OnNetworkError    += NetworkError;
                m_vimeoUploader.OnRequestComplete += OnUploadInit;
                m_vimeoUploader.OnError           += ApiError;
            }
        }
Beispiel #4
0
        public void Init(VimeoRecorder _recorder)
        {
            recorder = _recorder;

            if (vimeoApi == null)
            {
                vimeoApi = gameObject.AddComponent <VimeoApi>();
                vimeoApi.OnPatchComplete  += VideoUpdated;
                vimeoApi.OnUploadComplete += UploadComplete;
                vimeoApi.OnUploadProgress += UploadProgress;
                vimeoApi.OnError          += ApiError;
                vimeoApi.OnNetworkError   += NetworkError;

                vimeoApi.token = recorder.GetVimeoToken();
            }
        }
        public void DrawRecorderConfig(VimeoRecorder recorder)
        {
            var so = serializedObject;

            GUILayout.BeginHorizontal();
            recordingFold = EditorGUILayout.Foldout(recordingFold, "Recording");
            GUILayout.EndHorizontal();

            if (recordingFold)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(so.FindProperty("defaultVideoInput"), new GUIContent("Input"));

                if (recorder.defaultVideoInput == Vimeo.Recorder.VideoInputType.Camera)
                {
                    EditorGUILayout.PropertyField(so.FindProperty("defaultCamera"), new GUIContent("Camera"));
                }
                else if (recorder.defaultVideoInput == Vimeo.Recorder.VideoInputType.Camera360)
                {
                    EditorGUILayout.PropertyField(so.FindProperty("defaultCamera360"), new GUIContent("Camera"));
                    EditorGUILayout.PropertyField(so.FindProperty("defaultRenderMode360"), new GUIContent("Render mode"));
                }

                if (recorder.defaultVideoInput != Vimeo.Recorder.VideoInputType.Camera360)
                {
                    EditorGUILayout.PropertyField(so.FindProperty("defaultResolution"), new GUIContent("Resolution"));

                    if (recorder.defaultResolution != Vimeo.Recorder.Resolution.Window)
                    {
                        EditorGUILayout.PropertyField(so.FindProperty("defaultAspectRatio"), new GUIContent("Aspect ratio"));
                    }
                }

                EditorGUILayout.PropertyField(so.FindProperty("frameRate"));
                EditorGUILayout.PropertyField(so.FindProperty("realTime"));
                EditorGUILayout.PropertyField(so.FindProperty("recordAudio"));
                EditorGUILayout.PropertyField(so.FindProperty("recordMode"));

                if (recorder.recordMode == RecordMode.Duration)
                {
                    EditorGUILayout.PropertyField(so.FindProperty("recordDuration"), new GUIContent("Duration (sec)"));
                }

                EditorGUI.indentLevel--;
            }
        }
Beispiel #6
0
        public void Init(VimeoRecorder r)
        {
            _recorder = r;

            if (_recorder.encoderType == EncoderType.MediaEncoder)
            {
#if MEDIA_ENCODER_SUPPORT
                _vimeoEncoder = gameObject.AddComponent <RecorderController>();
                _vimeoEncoder.Init(_recorder);
#endif
            }
            else if (_recorder.encoderType == EncoderType.AVProCapture)
            {
#if VIMEO_AVPRO_CAPTURE_SUPPORT
                _avproEncoder = r.avproEncoder;
#endif
            }
        }
        public void DrawSlackAuth(VimeoRecorder recorder)
        {
            GUIStyle customstyle = new GUIStyle();

            customstyle.margin = new RectOffset(40, 0, 0, 0);

            GUILayout.BeginHorizontal();

            var so = serializedObject;

            if (!recorder.SlackAuthenticated())
            {
                EditorGUILayout.PropertyField(so.FindProperty("slackToken"));
                if (recorder.slackToken == null || recorder.slackToken == "")
                {
                    if (GUILayout.Button("Get token", GUILayout.Width(75)))
                    {
                        Application.OpenURL("https://authy.vimeo.com/auth/slack");
                    }
                }
                else
                {
                    if (GUILayout.Button("Get token", GUILayout.Width(75)))
                    {
                        Application.OpenURL("https://authy.vimeo.com/auth/slack");
                    }

                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal(customstyle);
                    GUI.backgroundColor = Color.green;

                    if (GUILayout.Button("Sign in"))
                    {
                        recorder.SetSlackToken(recorder.slackToken);
                        recorder.slackToken = null;
                        GUI.FocusControl(null);
                    }
                    GUI.backgroundColor = Color.white;
                }
            }

            GUILayout.EndHorizontal();
        }
        public void Init(VimeoRecorder r)
        {
            _recorder = r;

            if (_recorder.encoderType == EncoderType.MediaEncoder)
            {
#if MEDIA_ENCODER_SUPPORT
                _vimeoEncoder = gameObject.AddComponent <RecorderController>();
                _vimeoEncoder.Init(_recorder);
#else
                Debug.LogError("[Vimeo] Recording is only avaialabe in 2017.2 or higher.");
#endif
            }
            else if (_recorder.encoderType == EncoderType.AVProMovieCapture)
            {
#if VIMEO_AVPRO_CAPTURE_SUPPORT
                _avproEncoder = r.avproEncoder;
#endif
            }
        }
        public void DrawRecorderConfig(VimeoRecorder recorder)
        {
            var so = serializedObject;

            GUILayout.BeginHorizontal();
            recordingFold = EditorGUILayout.Foldout(recordingFold, "Recording");
            GUILayout.EndHorizontal();

            if (recordingFold)
            {
                EditorGUI.indentLevel++;

#if VIMEO_LOOKING_GLASS_SUPPORT
                EditorGUILayout.PropertyField(so.FindProperty("captureLookingGlassRT"), new GUIContent("Capture Hologram"));
#endif

#if VIMEO_AVPRO_CAPTURE_SUPPORT
                EditorGUILayout.PropertyField(so.FindProperty("encoderType"), new GUIContent("Encoder"));

                if (recorder.encoderType == Vimeo.Recorder.EncoderType.AVProMovieCapture)
                {
                    EditorGUILayout.PropertyField(so.FindProperty("avproEncoder"), new GUIContent("AVPro Object"));
                }
                else
                {
#endif

                if (recorder.captureLookingGlassRT)
                {
                    recorder.defaultVideoInput = VideoInputType.RenderTexture;
                }
                else
                {
                    EditorGUILayout.PropertyField(so.FindProperty("defaultVideoInput"), new GUIContent("Input"));
                }

                if (recorder.defaultVideoInput == Vimeo.Recorder.VideoInputType.Camera)
                {
                    EditorGUILayout.PropertyField(so.FindProperty("defaultCamera"), new GUIContent("Camera"));
                }
#if UNITY_2018_1_OR_NEWER
                else if (recorder.defaultVideoInput == Vimeo.Recorder.VideoInputType.Camera360)
                {
                    EditorGUILayout.PropertyField(so.FindProperty("defaultCamera360"), new GUIContent("Camera"));
                    EditorGUILayout.PropertyField(so.FindProperty("defaultRenderMode360"), new GUIContent("Render mode"));
                }
#endif

                if (recorder.defaultVideoInput == Vimeo.Recorder.VideoInputType.Camera ||
                    recorder.defaultVideoInput == Vimeo.Recorder.VideoInputType.Screen)
                {
                    EditorGUILayout.PropertyField(so.FindProperty("defaultResolution"), new GUIContent("Resolution"));

                    if (recorder.defaultResolution != Vimeo.Recorder.Resolution.Window)
                    {
                        EditorGUILayout.PropertyField(so.FindProperty("defaultAspectRatio"), new GUIContent("Aspect ratio"));
                    }
                }

                if (recorder.defaultVideoInput == Vimeo.Recorder.VideoInputType.RenderTexture && !recorder.captureLookingGlassRT)
                {
                    EditorGUILayout.PropertyField(so.FindProperty("renderTextureTarget"), new GUIContent("Target"));
                }

                EditorGUILayout.PropertyField(so.FindProperty("frameRate"));
                EditorGUILayout.PropertyField(so.FindProperty("realTime"));

                if (recorder.realTime)
                {
#if UNITY_2018_1_OR_NEWER
                    EditorGUILayout.PropertyField(so.FindProperty("recordAudio"));
#else
                    recorder.recordAudio = false;
#endif
                }
                EditorGUILayout.PropertyField(so.FindProperty("recordMode"));

                if (recorder.recordMode == RecordMode.Duration)
                {
                    EditorGUILayout.PropertyField(so.FindProperty("recordDuration"), new GUIContent("Duration (sec)"));
                }
#if VIMEO_AVPRO_CAPTURE_SUPPORT
            }
#endif

                EditorGUI.indentLevel--;
            }
        }
Beispiel #10
0
 public void Init(VimeoRecorder r)
 {
     recorder = r;
 }
        public void DrawConfig(VimeoRecorder recorder)
        {
            var so = serializedObject;

            // Help Nav
            GUILayout.BeginHorizontal();
            var style = new GUIStyle();

            style.border = new RectOffset(0, 0, 0, 0);
            GUILayout.Box("", style);
            if (GUILayout.Button("Need help?", GUILayout.Width(75)))
            {
                Application.OpenURL("https://github.com/vimeo/vimeo-unity-sdk");
            }
            GUILayout.EndHorizontal();
            EditorGUILayout.Space();

            // Vimeo Settings
            if (Authenticated(recorder.GetVimeoToken()) && recorder.vimeoSignIn)
            {
                DrawRecorderConfig(recorder);

                publishFold = EditorGUILayout.Foldout(publishFold, "Publish to");

                if (publishFold)
                {
                    EditorGUI.indentLevel++;

                    GUILayout.BeginHorizontal();
                    vimeoFold = EditorGUILayout.Foldout(vimeoFold, "Vimeo");
                    if (GUILayout.Button("Sign out", GUILayout.Width(60)))
                    {
                        recorder.vimeoSignIn = false;
                        recorder.SetVimeoToken(null);
                    }
                    GUILayout.EndHorizontal();

                    if (vimeoFold)
                    {
                        EditorGUI.indentLevel++;
                        EditorGUILayout.PropertyField(so.FindProperty("videoName"));
                        EditorGUILayout.PropertyField(so.FindProperty("privacyMode"));

                        if (VimeoApi.PrivacyModeDisplay.OnlyPeopleWithAPassword == recorder.privacyMode)
                        {
                            EditorGUILayout.PropertyField(so.FindProperty("videoPassword"), new GUIContent("Password"));
                        }

                        EditorGUILayout.PropertyField(so.FindProperty("openInBrowser"));
                        EditorGUI.indentLevel--;
                    }

                    DrawSlackConfig(recorder);
                    EditorGUI.indentLevel--;
                }

                DrawRecordingControls();
            }

            DrawVimeoAuth(recorder);

            so.ApplyModifiedProperties();
        }