[Video_player] video play doesn't play or has a black frame when using new version of video_player + chewie on iOS

Hello.
I've black screen when launching video_player on iOS 13.7 on iphone 7 (real device) with mp4 video (network url).
Video is loading but can't be played (no sound also).
Hope i'm giving enought information.
Thank you
video_player: ^0.10.12+2
[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.6 19G73, locale fr-FR)
    • Flutter version 1.20.3 at /Users/Colir/Documents/Flutter/flutter
    • Framework revision 216dee60c0 (2 weeks ago), 2020-09-01 12:24:47 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/Colir/Library/Android/sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.7, Build version 11E801a
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (2 available)
    • Mi A3 (mobile)           • e8c856892b1e                             • android-arm64 • Android 10 (API 29)
    • iPhone de Colir (mobile) • 1d690c3bad00d174027e92c78734d2dbe5ed91fe • ios           • iOS 13.7

• No issues found!

Hi @Colir
Can you please provideflutter run --verbose logs, and a minimal complete reproducible code sample with sample image URL
Thank you

@TahaTesser  yep i'will do that before the week ends.

Hello @TahaTesser . i'm late , sorry for that i'have less time than i thought.
After multiple test, the problem is not really the on i thought.
1/ First, the issue is not "video_player display black screen on ios", but "video_player won't read video on ios"
2/ Secondly, the core of the problem is an issue between video_player and Chewie player's overlay (https://github.com/brianegan/chewie)
When we use this code
    void initState() {
      super.initState();
      _controller = VideoPlayerController.network(_url)
        ..initialize().then((_) {
          setState(() {
            _stackViewIndex = 0;
            _controller.play();
          });
        });

      _chewieController = ChewieController(
        videoPlayerController: _controller,
        aspectRatio: 16.0 / 9.0,
        allowedScreenSleep: false,
        autoPlay: true,
        autoInitialize : true,
        allowFullScreen : true,
        looping: true,
      );
    }

Video is not working (video_player just show the first frame of the video, but can't play it)
However, this code work with video_player 0.9.0
But if we remove this part
    ..initialize().then((_) {
        setState(() {
          _stackViewIndex = 0;
          _controller.play();
        });
      });

All work great.
I'm a little bit confuse, as the first code work with a lower version of video_player....
Anyway thanks for your time.
Apologize me for this wrong issue creation.
If you have any suggestion on how to solve this...
Thanks again

Hi @Colir
To better address, the issue, can you please a complete reproducible minimal code sample.
If it doesn't reproduce with a lower version of video_player, it might be an issue
Thank you

Hi @TahaTesser ,
here is my complete reproducible minimal code sample.
This sample show the bug under ios.
Juste change video_player to version 0.9 in pubspec.yaml to get it work
Thansk you
pubspec.yaml
 name: videoplayer
description: A new Flutter application.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.3
  http: ^0.12.2
  video_player: ^0.10.12+2
  chewie: ^0.9.10

dev_dependencies:
  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  #
  assets:
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

main.dart
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:chewie/chewie.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return  MaterialApp(
          title: 'Video_player Test',
          home: VideoPlayerApp('https://www.sample-videos.com/video312/mp4/480/big_buck_bunny_480p_30mb.mp4','test'),
        );
  }
}

class VideoPlayerApp extends StatefulWidget {
  final url, fileName;

  VideoPlayerApp(this.url,  this.fileName);

  @override
  _VideoPlayerApp createState() => _VideoPlayerApp(this.url, this.fileName);
}

class _VideoPlayerApp extends State<VideoPlayerApp> {
  var _url, _fileName;
  VideoPlayerController _controller;
  ChewieController _chewieController;

  bool startedPlaying = false;
  num _stackViewIndex = 1;

  _VideoPlayerApp(this._url, this._fileName);

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.network(_url)
    // this is the evil part : issue between chewie & video_player
      ..initialize().then((_) {
        setState(() {
          _stackViewIndex = 0;
          _controller.play();
        });
      });
    //

