 			//playerMediator.player.addEventListener(TimeEvent.COMPLETE, onAdComplete);
 			//playerMediator["playContent"]();
 			//TODO track stats
-			sendNotification("adStart",
-							 {timeSlot: getContextString(_currentSequenceContext)});
+			sendNotification("adStart",	 {timeSlot: getContextString(_currentSequenceContext)});
 			(playerMediator["player"] as MediaPlayer).addEventListener( MediaPlayerCapabilityChangeEvent.CAN_PLAY_CHANGE , onAdPlayable );
 			(playerMediator["player"] as MediaPlayer).addEventListener(TimeEvent.DURATION_CHANGE, onAdDurationReceived,false, int.MIN_VALUE);
 			playerMediator["player"]["media"] = _playingAd;
+			
+			
+			var vpaidMetadata:VPAIDMetadata = getVPAIDMetadata();
+			if (vpaidMetadata)
+			{
+				vpaidMetadata.addEventListener(MetadataEvent.VALUE_ADD, function(event:MetadataEvent):void
+				{
+					trace (event.key)
+					if (event.key == "adUserClose")
+					{
+						(playerMediator["player"] as MediaPlayer).removeEventListener(TimeEvent.DURATION_CHANGE, onAdDurationReceived );
+						signalEnd();
+					}
+				});
+			}
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
 		}
 		
 		/**

		{
			playerMediator["player"].addEventListener(MediaErrorEvent.MEDIA_ERROR, onVastAdError);
			playerMediator["cleanMedia"]();
			//_playingAd.addEventListener("traitAdd", onAdPlayable);
			var sequenceProxy : Object = facade.retrieveProxy("sequenceProxy");
			

			}
		}
		
		private function getVPAIDMetadata():VPAIDMetadata
		{
			if (_playingAd is VAST2TrackingProxyElement && ProxyElement((_playingAd as VAST2TrackingProxyElement).proxiedElement && ProxyElement((_playingAd as VAST2TrackingProxyElement).proxiedElement).proxiedElement)
			{
				var vpaidElement:VPAIDElement =ProxyElement((_playingAd as VAST2TrackingProxyElement).proxiedElement).proxiedElement as VPAIDElement;
				var vpaidMetadata:VPAIDMetadata = vpaidElement.getMetadata(vpaidElement.metadataNamespaceURLs[0]) as VPAIDMetadata;
				return vpaidMetadata;
			}
			return null;
		}
		
		private function constructClickTrackings ( vast1ClickTrackings : Vector.<VASTUrl> ) : Array
		{
			var clickTrackings : Array = new Array();
