copyWith method

GlobalPlayerState copyWith({
  1. Scene? activeScene,
  2. VideoPlayerController? videoPlayerController,
  3. bool? isPlaying,
  4. bool? isFullScreen,
  5. bool? isInPipMode,
  6. String? streamMimeType,
  7. String? streamLabel,
  8. String? streamSource,
  9. int? startupLatencyMs,
  10. bool? prewarmAttempted,
  11. bool? prewarmSucceeded,
  12. int? prewarmLatencyMs,
  13. bool? autoplayNext,
  14. bool? showVideoDebugInfo,
  15. bool? useDoubleTapSeek,
  16. bool? enableBackgroundPlayback,
  17. bool? enableNativePip,
  18. bool clearActive = false,
})

Implementation

GlobalPlayerState copyWith({
  Scene? activeScene,
  VideoPlayerController? videoPlayerController,
  bool? isPlaying,
  bool? isFullScreen,
  bool? isInPipMode,
  String? streamMimeType,
  String? streamLabel,
  String? streamSource,
  int? startupLatencyMs,
  bool? prewarmAttempted,
  bool? prewarmSucceeded,
  int? prewarmLatencyMs,
  bool? autoplayNext,
  bool? showVideoDebugInfo,
  bool? useDoubleTapSeek,
  bool? enableBackgroundPlayback,
  bool? enableNativePip,
  bool clearActive = false,
}) {
  return GlobalPlayerState(
    activeScene: clearActive ? null : (activeScene ?? this.activeScene),
    videoPlayerController: clearActive
        ? null
        : (videoPlayerController ?? this.videoPlayerController),
    isPlaying: isPlaying ?? this.isPlaying,
    isFullScreen: isFullScreen ?? this.isFullScreen,
    isInPipMode: isInPipMode ?? this.isInPipMode,
    streamMimeType: clearActive
        ? null
        : (streamMimeType ?? this.streamMimeType),
    streamLabel: clearActive ? null : (streamLabel ?? this.streamLabel),
    streamSource: clearActive ? null : (streamSource ?? this.streamSource),
    startupLatencyMs: clearActive
        ? null
        : (startupLatencyMs ?? this.startupLatencyMs),
    prewarmAttempted: clearActive
        ? null
        : (prewarmAttempted ?? this.prewarmAttempted),
    prewarmSucceeded: clearActive
        ? null
        : (prewarmSucceeded ?? this.prewarmSucceeded),
    prewarmLatencyMs: clearActive
        ? null
        : (prewarmLatencyMs ?? this.prewarmLatencyMs),
    autoplayNext: autoplayNext ?? this.autoplayNext,
    showVideoDebugInfo: showVideoDebugInfo ?? this.showVideoDebugInfo,
    useDoubleTapSeek: useDoubleTapSeek ?? this.useDoubleTapSeek,
    enableBackgroundPlayback:
        enableBackgroundPlayback ?? this.enableBackgroundPlayback,
    enableNativePip: enableNativePip ?? this.enableNativePip,
  );
}