use of com.zype.android.webapi.model.player.AnalyticsDimensions in project zype-android by zype.
the class VideoDetailActivity method handleVideoPlayer.
@Subscribe
public void handleVideoPlayer(PlayerVideoEvent event) {
Logger.d("handlePlayer");
String url = event.getEventData().getModelData().getResponse().getBody().getFiles().get(0).getUrl();
DataHelper.saveVideoPlayerLink(getContentResolver(), mVideoId, url);
Advertising advertising = event.getEventData().getModelData().getResponse().getBody().getAdvertising();
Analytics analytics = event.getEventData().getModelData().getResponse().getBody().getAnalytics();
if (advertising != null) {
List<AdvertisingSchedule> schedule = advertising.getSchedule();
DataHelper.updateAdSchedule(getContentResolver(), mVideoId, schedule);
// in the 'VideoList' table. But we do this now because the tags are the same for all ad cue points
if (schedule != null && !schedule.isEmpty()) {
String adTag = advertising.getSchedule().get(0).getTag();
DataHelper.saveAdVideoTag(getContentResolver(), mVideoId, adTag);
}
}
if (analytics != null) {
String beacon = analytics.getBeacon();
AnalyticsDimensions dimensions = analytics.getDimensions();
if (beacon != null && dimensions != null) {
DataHelper.updateAnalytics(getContentResolver(), beacon, dimensions);
}
}
mType = PlayerFragment.TYPE_VIDEO_WEB;
changeFragment(isChromecastConntected());
hideProgress();
}
use of com.zype.android.webapi.model.player.AnalyticsDimensions in project zype-android by zype.
the class VideoHelper method getAnalytics.
public static Analytics getAnalytics(ContentResolver contentResolver, String videoId) {
Analytics result = new Analytics();
Cursor cursor = CursorHelper.getAnalyticsByVideoId(contentResolver, videoId);
if (cursor != null) {
if (cursor.moveToFirst()) {
String beacon = cursor.getString(cursor.getColumnIndexOrThrow(Contract.AnalyticBeacon.BEACON));
result.setBeacon(beacon);
AnalyticsDimensions dimensions = new AnalyticsDimensions();
String siteId = cursor.getString(cursor.getColumnIndexOrThrow(Contract.AnalyticBeacon.SITE_ID));
String playerId = cursor.getString(cursor.getColumnIndexOrThrow(Contract.AnalyticBeacon.PLAYER_ID));
String device = cursor.getString(cursor.getColumnIndexOrThrow(Contract.AnalyticBeacon.DEVICE));
if (videoId != null) {
dimensions.setVideoId(videoId);
}
if (siteId != null) {
dimensions.setSiteId(siteId);
}
if (playerId != null) {
dimensions.setPlayerId(playerId);
}
if (device != null) {
dimensions.setDevice(device);
}
result.setDimensions(dimensions);
}
}
return result;
}
use of com.zype.android.webapi.model.player.AnalyticsDimensions in project zype-android by zype.
the class PlayerFragment method attachPlayerToAnalyticsManager.
//
// Analytics
//
private void attachPlayerToAnalyticsManager() {
if (player != null && analytics != null) {
VideoData video = VideoHelper.getVideo(getActivity().getContentResolver(), fileId);
if (video == null) {
return;
}
AnalyticsDimensions dimensions = analytics.getDimensions();
Context context = getActivity().getApplicationContext();
String beacon = analytics.getBeacon();
String videoUrl = video.getPlayerVideoUrl();
Map<String, String> customDimensions = getCustomDimensions(video, dimensions);
AnalyticsManager manager = AnalyticsManager.getInstance();
manager.trackPlay(context, player, beacon, videoUrl, customDimensions);
}
}
Aggregations