// 销毁房间 public bool DestroyRoom(string roomId) { Dictionary <string, object> dirt = new Dictionary <string, object>(); dirt.Add("room", roomId); string json = Json.Serialize(dirt); #if UNITY_IPHONE return(rtcDestroyRoom(json)); #elif UNITY_ANDROID WebRtcSDK_instance.CallStatic("destroyRoom", json); return(true); #else return(false); #endif }
// 扬声器禁用和解禁(0 or 1) public bool MuteSpeaker(string roomId, int setting) { Dictionary <string, object> dirt = new Dictionary <string, object>(); dirt.Add("room", roomId); dirt.Add("mute", setting); string json = Json.Serialize(dirt); #if UNITY_IPHONE_33 return(rtcMuteSpeaker(json)); #elif UNITY_ANDROID WebRtcSDK_instance.CallStatic("enableSpeaker", json); return(true); #else return(false); #endif }
// 初始化SDK public bool InitSDK(main view, string host, string port, string[] iceServers) { roomView = view; Dictionary <string, object> dirt = new Dictionary <string, object>(); dirt.Add("host", host); dirt.Add("port", port); dirt.Add("iceServers", iceServers); string json = Json.Serialize(dirt); Debug.Log("InitSDK json = " + json); #if UNITY_IPHONE return(rtcInitSDK(json)); #elif UNITY_ANDROID WebRtcSDK_instance.CallStatic("initSDK", Context, json); return(true); #else return(false); #endif }