Skip to content

Commit 58fe3de

Browse files
committed
Update request failed event params
1 parent 6ba487c commit 58fe3de

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.0.4]
6+
- Added `requset_hostname` and `request_url` parameters in the requestFailed event.
7+
58
## [1.0.3]
69
- Updated iOS Video Data Core.
710

Sources/FastpixVideoDataAVPlayer/AVPlayer.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ public class initAvPlayerTracking: NSObject {
123123

124124
@objc public func handlePlayerItemNewErrorLogEntry(_ notification: Notification) {
125125

126+
let videoURL: String = (initiatedAvPlayer?.currentItem?.asset as? AVURLAsset)?.url.absoluteString ?? ""
127+
let url = URL(string: videoURL)
128+
let host = url?.host
129+
126130
guard let playerItem = notification.object as? AVPlayerItem else {
127131
return
128132
}
@@ -135,9 +139,11 @@ public class initAvPlayerTracking: NSObject {
135139
if !isEnded {
136140

137141
dispatchEvent(event: "requestFailed", metadata: [
138-
"request_error" : errorLogEvent.errorComment ?? "",
142+
"request_error" : errorLogEvent.errorDomain,
139143
"request_error_code" : String(errorLogEvent.errorStatusCode),
140-
"request_error_text" : errorLogEvent.errorDomain
144+
"request_error_text" : errorLogEvent.errorComment ?? "",
145+
"request_hostname" : host as Any,
146+
"request_url" : videoURL
141147
])
142148
}
143149
}

0 commit comments

Comments
 (0)