wenweiwei 3 lat temu
rodzic
commit
3622656f6f

+ 5 - 3
BFFramework/Classes/BFModules/BFUtility/PQSingletoVideoPlayer.swift

@@ -260,7 +260,7 @@ extension PQSingletoVideoPlayer: TXVodPlayListener {
             if !isPlayerError, playVideoData != nil {
                 isPlayerError = true
                 // 播放失败
-                PQEventTrackViewModel.videoRelationReportUpload(reportLogType: .reportLogType_Frontend, videoData: playVideoData, pageSource: nil, businessType: .bt_videoPlayError, objectType: nil, extParams: ["pageSource": playVideoData!.pageSource.rawValue, "networkType": networkStatus(), "extra": "0", "hasRetry": true, "url": playVideoData?.videoPath ?? "", "videoId": playVideoData?.uniqueId ?? "0", "what": event], shareId: nil, videoIds: nil, playId: playId)
+                PQEventTrackViewModel.videoRelationReportUpload(reportLogType: .reportLogType_Action, videoData: playVideoData, pageSource: nil, businessType: .bt_videoPlayError, objectType: nil, extParams: ["pageSource": playVideoData!.pageSource.rawValue, "networkType": networkStatus(), "extra": "0", "hasRetry": true, "url": playVideoData?.videoPath ?? "", "videoId": playVideoData?.uniqueId ?? "0", "what": event], shareId: nil, videoIds: nil, playId: playId)
             }
         case PLAY_ERR_FILE_NOT_FOUND.rawValue: // 播放文件不存在
             if playStatusBloc != nil {
@@ -269,22 +269,24 @@ extension PQSingletoVideoPlayer: TXVodPlayListener {
             if !isPlayerError, playVideoData != nil {
                 isPlayerError = true
                 // 播放失败
-                PQEventTrackViewModel.videoRelationReportUpload(reportLogType: .reportLogType_Frontend, videoData: playVideoData, pageSource: nil, businessType: .bt_videoPlayError, objectType: nil, extParams: ["pageSource": playVideoData!.pageSource.rawValue, "networkType": networkStatus(), "extra": "0", "hasRetry": false, "url": playVideoData?.videoPath ?? "", "videoId": playVideoData?.uniqueId ?? "0", "what": event], shareId: nil, videoIds: nil, playId: playId)
+                PQEventTrackViewModel.videoRelationReportUpload(reportLogType: .reportLogType_Action, videoData: playVideoData, pageSource: nil, businessType: .bt_videoPlayError, objectType: nil, extParams: ["pageSource": playVideoData!.pageSource.rawValue, "networkType": networkStatus(), "extra": "0", "hasRetry": false, "url": playVideoData?.videoPath ?? "", "videoId": playVideoData?.uniqueId ?? "0", "what": event], shareId: nil, videoIds: nil, playId: playId)
             }
         case PLAY_ERR_HEVC_DECODE_FAIL.rawValue, PLAY_ERR_HLS_KEY.rawValue, PLAY_ERR_GET_PLAYINFO_FAIL.rawValue, PLAY_WARNING_VIDEO_DECODE_FAIL.rawValue, PLAY_WARNING_AUDIO_DECODE_FAIL.rawValue: // H265解码失败,HLS解码key获取失败,获取点播文件信息失败,当前视频解码失败,当前音频解码失败
 
             if !isPlayerError, playVideoData != nil {
                 isPlayerError = true
                 // 播放失败
-                PQEventTrackViewModel.videoRelationReportUpload(reportLogType: .reportLogType_Frontend, videoData: playVideoData, pageSource: nil, businessType: .bt_videoPlayError, objectType: nil, extParams: ["pageSource": playVideoData!.pageSource.rawValue, "networkType": networkStatus(), "extra": "0", "hasRetry": false, "url": playVideoData?.videoPath ?? "", "videoId": playVideoData?.uniqueId ?? "0", "what": event], shareId: nil, videoIds: nil, playId: playId)
+                PQEventTrackViewModel.videoRelationReportUpload(reportLogType: .reportLogType_Action, videoData: playVideoData, pageSource: nil, businessType: .bt_videoPlayError, objectType: nil, extParams: ["pageSource": playVideoData!.pageSource.rawValue, "networkType": networkStatus(), "extra": "0", "hasRetry": false, "url": playVideoData?.videoPath ?? "", "videoId": playVideoData?.uniqueId ?? "0", "what": event], shareId: nil, videoIds: nil, playId: playId)
             }
         case PLAY_WARNING_RECONNECT.rawValue: // 断线重连已启动重新连接
             if playStatusBloc != nil {
                 playStatusBloc!(.PQVIDEO_PLAY_STATUS_RECONNECT)
             }
+            PQEventTrackViewModel.videoRelationReportUpload(reportLogType: .reportLogType_Action, videoData: playVideoData, pageSource: nil, businessType: .bt_videoPlayException, objectType: nil, extParams: ["pageSource": playVideoData!.pageSource.rawValue, "networkType": networkStatus(), "extra": "0", "hasRetry": true, "url": playVideoData?.videoPath ?? "", "videoId": playVideoData?.uniqueId ?? "0", "what": event], shareId: nil, videoIds: nil, playId: playId)
         case PLAY_WARNING_RECV_DATA_LAG.rawValue, PLAY_WARNING_VIDEO_PLAY_LAG.rawValue: // 网络来包不稳:可能是下行带宽不足 | 当前视频播放出现卡顿(用户直观感受)
             // 播放失败
             PQEventTrackViewModel.videoRelationReportUpload(reportLogType: .reportLogType_Frontend, videoData: playVideoData, pageSource: nil, businessType: .bt_videoPlaySlow, objectType: nil, extParams: ["pageSource": playVideoData!.pageSource.rawValue, "networkType": networkStatus(), "url": playVideoData?.videoPath ?? "", "videoId": playVideoData?.uniqueId ?? "0", "what": event, "position": player.currentPlaybackTime()], shareId: nil, videoIds: nil, playId: playId)
+            PQEventTrackViewModel.videoRelationReportUpload(reportLogType: .reportLogType_Action, videoData: playVideoData, pageSource: nil, businessType: .bt_videoPlayException, objectType: nil, extParams: ["pageSource": playVideoData!.pageSource.rawValue, "networkType": networkStatus(), "extra": "0", "hasRetry": true, "url": playVideoData?.videoPath ?? "", "videoId": playVideoData?.uniqueId ?? "0", "what": event], shareId: nil, videoIds: nil, playId: playId)
         default:
             break
         }

+ 4 - 3
BFFramework/Classes/EventTrack/ViewModel/PQEventTrackViewModel.swift

@@ -75,7 +75,7 @@ public class PQEventTrackViewModel: NSObject {
                 tempExtParams["rootProjectId"] = (videoData as? PQVideoListModel)?.reCreateVideoData?.rootProjectId ?? ""
                 tempExtParams["canProduce"] = (videoData as? PQVideoListModel)?.reCreateVideoData?.canReproduce ?? 0
                 if !tempExtParams.keys.contains("clickedVideoId") {
-                    tempExtParams["videoId"] = videoData?.uniqueId ?? "0"
+                    tempExtParams["videoId"] = "\(videoData?.id ?? 0)"
                 }
                 if (videoData as? PQVideoListModel)?.reCreateVideoData?.parentVideoId != nil {
                     tempExtParams["parentVideoId"] = (videoData as? PQVideoListModel)?.reCreateVideoData?.parentVideoId ?? ""
@@ -86,10 +86,10 @@ public class PQEventTrackViewModel: NSObject {
         if objectType == .ot_reproduce_clickButton || objectType == .ot_reproduce_collectionBar || objectType == .ot_reproduce_collectionClicButton || objectType == .ot_reproduce_sameSourceButton {
             PQEventTrackViewModel.baseReportUpload(businessType: businessType, objectType: objectType, pageSource: pageSource != nil ? pageSource! : (videoData?.pageSource ?? .sp_category), extParams: tempExtParams, remindmsg: "再创作上报")
         } else {
-            PQEventTrackViewModel.reportVideoPlayUpload(reportLogType: reportLogType, videoId: videoData?.uniqueId ?? "0", headVideoId: headVideoId ?? videoData?.headVideoId, videoIds: videoIds, pageSource: pageSource != nil ? pageSource! : (videoData?.pageSource ?? .sp_category), playId: playId ?? "", recommendId: videoData?.recommendId, recommendLogVO: videoData?.recommendLogVO, abInfoData: videoData?.abInfoData, measureType: videoData?.measureType, measureId: videoData?.measureId, businessType: businessType, shareId: shareId ?? "", extParams: tempExtParams, objectType: objectType)
+            PQEventTrackViewModel.reportVideoPlayUpload(reportLogType: reportLogType, videoId: videoData?.uniqueId ?? "0", headVideoId: headVideoId ?? videoData?.headVideoId, videoIds: (videoIds == nil ? "\(videoData?.id ?? 0)" : videoIds), pageSource: pageSource != nil ? pageSource! : (videoData?.pageSource ?? .sp_category), playId: playId ?? "", recommendId: videoData?.recommendId, recommendLogVO: videoData?.recommendLogVO, abInfoData: videoData?.abInfoData, measureType: videoData?.measureType, measureId: videoData?.measureId, businessType: businessType, shareId: shareId ?? "", extParams: tempExtParams, objectType: objectType)
         }
     }
-
+    
     /// 播放相关数据上报
     /// - Parameters:
     ///   - reportLogType: 日志类型
@@ -164,6 +164,7 @@ public class PQEventTrackViewModel: NSObject {
                     params["rootLaunchShareId"] = shareId
                     params["parentShareId"] = shareId
                     params["shareDepth"] = "0"
+                    params["videoId"] = videoIds
                 }
                 if businessType != nil {
                     params["businessType"] = businessType?.rawValue