    _chewieController = ChewieController(
      videoPlayerController: _controller,
      aspectRatio: 16.0 / 9.0,
      allowedScreenSleep: false,
      autoPlay: true,
      autoInitialize : true,
      allowFullScreen : true,
      looping: true,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(_fileName),
      ),
      body:  IndexedStack(
          index: _stackViewIndex,
          children :[
            Container (
              color: Colors.black,
              child : Center(
                  child:AspectRatio(
                    aspectRatio: _controller.value.aspectRatio,
                    child: Stack(
                      alignment: Alignment.bottomCenter,
                      children: <Widget>[
                        VideoPlayer(_controller),
                        VideoProgressIndicator(_controller, allowScrubbing: true),
                      ],
                    ),
                  )
              ),
            ),
            Container (
                child : SafeArea(
                  child : Container(
                      child: Center(
                          child: CircularProgressIndicator()
                      )
                  ),
                )
            ),
          ]
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          setState(() {
            _controller.value.isPlaying
                ? _controller.pause()
                : _controller.play();
          });
        },
        child: Icon(
          _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
        ),
      ),
    );
  }

  @override
  void dispose() {
    _controller.dispose();
    _chewieController.dispose();
    super.dispose();
  }

}

Hi @Colir
Thanks for providing reproducible sample
I can reproduce the issue when using  video_player: ^0.10.12+2
Instead of a black screen, I am getting a frozen frame but no issues with video_player: ^0.9.0 and video plays from the code sample

logs

2020-09-29 13:00:16.718611+0530 Runner[3814:1059498] Metal API Validation Enabled
2020-09-29 13:00:16.866205+0530 Runner[3814:1059687] flutter: Observatory listening on http://<IP_ADDRESS>:56231/_4GlVrWg7Zk=/
2020-09-29 13:00:17.300030+0530 Runner[3814:1059498] [VERBOSE-2:FlutterObservatoryPublisher.mm(115)] Failed to register observatory port with mDNS.
2020-09-29 13:00:17.710058+0530 Runner[3814:1059676] [VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: Bad state: Future already completed
#0      _AsyncCompleter.complete (dart:async/future_impl.dart:43:31)
#1      VideoPlayerController.initialize (package:video_player/video_player.dart:276:24)
<asynchronous suspension>
#2      ChewieController._initialize (package:chewie/src/chewie_player.dart:291:35)
<asynchronous suspension>
#3      new ChewieController (package:chewie/src/chewie_player.dart:197:5)
#4      _VideoPlayerApp.initState (package:triage/main.dart:409:25)
#5      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4684:58)
#6      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#7      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#8      Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#9      SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#10     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#11     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#12     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#13     Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#14     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#15     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#16     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#17     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#18     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#19     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#20     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#21     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#22     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#23     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#24     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#25     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#26     Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#27     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#28     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#29     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#30     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#31     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5991:32)
#32     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#33     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#34     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#35     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#36     Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#37     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#38     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#39     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#40     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#41     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#42     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#43     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#44     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#45     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#46     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#47     Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#48     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#49     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#50     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#51     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#52     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#53     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#54     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#55     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#56     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#57     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#58     Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#59     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#60     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#61     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#62     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#63     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#64     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#65     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#66     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#67     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#68     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#69     Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#70     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#71     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#72     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#73     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#74     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#75     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#76     Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#77     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#78     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#79     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#80     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#81     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#82     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#83     Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#84     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#85     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#86     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#87     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#88     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#89     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#90     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#91     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#92     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#93     Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#94     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#95     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#96     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#97     Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#98     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#99     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#100    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#101    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#102    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#103    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#104    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#105    StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#106    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#107    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#108    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#109    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#110    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#111    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#112    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#113    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#114    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#115    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#116    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#117    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#118    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#119    StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#120    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#121    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#122    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#123    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#124    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#125    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#126    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#127    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#128    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#129    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#130    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#131    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#132    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#133    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#134    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#135    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#136    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#137    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#138    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#139    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#140    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#141    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#142    StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#143    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#144    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#145    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#146    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#147    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#148    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#149    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#150    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#151    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#152    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#153    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#154    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#155    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#156    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#157    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#158    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#159    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#160    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#161    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#162    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#163    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#164    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#165    StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#166    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#167    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#168    MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5991:32)
#169    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#170    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#171    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#172    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#173    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#174    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#175    StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#176    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#177    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#178    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#179    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#180    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#181    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#182    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#183    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#184    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#185    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#186    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#187    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#188    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#189    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#190    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#191    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#192    StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#193    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#194    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#195    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#196    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#197    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#198    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#199    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5874:14)
#200    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#201    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#202    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#203    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#204    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#205    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#206    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#207    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#208    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#209    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#210    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#211    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#212    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#213    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#214    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#215    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4719:11)
#216    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#217    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#218    StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4710:11)
#219    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#220    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#221    Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
#222    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4571:16)
#223    Element.rebuild (package:flutter/src/widgets/framework.dart:4262:5)
#224    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4525:5)
#225    ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
#226    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
#2

code sample

import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:chewie/chewie.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video_player Test',
      home: VideoPlayerApp(
          'https://www.sample-videos.com/video312/mp4/480/big_buck_bunny_480p_30mb.mp4',
          'test'),
    );
  }
}

