check buffering events #952
1 changed files with 13 additions and 7 deletions
|
@ -21,9 +21,11 @@ public class BufferEventTask extends AsyncTask<Void, Void, Void> {
|
||||||
private String userIdHash;
|
private String userIdHash;
|
||||||
private long streamDuration;
|
private long streamDuration;
|
||||||
private long streamPosition;
|
private long streamPosition;
|
||||||
|
private long bufferDuration;
|
||||||
|
|
||||||
public BufferEventTask(String streamUrl, long streamDuration, long streamPosition, String userIdHash) {
|
public BufferEventTask(String streamUrl, long streamDuration, long streamPosition, long bufferDuration, String userIdHash) {
|
||||||
this.streamUrl = streamUrl;
|
this.streamUrl = streamUrl;
|
||||||
|
this.bufferDuration = bufferDuration;
|
||||||
this.streamDuration = streamDuration;
|
this.streamDuration = streamDuration;
|
||||||
this.streamPosition = streamPosition;
|
this.streamPosition = streamPosition;
|
||||||
this.userIdHash = userIdHash;
|
this.userIdHash = userIdHash;
|
||||||
|
@ -31,13 +33,17 @@ public class BufferEventTask extends AsyncTask<Void, Void, Void> {
|
||||||
|
|
||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
JSONObject requestBody = new JSONObject();
|
JSONObject requestBody = new JSONObject();
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
try {
|
try {
|
||||||
requestBody.put("name", "buffer");
|
data.put("url", streamUrl);
|
||||||
requestBody.put("mobile", true);
|
data.put("position", streamPosition);
|
||||||
requestBody.put("url", streamUrl);
|
data.put("stream_duration", streamDuration);
|
||||||
requestBody.put("stream_duration", streamDuration);
|
data.put("duration", bufferDuration);
|
||||||
requestBody.put("stream_position", streamPosition);
|
|
||||||
requestBody.put("user_id_hash", userIdHash);
|
requestBody.put("device", "mobile");
|
||||||
|
requestBody.put("type", "buffering");
|
||||||
|
requestBody.put("client", userIdHash);
|
||||||
|
requestBody.put("data", data);
|
||||||
|
|
||||||
RequestBody body = RequestBody.create(requestBody.toString(), Helper.JSON_MEDIA_TYPE);
|
RequestBody body = RequestBody.create(requestBody.toString(), Helper.JSON_MEDIA_TYPE);
|
||||||
Request request = new Request.Builder().url(ENDPOINT).post(body).build();
|
Request request = new Request.Builder().url(ENDPOINT).post(body).build();
|
||||||
|
|
Loading…
Add table
Reference in a new issue