package com.yeshi.video.utils;
|
|
import android.content.Context;
|
|
import com.lcjian.library.util.common.StringUtils;
|
import com.loopj.android.http.ResponseHandlerInterface;
|
import com.yeshi.base.utils.http.API;
|
import com.yeshi.base.utils.http.BasicTextHttpResponseHandler;
|
import com.yeshi.base.utils.user.UserUtil;
|
|
import java.util.LinkedHashMap;
|
|
import static com.yeshi.base.utils.http.API.BASE_URL;
|
import static com.yeshi.base.utils.http.API.commonPost;
|
|
public class VideoApiUtil {
|
|
/**
|
* 获取真实播放路劲
|
*
|
* @param context
|
* @param uid
|
* @param handler
|
*/
|
public static void getPlayUrl(Context context, String uid, String type,
|
String videoId, String vid, String resourceId, String eId,
|
ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "getPlayUrl");
|
params.put("Uid", uid);
|
params.put("Type", type);
|
params.put("VideoId", videoId);
|
params.put("Id", vid);
|
params.put("EId", eId);
|
params.put("ResourceId", resourceId);
|
commonPost(context, BASE_URL + "recommend", params, handler);
|
}
|
|
|
public static void getVideoDetail(Context context, String uid,
|
String ResourceId, String videoId, String loginid, String type,
|
ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "getVideoDetail");
|
params.put("Uid", uid);
|
params.put("LoginUid", loginid);
|
params.put("VideoId", videoId);
|
params.put("ResourceId", ResourceId);
|
params.put("Type", type);
|
commonPost(context, BASE_URL + "recommend", params, handler);
|
}
|
|
|
public static void isCollect(Context context, String uid, String videoId,
|
String thirdType, ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "isCollect");
|
params.put("Uid", uid);
|
params.put("Id", videoId);
|
params.put("ThirdType", thirdType);
|
commonPost(context, BASE_URL + "recommend", params, handler);
|
}
|
|
|
public static void getScoreCollect(Context context, String uid,
|
String videoId, String thirdType, String type,
|
ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "getScoreCollect");
|
params.put("Uid", uid);
|
params.put("VideoId", videoId);
|
params.put("ThirdType", thirdType);
|
params.put("Type", type);
|
commonPost(context, BASE_URL + "user", params, handler);
|
}
|
|
|
/**
|
* 相关视频
|
*
|
* @param context
|
* @param uid
|
* @param videoId
|
* @param handler
|
*/
|
public static void getRelativeVideos(Context context, String uid,
|
String videoId, ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "getRelativeVideos");
|
params.put("VideoId", videoId);
|
params.put("Uid", uid);
|
commonPost(context, BASE_URL + "user", params, handler);
|
}
|
|
/**
|
* 猜你喜欢
|
*
|
* @param context
|
* @param uid
|
* @param videoId
|
* @param handler
|
*/
|
public static void guessLike(Context context, String uid, String videoId,
|
ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "guessLike");
|
params.put("VideoId", videoId);
|
params.put("Uid", uid);
|
commonPost(context, BASE_URL + "user", params, handler);
|
}
|
|
/**
|
* 大家都在看
|
*
|
* @param context
|
* @param uid
|
* @param videoId
|
* @param handler
|
*/
|
public static void getPeopleSeeVideos(Context context, String uid,
|
String videoId, ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "getPeopleSeeVideos");
|
params.put("VideoId", videoId);
|
params.put("Uid", uid);
|
commonPost(context, BASE_URL + "user", params, handler);
|
}
|
|
|
public static void getScoreSave(Context context, String uid,
|
String videoDetailId, ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "getScoreSave");
|
params.put("Uid", uid);
|
params.put("VideoDetailId", videoDetailId);
|
commonPost(context, BASE_URL + "user", params, handler);
|
}
|
|
|
/**
|
* 添加评论
|
*
|
* @param context
|
* @param handler
|
*/
|
public static void Comment(Context context, String loginUid,
|
String videoId, String thirdTyoe, String Content,
|
ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "comment");
|
params.put("Uid", loginUid);
|
params.put("VideoId", videoId);
|
params.put("ThirdType", thirdTyoe);
|
params.put("Content", Content);
|
commonPost(context, BASE_URL + "comment", params, handler);
|
}
|
|
|
/**
|
* 回复评论
|
*
|
* @param context
|
* @param handler
|
*/
|
public static void replayComment(Context context, String loginUid,
|
String commentReplyId, String commentId, String Content,
|
ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "replayComment");
|
params.put("Uid", loginUid);
|
params.put("CommentReplyId", commentReplyId);
|
params.put("CommentId", commentId);
|
params.put("Content", Content);
|
commonPost(context, BASE_URL + "comment", params, handler);
|
}
|
|
|
/**
|
* 视频评论列表
|
*
|
* @param context
|
* @param uid
|
* @param videoId
|
* @param thirdType
|
* @param Page
|
* @param handler
|
*/
|
public static void getVideoCommentList(Context context, String uid,
|
String videoId, String thirdType, String Page,
|
ResponseHandlerInterface handler) {
|
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
|
params.put("Method", "getVideoCommentList");
|
params.put("Uid", uid);
|
params.put("VideoId", videoId);
|
params.put("ThirdType", thirdType);
|
params.put("Page", Page);
|
commonPost(context, BASE_URL + "comment", params, handler);
|
}
|
|
|
}
|