@@ -142,8 +142,11 @@ - (NSMutableDictionary *)getAttributes:(NSString *)action attributes:(NSDictiona
142142
143143 if (self.state .isAd ) {
144144 [attr setObject: [self getTitle ] forKey: @" adTitle" ];
145- [attr setObject: [self getBitrate ] forKey: @" adBitrate" ];
146- [attr setObject: [self getRenditionBitrate ] forKey: @" adRenditionBitrate" ];
145+ // Only add bitrate attributes after ad has started (first frame shown)
146+ if ([self .state isStarted ]) {
147+ [attr setObject: [self getBitrate ] forKey: @" adBitrate" ];
148+ [attr setObject: [self getRenditionBitrate ] forKey: @" adRenditionBitrate" ];
149+ }
147150 [attr setObject: [self getRenditionWidth ] forKey: @" adRenditionWidth" ];
148151 [attr setObject: [self getRenditionHeight ] forKey: @" adRenditionHeight" ];
149152 [attr setObject: [self getDuration ] forKey: @" adDuration" ];
@@ -178,11 +181,14 @@ - (NSMutableDictionary *)getAttributes:(NSString *)action attributes:(NSDictiona
178181 [attr setObject: @(self .totalAdPlaytime) forKey: @" totalAdPlaytime" ];
179182 }
180183 [attr setObject: [self getTitle ] forKey: @" contentTitle" ];
181- [attr setObject: [self getBitrate ] forKey: @" contentBitrate" ];
182- if ([self respondsToSelector: @selector (getObservedBitrate )]) {
183- [attr setObject: [self getObservedBitrate ] forKey: @" contentObservedBitrate" ];
184+ // Only add bitrate attributes after content has started (first frame shown)
185+ if ([self .state isStarted ]) {
186+ [attr setObject: [self getBitrate ] forKey: @" contentBitrate" ];
187+ if ([self respondsToSelector: @selector (getObservedBitrate )]) {
188+ [attr setObject: [self getObservedBitrate ] forKey: @" contentObservedBitrate" ];
189+ }
190+ [attr setObject: [self getRenditionBitrate ] forKey: @" contentRenditionBitrate" ];
184191 }
185- [attr setObject: [self getRenditionBitrate ] forKey: @" contentRenditionBitrate" ];
186192 [attr setObject: [self getRenditionWidth ] forKey: @" contentRenditionWidth" ];
187193 [attr setObject: [self getRenditionHeight ] forKey: @" contentRenditionHeight" ];
188194 [attr setObject: [self getDuration ] forKey: @" contentDuration" ];
0 commit comments