protected async override void OnNavigatedTo(NavigationEventArgs e) { // Audience Insight config var batchingConfig = await BatchingConfigFactory.Load(new Uri("ms-appx:///AudienceInsightConfig.xml")); var dataClient = (RESTDataClient)batchingConfig.BatchAgent; dataClient.AdditionalHttpHeaders.Add("Authorization-Token", "{2842C782-562E-4250-A1A2-F66D55B5EA15}"); batchingLogAgent = new BatchingLogAgent(batchingConfig); }
public QueueManager(BatchingLogAgent LogAgent) { logAgent = LogAgent; dataClient = logAgent.Configuration.BatchAgent; QueuePollingInterval = logAgent.Configuration.QueuePollingInterval; failedSendCount = 0; sendCount = 0; #if SILVERLIGHT pollingTimer = new Timer(pollingTimer_Tick, null, QueuePollingInterval, QueuePollingInterval); #else pollingTimer = ThreadPoolTimer.CreatePeriodicTimer(pollingTimer_Tick, QueuePollingInterval); #endif }
/// <summary> /// Cleans up the queue manager /// </summary> public void Dispose() { lock (this) { #if SILVERLIGHT pollingTimer.Dispose(); #else pollingTimer.Cancel(); #endif pollingTimer = null; } BatchToRetry = null; logAgent = null; dataClient = null; }
async void player_Loaded(object sender, RoutedEventArgs e) { var configFileUrl = new Uri("ms-appx:///AudienceInsightConfig.xml"); // Audience Insight config var batchingConfig = await BatchingConfigFactory.Load(configFileUrl); var dataClient = (RESTDataClient)batchingConfig.BatchAgent; dataClient.AdditionalHttpHeaders.Add("Authorization-Token", "{2842C782-562E-4250-A1A2-F66D55B5EA15}"); var batchinglogAgent = new BatchingLogAgent(batchingConfig); var aiLoggingTarget = new AudienceInsightLoggingTarget(batchinglogAgent); Microsoft.Media.Analytics.LoggingService.Current.LoggingTargets.Add(aiLoggingTarget); // Player Framework analytics config var analyticsConfig = await AnalyticsConfig.Load(configFileUrl); var analyticsPlugin = new AnalyticsPlugin(analyticsConfig); var adaptivePlugin = player.Plugins.OfType<AdaptivePlugin>().FirstOrDefault(); var adaptiveMonitorFactory = new AdaptiveMonitorFactory(adaptivePlugin.Manager); var edgeServerMonitor = new EdgeServerMonitor(); analyticsPlugin.AdaptiveMonitor = adaptiveMonitorFactory.AdaptiveMonitor; analyticsPlugin.EdgeServerMonitor = edgeServerMonitor; player.Plugins.Add(analyticsPlugin); // Audience Insight ad tracking config analyticsPlugin.AnalyticsCollector.LoggingSources.Add(new AdvertisingLoggingSource(player.GetAdHandlerPlugin().AdHandlerController)); // -or- //LoggingService.Current.LoggingSources.Add(new AdvertisingLoggingSource(player.GetAdHandlerPlugin().AdHandlerController)); }
/// <summary> /// Creates a new AudienceInsightLoggingTarget object /// </summary> /// <param name="batchingLogAgent">The Audience Insight BatchingLogAgent that will receive log data</param> public AudienceInsightLoggingTarget(Microsoft.Media.AudienceInsight.BatchingLogAgent batchingLogAgent) { this.batchingLogAgent = batchingLogAgent; }