public void Record() { if (!ReplayKit.APIAvailable) { return; } recording = ReplayKit.isRecording; try { recording = !recording; if (recording) { ReplayKit.StartRecording(); } else { ReplayKit.StopRecording(); } recordingIndicator.SetActive(recording); } catch (Exception e) { lastError = e.ToString(); } }
/// <inheritdoc /> public bool StartRecording() { #if !UNITY_IOS Debug.LogError("iOSRecordingService is not supported for the current platform"); return(false); #else if (!ReplayKit.APIAvailable) { Debug.LogError("ReplayKit API is not available"); return(false); } if (ReplayKit.isRecording) { Debug.LogWarning("ReplayKit was told to start recording but was already recording"); return(true); } if (ReplayKit.recordingAvailable) { ReplayKit.Discard(); } return(ReplayKit.StartRecording(true, true)); #endif }
void StartVideoRecord() { string lastError = ""; // if (Everyplay.IsReadyForRecording()){ // print ("UIMediaCapture StartVideoRecord is ready"); // Everyplay.StartRecording(); // } //The following code is especially for ios platform // if (!ReplayKit.APIAvailable) { // MediaController.Singleton.msgDialog.Show ("Video recording is not ready yet, please try again later"); // return; // } else { // ReplayKit.StartRecording(); // } #if PLATFORM_IOS try{ print("StartVideoRecord"); RecordingStarted_ReplayKit(); ReplayKit.StartRecording(); } catch (Exception e) { lastError = e.ToString(); } #endif }
// streaming開始・終了のボタン public void Streaming() { // broadcastAPIを使えるかどうかの確認 if (!ReplayKit.broadcastingAPIAvailable) { this.message.text = "I can not use broadcast"; return; } #if false // 音声を取れるかどうか確認 if (!ReplayKit.microphoneEnabled) { this.message.text = "I can not use microphone"; return; } #endif if (ReplayKit.isBroadcasting) { // recording中の時は終了 ReplayKit.StopBroadcasting(); } else { ReplayKit.BroadcastStatusCallback callback = (bool success, string error) => { this.message.text = error; }; // recording中でないときは開始 // 第一引数はbroadcastの初期化時に呼ばれるReplayKit.BroadcastStatusCallback // 第二引数をtrueにするとマイクも拾える default = false // 第三引数は多分インカメ ReplayKit.StartBroadcasting(callback, true); } }
private void Awake() { btnRecordPage.onClick.AddListener(() => { RecordNativeHandler(); }); btnReplayKitRecord.onClick.AddListener(() => { ReplayKitHandler(); }); btnReplayKitPreview.onClick.AddListener(() => { if (!ReplayKit.APIAvailable) return; ReplayKit.Preview(); }); btnReplayKitDiscard.onClick.AddListener(() => { if (!ReplayKit.APIAvailable) return; ReplayKit.Discard(); }); }
public void StartStop() { if (!ReplayKit.APIAvailable) { return; } var recording = ReplayKit.isRecording; try { recording = !recording; if (recording) { ReplayKit.StartRecording(); StopIcon.SetActive(true); RecordIcon.SetActive(false); MyUnityARGeneratePlane.HidePlanes(); } else { ReplayKit.StopRecording(); StopIcon.SetActive(false); RecordIcon.SetActive(true); MyUnityARGeneratePlane.ShowPlanes(); } } catch (Exception e) { //lastError = e.ToString(); } }
/// <summary> /// Plays the last recorded video /// </summary> public void PlayPreview() { #if UNITY_IOS ReplayKit.Preview(); #else Debug.LogWarning("Not implemented on the current platform"); #endif }
public void StopChartRecord() { if (RecordChartCr != null) { StopCoroutine(RecordChartCr); } ReplayKit.StopRecording(); }
public void Review() { if (ReplayKit.recordingAvailable) { ReplayKit.Preview(); MyUnityARGeneratePlane.ShowPlanes(); } }
public void Discard() { if (ReplayKit.recordingAvailable) { ReplayKit.Discard(); MyUnityARGeneratePlane.ShowPlanes(); } }
public void RecordScreen() { //for (int i = 2; i < transform.childCount; i++) //{ // transform.GetChild(i).transform.GetChild(0).GetComponent<Image>().enabled = false; //} ReplayKit.microphoneEnabled = false; ReplayKit.StartRecording(); }
public void StopRecord() { ReplayKit.StopRecording(); for (int i = 2; i < transform.childCount; i++) { transform.GetChild(i).transform.GetChild(0).GetComponent <Image>().enabled = true; } showPreview = true; }
IEnumerator ShowRecording() { isRecordingComplete = true; print("rePLAY BEGIN"); while (!ReplayKit.recordingAvailable) { yield return(null); } ReplayKit.Preview(); }
public void StartRecording() { ui.SetMode("Recording"); fc.StartRecPlay(); isRecording = true; if (ReplayKit.APIAvailable) { ReplayKit.StartRecording(false, false); } }
public void VideoConfirm() { if (ReplayKit.recordingAvailable) { ReplayKit.Preview(); } // Go back to normal GUI operation confirmVideoButton.SetActive(false); cameraButton.SetActive(true); videoButton.SetActive(true); }
/// <summary> /// Stops the recording process /// </summary> public void StopRecording() { #if UNITY_IOS if (recording) { ReplayKit.StopRecording(); RecordButton.SetActive(true); } #else Debug.LogWarning("Not implemented on the current platform"); #endif }
void Update() { // If the camera is enabled, show the recorded video overlaying the game. if (ReplayKit.isRecording && enableCamera) { ReplayKit.ShowCameraPreviewAt(10, 350, 200, 200); } else { ReplayKit.HideCameraPreview(); } }
public void StopRecording() { mainARCamera.cullingMask |= 1 << LayerMask.NameToLayer("TransparentFX"); #if UNITY_IOS ReplayKit.StopRecording(); toggleRecordingUI(false); #endif #if UNITY_ANDROID cameraInput.Dispose(); gifRecorder.Dispose(); #endif }
public void Record() { if (!ReplayKit.isRecording) { RecordPlayer(); ReplayKit.StartRecording(); isRecordingComplete = false; } else { ReplayKit.StopRecording(); Record(); } }
void Update() { if (Input.touchCount > 0) { transform.Find("Instruction").gameObject.SetActive(false); } // only shows preview directly after recording is finished if (ReplayKit.recordingAvailable && showPreview) { ReplayKit.Preview(); showPreview = false; } }
public void StopRecording() { if (ReplayKit.APIAvailable) { if (ReplayKit.isRecording) { isRecording = false; ReplayKit.StopRecording(); ReplayKit.Preview(); } } isRecording = false; ui.SetMode("Edit"); }
public void StopRecord() { if (screenName) { screenName.SetActive(false); } if (ReplayKit.isRecording) { charAnimator.Play("Idle"); charAudio.Stop(); MainUiController.instance.ActivateMainScreen(); ReplayKit.StopRecording(); StartCoroutine(ShowRecording()); } }
IEnumerator FakeRecord() { ReplayKit.StartRecording(true); while (!ReplayKit.isRecording) { yield return(null); } yield return(new WaitForSeconds(2)); ReplayKit.StopRecording(); while (!ReplayKit.recordingAvailable) { yield return(null); } ReplayKit.Discard(); }
public void StartRecording() { //toggle AR camera's culling flags so the plane/point cloud won't show up in the recording video/gif. mainARCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("TransparentFX")); #if UNITY_IOS ReplayKit.StartRecording(); #endif #if UNITY_ANDROID // Start recording gifRecorder = new NatCorder.GIFRecorder(Screen.width / 3, Screen.height / 3, frameDuration, OnGIF); // Create a camera input cameraInput = new CameraInput(gifRecorder, new RealtimeClock(), Camera.main); // Get a real GIF look by skipping frames cameraInput.frameSkip = 4; #endif }
/// <summary> /// Starts the recording process /// </summary> public void StartRecording() { #if UNITY_IOS if (!ReplayKit.APIAvailable) { return; } if (!recording) { ReplayKit.StartRecording(true, true); Controls.SetActive(false); } #else Debug.LogWarning("Not implemented on the current platform"); #endif }
public void RecordWithoutMicrophone() { if (screenName && borderToggle) { screenName.SetActive(true); } if (!ReplayKit.isRecording) { RecordPlayer(); ReplayKit.StartRecording(); isRecordingComplete = false; } else { ReplayKit.StopRecording(); Record(); } }
void OnGUI() { if (!ReplayKit.APIAvailable) { return; } var recording = ReplayKit.isRecording; string caption = recording ? "Stop Recording" : "Start Recording"; if (GUI.Button(new Rect(10, 10, 500, 200), caption)) { try { recording = !recording; if (recording) { ReplayKit.StartRecording(enableCamera); } else { ReplayKit.StopRecording(); } } catch (Exception e) { lastError = e.ToString(); } } GUI.Label(new Rect(10, 220, 500, 50), "Last error: " + ReplayKit.lastError); GUI.Label(new Rect(10, 280, 500, 50), "Last exception: " + lastError); if (ReplayKit.recordingAvailable) { if (GUI.Button(new Rect(10, 350, 500, 200), "Preview")) { ReplayKit.Preview(); } if (GUI.Button(new Rect(10, 560, 500, 200), "Discard")) { ReplayKit.Discard(); } } }
void StopVideoRecord() { // Everyplay.StopRecording(); string lastError = ""; #if PLATFORM_IOS try { print("StopVideoRecord"); RecordingStopped_ReplayKit(); ReplayKit.StopRecording(); } catch (Exception e) { lastError = e.ToString(); } print("ReplayKit.recordingAvailable = " + ReplayKit.recordingAvailable); // RecordingStopped_ReplayKit(); #endif }
// Video Button OnClick public void VideoShotClick() { if (!ReplayKit.APIAvailable) { Debug.Log("API not available! "); return; } if (videoPressed) { videoPressed = false; // Turn off GUI feedbackImage.SetActive(false); videoButton.SetActive(false); // Show confirmation button confirmVideoButton.SetActive(true); } else { videoPressed = true; // Begin recording mode feedbackImage.SetActive(true); cameraButton.SetActive(false); } // Recording recording = ReplayKit.isRecording; recording = !recording; if (recording) { Debug.Log("I am starting a recording"); ReplayKit.StartRecording(); } else { Debug.Log("I am ending a recording"); ReplayKit.StopRecording(); } }
/// <inheritdoc /> public void StopRecording() { #if !UNITY_IOS Debug.LogError("iOSRecordingService is not supported for the current platform"); #else if (!ReplayKit.APIAvailable) { Debug.LogError("ReplayKit API is not available"); return; } if (!ReplayKit.isRecording) { Debug.LogWarning("ReplayKit was told to stop recording but wasn't recording"); return; } ReplayKit.StopRecording(); #endif }