Search in sources :

Example 1 with AnalyticBeacon

use of com.zype.android.Db.Entity.AnalyticBeacon in project zype-android by zype.

the class PlayerFragment method attachPlayerToAnalyticsManager.

// Analytics
private void attachPlayerToAnalyticsManager(String url) {
    AnalyticBeacon analyticsBeacon = playerViewModel.getAnalyticBeacon();
    if (player != null && analyticsBeacon != null) {
        videoViewModel.getVideo().observe(this, video -> {
            Context context = getActivity().getApplicationContext();
            String beacon = analyticsBeacon.beacon;
            Map<String, String> customDimensions = getCustomDimensions(analyticsBeacon, video.title);
            AnalyticsManager manager = AnalyticsManager.getInstance();
            manager.trackPlay(context, player, beacon, url, customDimensions);
        });
    }
}
Also used : AnalyticBeacon(com.zype.android.Db.Entity.AnalyticBeacon) Context(android.content.Context) CastContext(com.google.android.gms.cast.framework.CastContext)

Example 2 with AnalyticBeacon

use of com.zype.android.Db.Entity.AnalyticBeacon in project zype-android by zype.

the class DbHelper method analyticsApiToEntity.

public static AnalyticBeacon analyticsApiToEntity(Analytics analytics) {
    AnalyticBeacon result = new AnalyticBeacon();
    result.beacon = analytics.beacon;
    AnalyticsDimensions dimensions = analytics.dimensions;
    result.device = dimensions.device;
    result.playerId = dimensions.playerId;
    result.siteId = dimensions.siteId;
    result.videoId = dimensions.videoId;
    return result;
}
Also used : AnalyticBeacon(com.zype.android.Db.Entity.AnalyticBeacon) AnalyticsDimensions(com.zype.android.zypeapi.model.AnalyticsDimensions)

Aggregations

AnalyticBeacon (com.zype.android.Db.Entity.AnalyticBeacon)2 Context (android.content.Context)1 CastContext (com.google.android.gms.cast.framework.CastContext)1 AnalyticsDimensions (com.zype.android.zypeapi.model.AnalyticsDimensions)1