/// <summary> /// 恢复录制(Resumes the recorder module) /// </summary> public static void ResumeRecorder() { ShareRECImpl.Resume(); pause = false; }
/// <summary> /// 通过缓存的视频ID获取本地路径(Gets the local video path by its ID.) /// </summary> public static string GetLocalVideoPath(long videoId) { return(ShareRECImpl.GetLocalVideoPath(videoId)); }
/// <summary> /// 打开视频中心(Shows the video center.) /// </summary> public static void ShowVideoCenter() { ShareRECImpl.ShowVideoCenter(); }
/// <summary> /// 显示分享页面(Shows the share page.) /// </summary> public static void ShowShare() { ShareRECImpl.ShowShare(); }
/// <summary> /// 添加视频的自定义属性(Adds the custom attributes of the video.) /// </summary> public static void AddCustomAttr(string key, string value) { ShareRECImpl.AddCustomAttr(key, value); }
/// <summary> /// 暂停录制模块(Pauses the recorder module) /// </summary> public static void PauseRecorder() { ShareRECImpl.Pause(); }
public static void ShowLocalVideos() { ShareRECImpl.ShowLocalVideos(); }
public static RECBar GetRECBar(MonoBehaviour script) { return(ShareRECImpl.GetRECBar(script.gameObject.name, "onRecBarAction")); }
/// <summary> /// 设置监听分享操作的回调,通过onShareComplete,onShareCancel,onShareError监听 /// </summary> public static void setShareActionEnable() { ShareRECImpl.setShareActionEnable(); }
public static void ShowLastVideo() { ShareRECImpl.ShowLastVideo(); }
/// <summary> /// 设置分享的时候先上传,上传成功后再分享 /// </summary> public static void setShareAfterUpload() { ShareRECImpl.setShareAfterUpload(); }
/// <summary> /// 启用GLES30 /// </summary> public static void UseGLES30API() { ShareRECImpl.useGLES30API(); }
/// <summary> /// 停止录制模块 (Stop the recorder module) /// </summary> public static void StopRecorder() { ShareRECImpl.Stop(); recorder = false; }
/// <summary> /// 删除缓存视频(Deletes the local video by its ID.) /// </summary> public static void DeleteLocalVideo(long videoId) { ShareRECImpl.DeleteLocalVideo(videoId); }
/// <summary> /// 不使用默认的record进行录音,使用自定义的录音方式录音 Prepares the sound copying. /// 注意,需要再 执行 StartRecorder()方法之前调用,否则无效 /// </summary> public static void PrepareSoundCopying(int channelCount, int sampleRate, int maxBufferSizeInBytes) { ShareRECImpl.PrepareSoundCopying(channelCount, sampleRate, maxBufferSizeInBytes); }
/// <summary> /// 添加要录屏的cmaera(add record camera.) /// </summary> public static void addCameraRecord(RenderTexture src) { ShareRECImpl.addCameraRecord(src); }
/// <summary> /// 将录音得到的 数据添加到录制的视频数据里 Offers the sample. /// </summary> public static void OfferSample(byte[] sample, int offset, int len) { ShareRECImpl.OfferSample(sample, offset, len); }
// ======================================= /// <summary> /// 设置视频描述文本(Sets the description of the video.) /// </summary> public static void SetText(string text) { ShareRECImpl.SetText(text); }
private void onStateChange(string action) { int iAction = -1; if (!Int32.TryParse(action, out iAction)) { return; } switch (iAction) { case STATE_STARTING: { if (OnRecorderStartingHandler != null) { OnRecorderStartingHandler(); } } break; case STATE_STARTED: { if (curAction == STATE_RESUMING) { if (OnRecorderResumedHandler != null) { OnRecorderResumedHandler(); } } else if (OnRecorderStartedHandler != null) { OnRecorderStartedHandler(); } } break; case STATE_PAUSING: { if (OnRecorderPausingHandler != null) { OnRecorderPausingHandler(); } } break; case STATE_PAUSED: { if (OnRecorderPausedHandler != null) { OnRecorderPausedHandler(); } } break; case STATE_RESUMING: { if (OnRecorderResumingHandler != null) { OnRecorderResumingHandler(); } } break; case STATE_STOPPING: { if (OnRecorderStoppingHandler != null) { OnRecorderStoppingHandler(); } } break; case STATE_STOPPED: { beginHanlder.enabled = false; endHanlder.enabled = false; ShareRECImpl.ReleaseRenderTexture(); if (OnRecorderStoppedHandler != null) { OnRecorderStoppedHandler(); } } break; } curAction = iAction; }
// ======================================= /// <summary> /// 判断ShareRec是否支持当前的设备(Determines whether ShareRec is available for the current device.) /// </summary> public static bool IsAvailable() { return(ShareRECImpl.IsAvailable()); }
/// <summary> /// 在视屏预览界面菜单添加自定义分享平台(Sets custom share platform in video preview menu) /// </summary> public static void AddCustomPlatform(string name) { ShareRECImpl.AddCustomPlatform(name); }
/// <summary> /// 恢复录制(Resumes the recorder module) /// </summary> public static void ResumeRecorder() { ShareRECImpl.Resume(); }
/// <summary> /// 停止录制模块 (Stop the recorder module) /// </summary> public static void StopRecorder() { ShareRECImpl.Stop(); }
/// <summary> /// 显示用户资料(Shows the user profile.) /// </summary> public static void ShowProfile() { ShareRECImpl.ShowProfile(); }
/// <summary> /// 列出本地已经缓存的视频(Lists the local videos.) /// </summary> public static long[] ListLocalVideos() { return(ShareRECImpl.ListLocalVideos()); }
/// <summary> /// 清除ShareRec的缓存目录(Clears the cache folder of ShareRec.) /// </summary> public static void ClearCache() { ShareRECImpl.ClearCache(); }
/// <summary> /// 暂停录制模块(Pauses the recorder module) /// </summary> public static void PauseRecorder() { pause = true; ShareRECImpl.Pause(); }