Search in sources :

Example 1 with Advertising

use of com.zype.android.webapi.model.player.Advertising 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();
}
Also used : AdvertisingSchedule(com.zype.android.webapi.model.player.AdvertisingSchedule) Advertising(com.zype.android.webapi.model.player.Advertising) AnalyticsDimensions(com.zype.android.webapi.model.player.AnalyticsDimensions) Analytics(com.zype.android.webapi.model.player.Analytics) Subscribe(com.squareup.otto.Subscribe)

Aggregations

Subscribe (com.squareup.otto.Subscribe)1 Advertising (com.zype.android.webapi.model.player.Advertising)1 AdvertisingSchedule (com.zype.android.webapi.model.player.AdvertisingSchedule)1 Analytics (com.zype.android.webapi.model.player.Analytics)1 AnalyticsDimensions (com.zype.android.webapi.model.player.AnalyticsDimensions)1