class VideoPlayerApp extends StatefulWidget {
  final url, fileName;

  VideoPlayerApp(this.url, this.fileName);

  @override
  _VideoPlayerApp createState() => _VideoPlayerApp(this.url, this.fileName);
}

class _VideoPlayerApp extends State<VideoPlayerApp> {
  var _url, _fileName;
  VideoPlayerController _controller;
  ChewieController _chewieController;

  bool startedPlaying = false;
  num _stackViewIndex = 1;

  _VideoPlayerApp(this._url, this._fileName);

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.network(_url)
      // this is the evil part : issue between chewie & video_player
      ..initialize().then((_) {
        setState(() {
          _stackViewIndex = 0;
          _controller.play();
        });
      });
    //

    _chewieController = ChewieController(
      videoPlayerController: _controller,
      aspectRatio: 16.0 / 9.0,
      allowedScreenSleep: false,
      autoPlay: true,
      autoInitialize: true,
      allowFullScreen: true,
      looping: true,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(_fileName),
      ),
      body: IndexedStack(index: _stackViewIndex, children: [
        Container(
          color: Colors.black,
          child: Center(
              child: AspectRatio(
            aspectRatio: _controller.value.aspectRatio,
            child: Stack(
              alignment: Alignment.bottomCenter,
              children: <Widget>[
                VideoPlayer(_controller),
                VideoProgressIndicator(_controller, allowScrubbing: true),
              ],
            ),
          )),
        ),
        Container(
            child: SafeArea(
          child: Container(child: Center(child: CircularProgressIndicator())),
        )),
      ]),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          setState(() {
            _controller.value.isPlaying
                ? _controller.pause()
                : _controller.play();
          });
        },
        child: Icon(
          _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
        ),
      ),
    );
  }

  @override
  void dispose() {
    _controller.dispose();
    _chewieController.dispose();
    super.dispose();
  }
}

flutter doctor -v
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.7 19H2, locale en-GB)
    • Flutter version 1.20.4 at /Users/tahatesser/Code/flutter_stable
    • Framework revision fba99f6cf9 (2 weeks ago), 2020-09-14 15:32:52 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tahatesser/Code/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.49.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.14.1

[✓] Connected device (1 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E • ios • iOS 14.0.1

• No issues found!

@TahaTesser yes that is : Freezed frame.
Thank you.

There were a lot of 0.10 releases; if someone could narrow down the regression range to the specific version that broke that would be helpful.

This is still happening with video_player: 1.0.1
It happens to us without using chewie.
Video freezes at first frame, sound keep playing.
Debugging logs in release mode (using Appspector) we get this error:
[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: Bad state: Future already completed
#0 _AsyncCompleter.complete (dart:async/future_impl.dart:45)
#1 VideoPlayerController.initialize (package:video_player/video_player.dart:283)
<asynchronous suspension>

Hi @Colir,
Thanks for filing the issue. I am able to reproduce this issue on the latest stable and the master channel with video_player: ^2.1.6  and chewie: ^1.2.2. I could see the first frame is frozen but the video progressIndicator keeps updating and the audio plays as well. This is happening only on IOS and works fine on Android.
This issue may be related to https://github.com/flutter/flutter/issues/62785

code sample
import 'package:chewie/chewie.dart';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(ChewieDemo());
}

class ChewieDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video_player Test',
      home: VideoPlayerApp(
          'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4',
          'test'),
    );
  }
}

