/** sends a token - when required */ public void refreshVideoToken(String token) { token = LicodeConnector.decodeToken(token); if (token == null) { return; } try { JSONObject jsonToken = new JSONObject(token); handleTokenRefresh(jsonToken); sendMessageSocket( "refreshToken", jsonToken, new Acknowledge() { @Override public void acknowledge(JSONArray arg0) { // read publish right from result log("Refresh token Acknowledge: " + arg0.toString()); parseVideoTokenResponse(arg0); if (mPermissionPublish) { triggerPublishAllowed(); } else { unpublish(); } } }); } catch (JSONException e) { } }
void sendDataSocket(String streamId, String message) { JSONObject param = new JSONObject(); try { param.put("id", streamId); param.put("msg", message); } catch (JSONException e) { e.printStackTrace(); } sendMessageSocket("sendDataStream", param, null); }