0

I started getting this exception on videos we just uploaded to Vimeo.

My usage:

Future<void> videoPlayerInit() async {
    if (podPlayerController != null) return;

    podPlayerController = PodPlayerController(
      playVideoFrom: PlayVideoFrom.vimeo(
        selectedTrainer!.vimeo!,
        videoPlayerOptions: VideoPlayerOptions(
          allowBackgroundPlayback: true,
        ),
      ),
      podPlayerConfig: const PodPlayerConfig(
        autoPlay: false,
        isLooping: false,
        videoQualityPriority: [1080, 720, 480, 360],
      ),
    );

    await podPlayerController!.initialise();

    videoPlayerReady = true;
}

Sentry Exception Details:

_Exception: Exception: videoQuality cannot be empty
  File "pod_player_controller.dart", line 73, in PodPlayerController._checkAndWaitTillInitialized
  File "pod_player_controller.dart", line 82, in PodPlayerController._checkAndWaitTillInitialized
  File "<asynchronous suspension>"
  File "pod_player_controller.dart", line 82, in PodPlayerController._checkAndWaitTillInitialized
  File "<asynchronous suspension>"
  File "pod_player_controller.dart", line 61, in PodPlayerController.initialise
  File "<asynchronous suspension>"
  File "trainer_profile_controller.dart", line 141, in TrainerProfileController.videoPlayerInit
  • Flutter Version => 3.3.5
  • Dart Version => 2.18.2
  • Pod Player Version => 0.1.0
vaind
  • 1,642
  • 10
  • 19

1 Answers1

0

A possible fix to this issue for Live videos on Youtube,

Step 1: Navigate to the pod method PlayVideoFrom.youtube (WARNING: You will be editing the package code)

you will need to edit the play from youtube method as follows:

factory PlayVideoFrom.youtube(
  String dataSource, {
    required bool live,  //change to this
    VideoFormat? formatHint,
    Future<ClosedCaptionFile>? closedCaptionFile,
    VideoPlayerOptions? videoPlayerOptions,
    Map<String, String> httpHeaders = const {},
  }
) {
  return PlayVideoFrom._(
    live: live, // insert this if absent
    playerType: PodVideoPlayerType.youtube,
    dataSource: dataSource,
    formatHint: formatHint,
    closedCaptionFile: closedCaptionFile,
    videoPlayerOptions: videoPlayerOptions,
    httpHeaders: httpHeaders
  );
}    

Step 2: Now from wherever you call the play from youtube method, you MUST pass the bool value, it is assumed you know when a video is live and when not.

It appears that the package always assigns false to the live parameter by default, which is a problem with live videos.

Tyler2P
  • 2,324
  • 26
  • 22
  • 31
GTG
  • 21
  • 6