class VideoPlayerApp extends StatefulWidget {
  final url, fileName;

  VideoPlayerApp(this.url, this.fileName);

  @override
  _VideoPlayerApp createState() => _VideoPlayerApp(this.url, this.fileName);
}

class _VideoPlayerApp extends State<VideoPlayerApp> {
  var _url, _fileName;
  late VideoPlayerController _controller;
  late ChewieController _chewieController;

  bool startedPlaying = false;
  int _stackViewIndex = 1;

  _VideoPlayerApp(this._url, this._fileName);

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.network(_url)
      // this is the evil part : issue between chewie & video_player
      ..initialize().then((_) {
        setState(() {
          _stackViewIndex = 0;
          _controller.play();
        });
      });
    //

    _chewieController = ChewieController(
      videoPlayerController: _controller,
      aspectRatio: 16.0 / 9.0,
      allowedScreenSleep: false,
      autoPlay: true,
      autoInitialize: true,
      allowFullScreen: true,
      looping: true,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(_fileName),
      ),
      body: IndexedStack(index: _stackViewIndex, children: [
        Container(
          color: Colors.black,
          child: Center(
              child: AspectRatio(
            aspectRatio: _controller.value.aspectRatio,
            child: Stack(
              alignment: Alignment.bottomCenter,
              children: <Widget>[
                VideoPlayer(_controller),
                VideoProgressIndicator(_controller, allowScrubbing: true),
              ],
            ),
          )),
        ),
        Container(
            child: SafeArea(
          child: Container(child: Center(child: CircularProgressIndicator())),
        )),
      ]),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          setState(() {
            _controller.value.isPlaying
                ? _controller.pause()
                : _controller.play();
          });
        },
        child: Icon(
          _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
        ),
      ),
    );
  }

  @override
  void dispose() {
    _controller.dispose();
    _chewieController.dispose();
    super.dispose();
  }
}

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-arm, locale en-IN)
    • Flutter version 2.2.2 at /Users/mahesh/Documents/flutter
    • Framework revision d79295af24 (3 weeks ago), 2021-06-11 08:56:01 -0700
    • Engine revision 91c9fc8fe0
    • Dart version 2.13.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Community Edition (version 2021.1.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 57.0.5
    • Dart plugin version 211.7233

[✓] VS Code (version 1.57.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.23.0

[✓] Connected device (4 available)
    • Redmi K20 Pro (mobile)     • d9dac45d                             • android-arm64  • Android 10 (API
      29)
    • iPhone 12 Pro Max (mobile) • 6A434744-B348-4FB3-AB10-131292174456 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 11.4
      20F71 darwin-arm
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome
      91.0.4472.114

• No issues found!

[✓] Flutter (Channel master, 2.3.0-17.0.pre.538, on macOS 11.4 20F71 darwin-arm, locale en-IN)
    • Flutter version 2.3.0-17.0.pre.538 at /Users/mahesh/Documents/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 1fd2f7c400 (30 hours ago), 2021-06-27 22:51:02 -0400
    • Engine revision 5d287a2061
    • Dart version 2.14.0 (build 2.14.0-250.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Community Edition (version 2021.1.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 57.0.5
    • Dart plugin version 211.7233

[✓] VS Code (version 1.57.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.23.0

[✓] Connected device (4 available)
    • Redmi K20 Pro (mobile)     • d9dac45d                             • android-arm64  • Android 10 (API
      29)
    • iPhone 12 Pro Max (mobile) • 6A434744-B348-4FB3-AB10-131292174456 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 11.4
      20F71 darwin-arm
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome
      91.0.4472.114

• No issues found!

Same behavior on video_player: ^2.1.12, chewie: ^1.2.2
Any updates?

I am still getting the same issue. Please update if there any solution available. @maheshmnj

@kelidon  Hi, Was you able to solve it? If yes, please help me out.

@ADARSHAGNIHOTRI nope

was anyone able to find a solution for this?

For what's worth, this happens to us randomly on ^2.2.16, not using chewie and using a HLS video.

Any updates?

@Override
void initState() {
super.initState();
initializePlayer();
}

Future initializePlayer() async {
_videoPlayerController =
_videoPlayerController = VideoPlayerController.network(widget.url!);
await Future.wait([_videoPlayerController!.initialize()]);

_chewieController = ChewieController(
  videoPlayerController: _videoPlayerController!,
  autoPlay: true,
  looping: true,
);
setState(() {});
}

It worked for me both the IOS and Android.

what plugin version and flutter version do you use?

Any updates?

I am using the
video_player: ^2.2.7
chewie: ^1.2.2
flutter version : 3.0.0

I am using the
video_player: ^2.2.7
chewie: ^1.2.2
flutter version : 3.0.0
On Sat, Jul 23, 2022 at 6:36 PM Hitesh Aidasani @.***>
wrote:

Any updates?
—
Reply to this email directly, view it on GitHub
https://github.com/flutter/flutter/issues/65853#issuecomment-1193122798,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ADUBSZP74JIBSMNC6VN2YDDVVPU6RANCNFSM4RNG6VUQ
.
You are receiving this because you commented.Message ID:
@.***>

Try this onnce
ChewieController? _chewieController;
late VideoPlayerController _controller;
String? VIDEO_ON;
@override
void initState() {
VIDEO_ON = widget.thumbnail;
initializePlayer();
super.initState();
}
@override
void setState(VoidCallback fn) {
if (mounted) {
super.setState(fn);
}
}
@override
void dispose() {
widget.videoPlayerController.dispose();
_chewieController!.dispose();
super.dispose();
_chewieController!.setVolume(0.0);
}
Future initializePlayer() async {
if (mounted) {
_controller = widget.mediaThumbnail == true
? VideoPlayerController.file(File(VIDEO_ON!))
: VideoPlayerController.network(VIDEO_ON!);
await _controller.initialize();
setState((){
_createChewieController();
});
}

}
_createChewieController() {
_chewieController = ChewieController(
videoPlayerController: _controller,
autoPlay: false,
looping: widget.looping,
allowFullScreen: true,
showOptions: true,
autoInitialize: true,
);
}
@override
Widget build(BuildContext context) {
return SizedBox(
height: MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width * 1,
child: ClipRRect(
child: FittedBox(
fit: BoxFit.cover,
alignment: Alignment.center,
child: _chewieController != null &&
_chewieController!
.videoPlayerController.value.isInitialized
? Chewie(
controller: _chewieController!,
)
: Container())));
}
}

It worked for Android but it was stuck on the first frame on iOS.

This works for me.


Processed interactive commands and streamable output in logs

Solves #577 and also streaming output to logs only https://github.com/OpenDevin/OpenDevin/pull/1625#discussion_r1613652165

@SmartManoj : if this is ready for review again, could you re-request review? You can do it by clicking the "cycle" button next to the reviewers' names.

I don't understand what problem this PR is trying to solve, and how it is solved. Do you mind elaborating more?

Solves #577

It will parse the output and if it requires "yes" confirmation from the user, it will send that.

It will only affect the sandbox.

@SmartManoj wondering if this is going to be continued or should be closed?

Let's close it for now since it has been stale for a while! Feel free to reopen if things progress and need review.

Discussion with @mamoodi on slack,

It will only affect the sandbox.

Confirmation mode will handle this now.


Add shield support

When an NPC has auto switch on, It can switch weapons normally, however it never switches to its wand. Just wondering, could you add support for shield switching?

its "wand"?

If you want shields, show your support in https://github.com/mcmonkey4eva/Sentinel/issues/70

I don't know how shields turned into wands... But yea ill go there.