Hi all,
I’m trying to update “plays” field of a media Entry but while the code runs without any problems/exceptions the value of the entry stays the same.
The code i’m using is below :
try {
String ks = client.getSessionService().start(ADMIN_SECRET, "admin",
KalturaSessionType.ADMIN, PARTNER_ID, 86400, "disableentitlement");
client.setKs(ks);
client.setSessionId(ks);
// Get Media Entry
KalturaMediaEntry getMediaEntry = client.getMediaService().get(entry_id);
// Get plays of Media Entry
int plays = getMediaEntry.plays;
int updatedPlays = plays + 1;
// Create updated Media Entry with plays+1
KalturaMediaEntry updatedMediaEntry = new KalturaMediaEntry();
updatedMediaEntry.plays = updatedPlays;
// Update
client.getMediaService().update(entry_id, updatedMediaEntry);
} catch (KalturaApiException e) {
e.printStackTrace();
Log.i(TAG, "Update Num of plays error: " + e.getMessage() );
}
EDIT : as far as I can tell I can’t update “plays” field. I’m creating a url like this :
serviceUrl + '/p/' + partnerId + '/sp/' + partnerId + '00/playManifest/entryId/' + entryId + '/flavorIds/' + flavorIds.join(',') + '/format/applehttp/protocol/http/a.m3u8?ks=' + ks + '&referrer=' + base64_encode(application_name)
and I’m streaming it in an android app. But still “plays” doesn’t updates at all.