Skip to content

video_player plugin: 0.6.4 - Future already completed #19197

@rvowles

Description

@rvowles

I upgraded to this version of the plugin and on iOS on an iPhone 8+ I am getting:

[ +391 ms] [VERBOSE-2:dart_error.cc(16)] Unhandled exception:
[        ] Bad state: Future already completed
[        ] #0      _AsyncCompleter.complete (dart:async/future_impl.dart:39:31)
[        ] #1      VideoPlayerController.initialize.eventListener (package:video_player/video_player.dart:227:33)
[        ] #2      _RootZone.runUnaryGuarded (dart:async/zone.dart:1316:10)
[        ] #3      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
[        ] #4      _DelayedData.perform (dart:async/stream_impl.dart:584:14)
[        ] #5      _StreamImplEvents.handleNext (dart:async/stream_impl.dart:700:11)
[        ] #6      _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:660:7)
[        ] #7      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
[        ] #8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)

I don't see any particular problems, but my customer on his iPhone 6 cannot see the streaming video until the first redraw of the video player (e.g. turning it landscape). I need the video to start playing as soon a possible, but this does not seem to affect this exception, it is always thrown. the initState method is:

_controller = new VideoPlayerController.network(
        event.cameras[0].url,
      )
        ..addListener(() {
          final bool isPlaying = _controller.value.isPlaying;
          if (isPlaying != _isPlaying) {
            setState(() {
              _isPlaying = isPlaying;
            });
          }
          if (_controller.value.hasError) {
            print("error: ${_controller.value.errorDescription}");
          }
        })
        ..initialize().then((_) {
          setState(() {
          _controller.play();
          });
        });

and the video player creation is straight from the example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consolep: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions