void ShowShare() { // 停止录制后启动分享视频 (show sharing page after the recorder is stopped) ShareRec.SetText("Angry Rebot"); ShareRec.AddCustomAttr("score", "5000"); ShareRec.AddCustomAttr("name", "ShareRec Developer"); ShareRec.AddCustomAttr("brand", "hehe!"); ShareRec.AddCustomAttr("level", "10"); ShareRec.ShowShare(); }
void OnGUI() { if (ShareRec.IsAvailable()) { GUI.skin.box.fontSize = fontSize; GUI.skin.button.fontSize = fontSize; GUI.Box(panel, "ShareRec Test"); if (started) { if (GUI.Button(btnStop, "Stop")) { // 设置停止监听 (add recorder stopped listener) ShareRec.OnRecorderStoppedHandler = ShowShare; // 启动录制 (start recording) started = false; ShareRec.StopRecorder(); } } else { if (GUI.Button(btnStart, "Start")) { // 提高视频质量到4Mbit/s(improve the video quality to 4Mbit/s) ShareRec.SetBitRate(4 * 1024 * 1024); // 停止录制 (stop recording) started = true; ShareRec.StartRecorder(); } else if (GUI.Button(btnProfile, "Profile")) { // 打开个人中心 (show user profile page) ShareRec.ShowProfile(); } } } }