NIMSDK-AOS  10.9.71
AVChatNetDetector.java
浏览该文件的文档.
1 /*
2  * Copyright (c) 2014-2018 NetEase, Inc.
3  * All right reserved.
4  */
5 
6 package com.netease.nimlib.sdk.avchat;
7 
8 
9 import com.netease.nimlib.avchat.AVChatNetDetectorImpl;
11 
12 
13 
14 /**
15  * 网络探测接口
16  */
17 public class AVChatNetDetector {
18 
19  /**
20  * 设置自定义网络探测的服务器地址
21  * @param url 自定义网络探测地址
22  */
23  public static void setCustomNetDetectServer(String url){
24  AVChatNetDetectorImpl.setCustomServer(url);
25  }
26 
27 
28  /**
29  * 开始探测任务
30  *
31  * @param type 探测类型 {@link AVChatNetDetectType}
32  * @param callback 探测结果回调
33  * @return 探测任务ID
34  */
35  public static String startNetDetect(int type, AVChatNetDetectCallback callback) {
36  return AVChatNetDetectorImpl.start(type, callback);
37  }
38 
39  /**
40  * 开始探测任务
41  * 使用音频模式探测
42  * @param callback 探测结果回调
43  * @return 探测任务ID
44  */
45  public static String startNetDetect(AVChatNetDetectCallback callback) {
46  return AVChatNetDetectorImpl.start(AVChatNetDetectType.AUDIO, callback);
47  }
48 
49  /**
50  * 停止探测
51  *
52  * @param id 探测任务ID
53  */
54  public static void stopNetDetect(String id) {
55  AVChatNetDetectorImpl.stop(id);
56  }
57 }
static String startNetDetect(int type, AVChatNetDetectCallback callback)
开始探测任务
static String startNetDetect(AVChatNetDetectCallback callback)
开始探测任务 使用音频模式探测
static void setCustomNetDetectServer(String url)
设置自定义网络探测的服务器地址
static void stopNetDetect(String id)
停止探测