43 lines
891 B
C#
43 lines
891 B
C#
using UnityEngine;
|
|
using RenderHeads.Media.AVProMovieCapture;
|
|
using System.IO;
|
|
using System;
|
|
|
|
/// <summary>
|
|
/// 录屏
|
|
/// </summary>
|
|
public class SaveVideoToPersistentData : MonoBehaviour
|
|
{
|
|
public static SaveVideoToPersistentData saveVideoToPersistent;
|
|
public CaptureBase _movieCapture = null;
|
|
|
|
public bool isPlayer = false;
|
|
|
|
private void Start()
|
|
{
|
|
saveVideoToPersistent = this;
|
|
}
|
|
|
|
public void StartCapture()
|
|
{
|
|
if (_movieCapture != null)
|
|
{
|
|
isPlayer = true;
|
|
string _name = GlobalFlag.practiceSubjectID+ ".mp4";
|
|
Debug.Log("Name:" + _name);
|
|
_movieCapture._Mp4Name = _name;
|
|
_movieCapture.StartCapture();
|
|
}
|
|
}
|
|
|
|
public void StopCapture()
|
|
{
|
|
if (_movieCapture != null && isPlayer)
|
|
{
|
|
_movieCapture.StopCapture();
|
|
}
|
|
}
|
|
|
|
|
|
}
|