void VideoStartup(Model model, VideoResolution resolution)
        {
            //subscribe to metadata
            IMetadataReceiver metadataReceiver = null;

            if (AppDefaults.visualSettings.EnableGraphicAnnotation)
            {
                string vaConfToken            = model.engineConfToken;
                var    eventMetadataProcessor = new EventMetadataProcessor();
                //eventMetadataProcessor.Processors.Add(new ObjectMotionMetadataProcessor(null, vaConfToken, movingObjectsHolder.EntityInitialized, movingObjectsHolder.EntityChanged, movingObjectsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new MotionAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new RegionMotionAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new LoiteringAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new AbandonedItemAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new TripwireAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new TamperingDetectorAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                var sceneMetadataProcessor = new SceneMetadataProcessor(movingObjectsHolder.EntityInitialized, movingObjectsHolder.EntityChanged, movingObjectsHolder.EntityDeleted);
                var metadataProcessor      = new MetadataProcessor(eventMetadataProcessor, sceneMetadataProcessor);
                metadataReceiver = new MetadataFramer(metadataProcessor.Process);
            }

            vidBuff = new VideoBuffer(resolution.width, resolution.height);

            var streamSetup = new StreamSetup()
            {
                transport = new Transport()
                {
                    protocol = AppDefaults.visualSettings.Transport_Type
                }
            };

            VideoPlayerView playview = new VideoPlayerView();

            disposables.Add(playview);

            player.Child = playview;

            playview.Init(new VideoPlayerView.Model(
                              streamSetup: streamSetup,
                              mediaUri: new MediaUri()
            {
                uri = model.uri
            },
                              encoderResolution: new VideoResolution()
            {
                height = resolution.height,
                width  = resolution.width
            },
                              isUriEnabled: false,   //TODO if true then annotation is not positioned correctly
                              metadataReceiver: metadataReceiver
                              ));

            uriString.Visibility = System.Windows.Visibility.Visible;
            uriString.Text       = model.uri;
        }
        void VideoStartup(Model model)
        {
            var playerAct = activityContext.container.Resolve <IVideoPlayerActivity>();


            //subscribe to metadata
            IMetadataReceiver metadataReceiver = null;

            if (AppDefaults.visualSettings.EnableGraphicAnnotation)
            {
                var eventMetadataProcessor = new EventMetadataProcessor();
                eventMetadataProcessor.Processors.Add(new ObjectMotionMetadataProcessor(model.videoSourceToken, null, movingObjectsHolder.EntityInitialized, movingObjectsHolder.EntityChanged, movingObjectsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new MotionAlarmMetadataProcessor(model.videoSourceToken, null, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new RegionMotionAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new LoiteringAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new AbandonedItemAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new TripwireAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new TamperingDetectorAlarmMetadataProcessor(model.videoSourceToken, null, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                var metadataProcessor = new MetadataProcessor(eventMetadataProcessor, null);
                metadataReceiver = new MetadataFramer(metadataProcessor.Process);
            }

            var playerModel = new VideoPlayerActivityModel(
                profileToken: model.profToken,
                showStreamUrl: false,//TODO when true, annotation is not positioned correctly
                streamSetup: new StreamSetup()
            {
                stream    = StreamType.rtpUnicast,
                transport = new Transport()
                {
                    protocol = AppDefaults.visualSettings.Transport_Type,
                    tunnel   = null
                }
            },
                metadataReceiver: metadataReceiver
                );



            disposables.Add(
                activityContext.container.RunChildActivity(player, playerModel, (c, m) => playerAct.Run(c, m))
                );

            ShowStreamURI();
        }
        void VideoStartup(Model model)
        {
            var playerAct = activityContext.container.Resolve<IVideoPlayerActivity>();


            //subscribe to metadata
            IMetadataReceiver metadataReceiver = null;
            if (AppDefaults.visualSettings.EnableGraphicAnnotation)
            {
                var eventMetadataProcessor = new EventMetadataProcessor();
                eventMetadataProcessor.Processors.Add(new ObjectMotionMetadataProcessor(model.videoSourceToken, null, movingObjectsHolder.EntityInitialized, movingObjectsHolder.EntityChanged, movingObjectsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new MotionAlarmMetadataProcessor(model.videoSourceToken, null, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new RegionMotionAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new LoiteringAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new AbandonedItemAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new TripwireAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new TamperingDetectorAlarmMetadataProcessor(model.videoSourceToken, null, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                var metadataProcessor = new MetadataProcessor(eventMetadataProcessor, null);
                metadataReceiver = new MetadataFramer(metadataProcessor.Process);
            }

            var playerModel = new VideoPlayerActivityModel(
                profileToken: model.profToken,
                showStreamUrl: false,//TODO when true, annotation is not positioned correctly
					 streamSetup: new StreamSetup() {
						 stream = StreamType.rtpUnicast,
						 transport = new Transport() {
							 protocol = AppDefaults.visualSettings.Transport_Type,
							 tunnel = null
						 }
					 },
                metadataReceiver: metadataReceiver
            );

            

            disposables.Add(
                activityContext.container.RunChildActivity(player, playerModel, (c, m) => playerAct.Run(c, m))
            );

            ShowStreamURI();
        }
		void VideoStartup(Model model, VideoResolution resolution) {

			//subscribe to metadata
			IMetadataReceiver metadataReceiver = null;
			if (AppDefaults.visualSettings.EnableGraphicAnnotation) {
				string vaConfToken = model.engineConfToken;
				var eventMetadataProcessor = new EventMetadataProcessor();
				//eventMetadataProcessor.Processors.Add(new ObjectMotionMetadataProcessor(null, vaConfToken, movingObjectsHolder.EntityInitialized, movingObjectsHolder.EntityChanged, movingObjectsHolder.EntityDeleted));
				eventMetadataProcessor.Processors.Add(new MotionAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
				eventMetadataProcessor.Processors.Add(new RegionMotionAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
				eventMetadataProcessor.Processors.Add(new LoiteringAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
				eventMetadataProcessor.Processors.Add(new AbandonedItemAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
				eventMetadataProcessor.Processors.Add(new TripwireAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
				eventMetadataProcessor.Processors.Add(new TamperingDetectorAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
				var sceneMetadataProcessor = new SceneMetadataProcessor(movingObjectsHolder.EntityInitialized, movingObjectsHolder.EntityChanged, movingObjectsHolder.EntityDeleted);
				var metadataProcessor = new MetadataProcessor(eventMetadataProcessor, sceneMetadataProcessor);
				metadataReceiver = new MetadataFramer(metadataProcessor.Process);
			}

			vidBuff = new VideoBuffer(resolution.width, resolution.height);

			var streamSetup = new StreamSetup() {
				transport = new Transport() {
					protocol = AppDefaults.visualSettings.Transport_Type
				}
			};

			VideoPlayerView playview = new VideoPlayerView();
			disposables.Add(playview);

			player.Child = playview;

			playview.Init(new VideoPlayerView.Model(
				streamSetup: streamSetup,
				mediaUri: new MediaUri() { 
					uri = model.uri 
				},
				encoderResolution: new VideoResolution() {
					height = resolution.height,
					width = resolution.width
				},
				isUriEnabled: false, //TODO if true then annotation is not positioned correctly
				metadataReceiver: metadataReceiver
			));

			uriString.Visibility = System.Windows.Visibility.Visible;
			uriString.Text = model.uri;
		}