pause method

Future<void> pause()

暂停滑滑流播放

适用于 TabBar 切换等场景,需要暂停滑滑流播放时调用。

实现方式:

  • Android: 通过设置 Fragment.userVisibleHint = false 来暂停播放
  • iOS: 通过调用 DJXDrawVideoViewController.drawVideoViewControllerDidDisappear() SDK专用方法

使用场景:

  • ✅ 短时间切换(如 TabBar 切换、临时遮挡)
  • ✅ ViewPager 等多页面场景的可见性控制
  • ❌ 长时间停止播放建议直接销毁视图,需要时重新创建

Implementation

Future<void> pause() async {
  _ensureReady();
  try {
    await PangrowthContent.pauseDramaSwipeFlow(_swipeFlowId!);
    debugPrint('DramaSwipeFlowController: 滑滑流已暂停 - $_swipeFlowId');
  } catch (e) {
    debugPrint('DramaSwipeFlowController: 暂停滑滑流失败 - $e');
    rethrow;
  }
}