Git Product home page Git Product logo

Comments (10)

brianegan avatar brianegan commented on May 27, 2024

Thanks! This is a bit of a tricky one, but I think I know where the bug is. I'll try to push up a fix for it over the weekend :)

from chewie.

fukemy avatar fukemy commented on May 27, 2024

Yeah i just face this problem. Used chewie with hero animation then got same problem here. Plz take a look for my problem.

body: new ListView(
        children: <Widget>[
          new Padding(padding: new EdgeInsets.only(top: 1.0)),
          new Hero(
              tag: 'hero1',
              child: new Container(
                child: new Chewie(
                  _videoController,
                  aspectRatio: 16/9,
                  autoPlay: false,
                  autoInitialize: false,
                  showControls: true,
                ),
              )
          )
        ],
      ),
A VideoPlayerController was used after being disposed.
I/flutter ( 6474): Once you have called dispose() on a VideoPlayerController, it can no longer be used.

Thanks you

from chewie.

fukemy avatar fukemy commented on May 27, 2024

Hi. I changed code to

new Hero(
            tag: 'hero$heroId',
            child: new Material(
              child: new AspectRatio(
                aspectRatio: 16 / 9,
                child: new VideoPlayer(_videoController),
              )
            ),
          )

then no problem. Only red screen when using chewie. Plz fix that

from chewie.

marianoarga avatar marianoarga commented on May 27, 2024

@brianegan could this ve related to "didUpdateWidget" disposing the controller? (the hero issue)
https://github.com/brianegan/chewie/blob/master/lib/src/chewie_player.dart#L147

from chewie.

cbenhagen avatar cbenhagen commented on May 27, 2024

Can't reproduce this issue in Chewie 0.9.0. If the issue should persist after updating to 0.9.0, please comment and I will reopen the issue.

from chewie.

SameerDonga avatar SameerDonga commented on May 27, 2024

Hello,

I have tried to implement this inside my Listview widget and I have tried version 0.9.0 as well in 0.9.4 but I got the same issue(Black screen). In my code I just initialize video and i don't want to play it but on click of that I am opening another view and inside that, I play the video.

This is a snippet of my code:

VideoPlayerController _videoPlayerController = VideoPlayerController.network(mediaModel.path); final _chewieController = ChewieController( videoPlayerController: _videoPlayerController, autoPlay: false, looping: false, aspectRatio: 1, showControls: false, autoInitialize: true, overlay: Center( child: InkWell( onTap: () { goToMediaFullScreen(context, mediaModel); }, child: Icon( Icons.play_circle_outline, color: Colors.grey, size: 50, ), ), ));
mediaChildWidget.add(Chewie( controller: _chewieController, ));

Please help.

from chewie.

klaszlo8207 avatar klaszlo8207 commented on May 27, 2024

Any new on this? I get a lot of

"Another exception was thrown: A ChewieController was used after being disposed."

when I try to play a video from a gridview click...

from chewie.

AriCohen8 avatar AriCohen8 commented on May 27, 2024

I am having this issue using version ^0.9.8+1. Can this be reopened?

void initState() {
super.initState();
_chewieController = ChewieController(
videoPlayerController: widget.videoPlayerController,
aspectRatio: 3/4,
autoInitialize: true,
looping: widget.looping,
errorBuilder: (context, errorMessage) {
return Center(
child: Text(
errorMessage,
style: TextStyle(color: Colors.white),
),
);
},
);
}

from chewie.

AriCohen8 avatar AriCohen8 commented on May 27, 2024

This link solved my issue - I needed to move a super.dispose() line to after the chewie.dispose() in my override void dispose area.
#170

from chewie.

GelidGeorge avatar GelidGeorge commented on May 27, 2024

I set the auto dispose parameter to false and dispose it when ever I am off the page... Use same video player controller and update the datasource with setDataSource... set autoplay to false and Add a listener to player controller with BetterPlayerEvents I manage Auto Play and things... One thing that bug me now is If I play video some times video doesn't initialize and throws a playback error only on iOS... And suggestion how to fix this...
Unhandled Exception: PlatformException(VideoError, Failed to load video: Cannot Complete Action, null, null)

from chewie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.