예제 #1
0
 /// <summary>
 /// 创建一个会话
 /// </summary>
 /// <param name="param">CreateSessionParameter对象</param>
 /// <param name="timeout">请求超时时间,单位秒</param>
 /// <returns></returns>
 public static HttpResponse <SessionResult> CreateSession(CreateSessionParameter param, long timeout = 30)
 {
     return(Rtc.Post("/sessions", timeout)
            .AddRangeField(param.ToParameter())
            .asJson <SessionResult>());
 }
예제 #2
0
 /// <summary>
 /// 创建一个令牌
 /// </summary>
 /// <param name="param"></param>
 /// <param name="timeout">请求超时时间,单位秒</param>
 /// <returns></returns>
 public static HttpResponse <TokenResult> CreateToken(CreateTokenParameter param, long timeout = 30)
 {
     return(Rtc.Post("/sessions/" + param.session_id + "/tokens", timeout)
            .AddRangeField(param.ToParameter())
            .asJson <TokenResult>());
 }
예제 #3
0
 /// <summary>
 /// 开始/停止录像
 /// </summary>
 /// <returns></returns>
 public HttpResponse <RecordResult> ProcessRecord(ProcessRecordParam param, long timeout = 30)
 {
     return(Rtc.Post("/records", timeout)
            .AddRangeField(param.ToParameter())
            .asJson <RecordResult>());
 }