| | |
| | | private static AsyncHttpClient sortTimeAsyncHttpClient = new AsyncHttpClient(); |
| | | |
| | | static { |
| | | |
| | | mOkHttpClient = new OkHttpClient().newBuilder() |
| | | .connectTimeout(10 * 1000, TimeUnit.SECONDS)//设置超时时间 |
| | | .readTimeout(10 * 1000, TimeUnit.SECONDS)//设置读取超时时间 |
| | |
| | | String type, |
| | | ResponseHandlerInterface handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); |
| | | params.put("Method", "uploadSession"); |
| | | if (sessionId != null) |
| | | params.put("sessionId", sessionId); |
| | | if (type != null) |
| | | params.put("type", type); |
| | | commonPost(context, BASE_URL + "session", params, handler); |
| | | |
| | | commonPost(context, BASE_URL + "session/uploadSession", params, handler); |
| | | } |
| | | |
| | | |
| | |
| | | commonPost(context, BASE_URL + "video/play/pptvPlay", params, handler); |
| | | } |
| | | |
| | | public static void pptvFinishPlay(Context context, String cid, String vid, Integer currentTime, |
| | | ResponseHandlerInterface handler) { |
| | | String loginUid = UserUtil.getLoginUid(context); |
| | | String uid = UserUtil.getUid(context); |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | if (loginUid != null) |
| | | params.put("loginUid", loginUid); |
| | | if (uid != null) |
| | | params.put("Uid", uid); |
| | | params.put("cid", cid); |
| | | params.put("vid", vid); |
| | | if (currentTime != null) { |
| | | params.put("currentTime", currentTime + ""); |
| | | } |
| | | |
| | | commonPost(context, BASE_URL + "video/play/pptvFinishPlay", params, handler); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取PPTV的播放状态 |
| | | * |
| | | * @param context |
| | | * @param cid |
| | | * @param vid |
| | | * @param handler |
| | | */ |
| | | |
| | | public static void getPPTVVideoPlayState(Context context, String cid, String vid, |
| | | ResponseHandlerInterface handler) { |
| | | String loginUid = UserUtil.getLoginUid(context); |
| | | String uid = UserUtil.getUid(context); |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | if (loginUid != null) |
| | | params.put("loginUid", loginUid); |
| | | if (uid != null) |
| | | params.put("Uid", uid); |
| | | params.put("cid", cid); |
| | | params.put("vid", vid); |
| | | commonPost(context, BASE_URL + "video/play/getPPTVVideoPlayState", params, handler); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 付费视频的购买活动 |