删除埋点,im和客服
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:analytics_sdk/enum/video_event_enum.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -38,7 +37,6 @@ import '../../tools_base/debug_log.dart';
|
||||
import '../../tools_base/event_bus/event_bus_util.dart';
|
||||
import '../../tools_base/event_bus/events.dart';
|
||||
import '../../tools_base/global_store/store.dart';
|
||||
import '../../track_event_manager/track_manager.dart';
|
||||
import '../main_page/provider/msg_provider.dart';
|
||||
import '../pre_sale/pre_sale_provider.dart';
|
||||
|
||||
@@ -342,7 +340,6 @@ class VideoLogic extends GetxController with GetSingleTickerProviderStateMixin {
|
||||
/// 注:贴片广告期间不直接 play,由广告结束回调触发本方法(见 video_page.dart 的 onFinish)
|
||||
void play() {
|
||||
if (isDispose || isShowAd) return; // 有贴片广告时不自动播,等广告结束回调
|
||||
TrackVideoManager.send(VideoEventEnum.VIDEO_PLAY, videoModel, playerCtr, isPreVideo: _isPreview());
|
||||
playerCtr?.play();
|
||||
_startPayGuideTimer(); // 需付费的起播满3秒 → 前置购买引导(场景1);不满足条件的它自己会挡
|
||||
}
|
||||
@@ -399,7 +396,6 @@ class VideoLogic extends GetxController with GetSingleTickerProviderStateMixin {
|
||||
try {
|
||||
await playerCtr?.initialize();
|
||||
if (isRetry) confirmPlatformView(); // 仅重试成功(同视频 textureView 挂、platformView 放出)才落本地
|
||||
TrackVideoManager.send(VideoEventEnum.VIDEO_VIEW, videoModel, playerCtr, isPreVideo: _isPreview());
|
||||
update();
|
||||
} catch (e) {
|
||||
debugLog("视频初始化失败:$e play url = $videoUrl");
|
||||
@@ -469,9 +465,6 @@ class VideoLogic extends GetxController with GetSingleTickerProviderStateMixin {
|
||||
return;
|
||||
}
|
||||
int duration = playerCtr?.value.duration.inSeconds ?? 0;
|
||||
if (duration > 0 && playerCtr!.value.position.inSeconds >= duration - 1) {
|
||||
_trackComplete();
|
||||
}
|
||||
if (_hasFreeWatchRight) return; // 免费次数/免费区/动漫已购/免费章节/VIP金币限免,整片随便看
|
||||
if (!_isPreview()) {
|
||||
//每帧都走这里,videoStatus 是重算 getter,只读一次
|
||||
@@ -572,15 +565,9 @@ class VideoLogic extends GetxController with GetSingleTickerProviderStateMixin {
|
||||
return videoModel?.previewURL?.isNotEmpty == true && videoStatus.isNeedPay;
|
||||
}
|
||||
|
||||
/// 上报当前视频播放结束(切视频/切集/退页统一入口)
|
||||
void _trackComplete() {
|
||||
TrackVideoManager.send(VideoEventEnum.VIDEO_COMPLETE, videoModel, playerCtr, isPreVideo: _isPreview());
|
||||
}
|
||||
|
||||
/// 推荐区切内容(释放控制器 + 重拉详情起播,不开新页)。
|
||||
/// **必须按被点内容的 videoType 定接口**,用页面入参会串接口 → 「视频资源加载失败」
|
||||
Future<void> switchVideo(VideoModel model) async {
|
||||
_trackComplete();
|
||||
videoModel = model;
|
||||
isShowBuy.value = false;
|
||||
isCartoon = model.videoType == 1;
|
||||
@@ -601,7 +588,6 @@ class VideoLogic extends GetxController with GetSingleTickerProviderStateMixin {
|
||||
/// 切视频或切 CDN 路线:[model] 非空=切新视频,为空=同视频换 URL;控制器为空走首次进入路径
|
||||
Future<void> startPlay({VideoModel? model, bool resetPos = false}) async {
|
||||
if (model != null) {
|
||||
_trackComplete();
|
||||
videoModel = model;
|
||||
}
|
||||
if (playerCtr == null) {
|
||||
@@ -619,7 +605,6 @@ class VideoLogic extends GetxController with GetSingleTickerProviderStateMixin {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
_trackComplete();
|
||||
currentEpisode = episode;
|
||||
isShowBuy.value = false;
|
||||
releasePlayer(rebuild: false);
|
||||
@@ -653,13 +638,12 @@ class VideoLogic extends GetxController with GetSingleTickerProviderStateMixin {
|
||||
playerCtr = null;
|
||||
}
|
||||
|
||||
/// 页面销毁清理:上报 VIDEO_COMPLETE → 取消事件订阅 → 非预览视频上报观看记录 → 释放播放器
|
||||
/// 页面销毁清理:取消事件订阅 → 非预览视频上报观看记录 → 释放播放器
|
||||
@override
|
||||
void onClose() {
|
||||
isDispose = true; // 第一时间置位,让所有异步回调(initialize/postFrame/Future.delayed)能尽早 return
|
||||
TimedPopupManager().cancel(TimedPopupType.freeWatchPay);
|
||||
TimedPopupManager().cancel(TimedPopupType.videoPayAhead);
|
||||
_trackComplete();
|
||||
|
||||
playerCtr?.pause();
|
||||
playerCtr?.removeListener(_onProgress);
|
||||
|
||||
Reference in New Issue
Block a user