Flutter using videoplayer in a listview returning multiple errors










0















I have a tabBarView with a listview in one of the tabs.I have the gesture detector below inside the listview. I am trying to show some newtwork videos.



VideoPlayerController playercontroller;
VideoPlayerController retcontroller(String varainatVideo)
if(playercontroller == null)
playercontroller = VideoPlayerController.network(varainatVideo);

return playercontroller;


GestureDetector(
child:AspectRatio(
aspectRatio: 16/9,
child:Stack(
children:<Widgets>[

Chewie(

retcontroller(stringVideo),

cupertinoProgressColors: ChewieProgressColors(),
showControls:false,
),

]
)
)
);


whenever I switch from that tab bar to another and try to navigate to another page in the second tabBar I get a black screen instead of the normal page.but when I remove the videoPage I dont get this problem and get this in the console



I/flutter (19985): Another exception was thrown: There are multiple heroes that share the same tag within a subtree.
I/flutter (19985): Another exception was thrown: There are multiple heroes that share the same tag within a subtree.


logs from the Debug console:
I have tried to figure out what, but I cant seem to get the Hero Tag associated with the videoPlayerController in order to set it to null.



I/flutter (19985): ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (19985): The following assertion was thrown during a scheduler callback:
I/flutter (19985): There are multiple heroes that share the same tag within a subtree.
I/flutter (19985): Within each subtree for which heroes are to be animated (typically a PageRoute subtree), each Hero
I/flutter (19985): must have a unique non-null tag.
I/flutter (19985): In this case, multiple heroes had the following tag:
I/flutter (19985): VideoPlayerController#3144c(VideoPlayerValue(duration: null, size: null, position: 0:00:00.000000,
I/flutter (19985): buffered: , isPlaying: false, isLooping: false, isBuffering: falsevolume: 1.0, errorDescription:
I/flutter (19985): null))
I/flutter (19985): Here is the subtree for one of the offending heroes:
I/flutter (19985): # Hero(tag: VideoPlayerController#3144c(VideoPlayerValue(duration: null, size: null, position: 0:00:00.000000, buffered: , isPlaying: false, isLooping: false, isBuffering: falsevolume: 1.0, errorDescription: null)), state: _HeroState#b5c8f)
I/flutter (19985): # └KeyedSubtree-[GlobalKey#44acd]
I/flutter (19985): # └AspectRatio(aspectRatio: 1.7, renderObject: RenderAspectRatio#78caa relayoutBoundary=up2)
I/flutter (19985): # └VideoPlayer(state: _VideoPlayerState#62908)
I/flutter (19985): # └Container
I/flutter (19985): # └LimitedBox(maxWidth: 0.0, maxHeight: 0.0, renderObject: RenderLimitedBox#9e9b5)
I/flutter (19985): # └ConstrainedBox(BoxConstraints(biggest), renderObject: RenderConstrainedBox#1b4cb)
I/flutter (19985):
I/flutter (19985): When the exception was thrown, this was the stack:
I/flutter (19985): #0 Hero._allHeroesFor.visitor.<anonymous closure> (package:flutter/src/widgets/heroes.dart:191:13)
I/flutter (19985): #1 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:201:10)
I/flutter (19985): #2 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4784:14)









share|improve this question




























    0















    I have a tabBarView with a listview in one of the tabs.I have the gesture detector below inside the listview. I am trying to show some newtwork videos.



    VideoPlayerController playercontroller;
    VideoPlayerController retcontroller(String varainatVideo)
    if(playercontroller == null)
    playercontroller = VideoPlayerController.network(varainatVideo);

    return playercontroller;


    GestureDetector(
    child:AspectRatio(
    aspectRatio: 16/9,
    child:Stack(
    children:<Widgets>[

    Chewie(

    retcontroller(stringVideo),

    cupertinoProgressColors: ChewieProgressColors(),
    showControls:false,
    ),

    ]
    )
    )
    );


    whenever I switch from that tab bar to another and try to navigate to another page in the second tabBar I get a black screen instead of the normal page.but when I remove the videoPage I dont get this problem and get this in the console



    I/flutter (19985): Another exception was thrown: There are multiple heroes that share the same tag within a subtree.
    I/flutter (19985): Another exception was thrown: There are multiple heroes that share the same tag within a subtree.


    logs from the Debug console:
    I have tried to figure out what, but I cant seem to get the Hero Tag associated with the videoPlayerController in order to set it to null.



    I/flutter (19985): ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
    I/flutter (19985): The following assertion was thrown during a scheduler callback:
    I/flutter (19985): There are multiple heroes that share the same tag within a subtree.
    I/flutter (19985): Within each subtree for which heroes are to be animated (typically a PageRoute subtree), each Hero
    I/flutter (19985): must have a unique non-null tag.
    I/flutter (19985): In this case, multiple heroes had the following tag:
    I/flutter (19985): VideoPlayerController#3144c(VideoPlayerValue(duration: null, size: null, position: 0:00:00.000000,
    I/flutter (19985): buffered: , isPlaying: false, isLooping: false, isBuffering: falsevolume: 1.0, errorDescription:
    I/flutter (19985): null))
    I/flutter (19985): Here is the subtree for one of the offending heroes:
    I/flutter (19985): # Hero(tag: VideoPlayerController#3144c(VideoPlayerValue(duration: null, size: null, position: 0:00:00.000000, buffered: , isPlaying: false, isLooping: false, isBuffering: falsevolume: 1.0, errorDescription: null)), state: _HeroState#b5c8f)
    I/flutter (19985): # └KeyedSubtree-[GlobalKey#44acd]
    I/flutter (19985): # └AspectRatio(aspectRatio: 1.7, renderObject: RenderAspectRatio#78caa relayoutBoundary=up2)
    I/flutter (19985): # └VideoPlayer(state: _VideoPlayerState#62908)
    I/flutter (19985): # └Container
    I/flutter (19985): # └LimitedBox(maxWidth: 0.0, maxHeight: 0.0, renderObject: RenderLimitedBox#9e9b5)
    I/flutter (19985): # └ConstrainedBox(BoxConstraints(biggest), renderObject: RenderConstrainedBox#1b4cb)
    I/flutter (19985):
    I/flutter (19985): When the exception was thrown, this was the stack:
    I/flutter (19985): #0 Hero._allHeroesFor.visitor.<anonymous closure> (package:flutter/src/widgets/heroes.dart:191:13)
    I/flutter (19985): #1 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:201:10)
    I/flutter (19985): #2 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4784:14)









    share|improve this question


























      0












      0








      0








      I have a tabBarView with a listview in one of the tabs.I have the gesture detector below inside the listview. I am trying to show some newtwork videos.



      VideoPlayerController playercontroller;
      VideoPlayerController retcontroller(String varainatVideo)
      if(playercontroller == null)
      playercontroller = VideoPlayerController.network(varainatVideo);

      return playercontroller;


      GestureDetector(
      child:AspectRatio(
      aspectRatio: 16/9,
      child:Stack(
      children:<Widgets>[

      Chewie(

      retcontroller(stringVideo),

      cupertinoProgressColors: ChewieProgressColors(),
      showControls:false,
      ),

      ]
      )
      )
      );


      whenever I switch from that tab bar to another and try to navigate to another page in the second tabBar I get a black screen instead of the normal page.but when I remove the videoPage I dont get this problem and get this in the console



      I/flutter (19985): Another exception was thrown: There are multiple heroes that share the same tag within a subtree.
      I/flutter (19985): Another exception was thrown: There are multiple heroes that share the same tag within a subtree.


      logs from the Debug console:
      I have tried to figure out what, but I cant seem to get the Hero Tag associated with the videoPlayerController in order to set it to null.



      I/flutter (19985): ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
      I/flutter (19985): The following assertion was thrown during a scheduler callback:
      I/flutter (19985): There are multiple heroes that share the same tag within a subtree.
      I/flutter (19985): Within each subtree for which heroes are to be animated (typically a PageRoute subtree), each Hero
      I/flutter (19985): must have a unique non-null tag.
      I/flutter (19985): In this case, multiple heroes had the following tag:
      I/flutter (19985): VideoPlayerController#3144c(VideoPlayerValue(duration: null, size: null, position: 0:00:00.000000,
      I/flutter (19985): buffered: , isPlaying: false, isLooping: false, isBuffering: falsevolume: 1.0, errorDescription:
      I/flutter (19985): null))
      I/flutter (19985): Here is the subtree for one of the offending heroes:
      I/flutter (19985): # Hero(tag: VideoPlayerController#3144c(VideoPlayerValue(duration: null, size: null, position: 0:00:00.000000, buffered: , isPlaying: false, isLooping: false, isBuffering: falsevolume: 1.0, errorDescription: null)), state: _HeroState#b5c8f)
      I/flutter (19985): # └KeyedSubtree-[GlobalKey#44acd]
      I/flutter (19985): # └AspectRatio(aspectRatio: 1.7, renderObject: RenderAspectRatio#78caa relayoutBoundary=up2)
      I/flutter (19985): # └VideoPlayer(state: _VideoPlayerState#62908)
      I/flutter (19985): # └Container
      I/flutter (19985): # └LimitedBox(maxWidth: 0.0, maxHeight: 0.0, renderObject: RenderLimitedBox#9e9b5)
      I/flutter (19985): # └ConstrainedBox(BoxConstraints(biggest), renderObject: RenderConstrainedBox#1b4cb)
      I/flutter (19985):
      I/flutter (19985): When the exception was thrown, this was the stack:
      I/flutter (19985): #0 Hero._allHeroesFor.visitor.<anonymous closure> (package:flutter/src/widgets/heroes.dart:191:13)
      I/flutter (19985): #1 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:201:10)
      I/flutter (19985): #2 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4784:14)









      share|improve this question
















      I have a tabBarView with a listview in one of the tabs.I have the gesture detector below inside the listview. I am trying to show some newtwork videos.



      VideoPlayerController playercontroller;
      VideoPlayerController retcontroller(String varainatVideo)
      if(playercontroller == null)
      playercontroller = VideoPlayerController.network(varainatVideo);

      return playercontroller;


      GestureDetector(
      child:AspectRatio(
      aspectRatio: 16/9,
      child:Stack(
      children:<Widgets>[

      Chewie(

      retcontroller(stringVideo),

      cupertinoProgressColors: ChewieProgressColors(),
      showControls:false,
      ),

      ]
      )
      )
      );


      whenever I switch from that tab bar to another and try to navigate to another page in the second tabBar I get a black screen instead of the normal page.but when I remove the videoPage I dont get this problem and get this in the console



      I/flutter (19985): Another exception was thrown: There are multiple heroes that share the same tag within a subtree.
      I/flutter (19985): Another exception was thrown: There are multiple heroes that share the same tag within a subtree.


      logs from the Debug console:
      I have tried to figure out what, but I cant seem to get the Hero Tag associated with the videoPlayerController in order to set it to null.



      I/flutter (19985): ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
      I/flutter (19985): The following assertion was thrown during a scheduler callback:
      I/flutter (19985): There are multiple heroes that share the same tag within a subtree.
      I/flutter (19985): Within each subtree for which heroes are to be animated (typically a PageRoute subtree), each Hero
      I/flutter (19985): must have a unique non-null tag.
      I/flutter (19985): In this case, multiple heroes had the following tag:
      I/flutter (19985): VideoPlayerController#3144c(VideoPlayerValue(duration: null, size: null, position: 0:00:00.000000,
      I/flutter (19985): buffered: , isPlaying: false, isLooping: false, isBuffering: falsevolume: 1.0, errorDescription:
      I/flutter (19985): null))
      I/flutter (19985): Here is the subtree for one of the offending heroes:
      I/flutter (19985): # Hero(tag: VideoPlayerController#3144c(VideoPlayerValue(duration: null, size: null, position: 0:00:00.000000, buffered: , isPlaying: false, isLooping: false, isBuffering: falsevolume: 1.0, errorDescription: null)), state: _HeroState#b5c8f)
      I/flutter (19985): # └KeyedSubtree-[GlobalKey#44acd]
      I/flutter (19985): # └AspectRatio(aspectRatio: 1.7, renderObject: RenderAspectRatio#78caa relayoutBoundary=up2)
      I/flutter (19985): # └VideoPlayer(state: _VideoPlayerState#62908)
      I/flutter (19985): # └Container
      I/flutter (19985): # └LimitedBox(maxWidth: 0.0, maxHeight: 0.0, renderObject: RenderLimitedBox#9e9b5)
      I/flutter (19985): # └ConstrainedBox(BoxConstraints(biggest), renderObject: RenderConstrainedBox#1b4cb)
      I/flutter (19985):
      I/flutter (19985): When the exception was thrown, this was the stack:
      I/flutter (19985): #0 Hero._allHeroesFor.visitor.<anonymous closure> (package:flutter/src/widgets/heroes.dart:191:13)
      I/flutter (19985): #1 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:201:10)
      I/flutter (19985): #2 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4784:14)






      dart flutter






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 '18 at 19:09









      Ariel Carbonaro

      1,01011023




      1,01011023










      asked Nov 12 '18 at 19:05









      NorbertNorbert

      9211




      9211






















          1 Answer
          1






          active

          oldest

          votes


















          1














          you should not use singleton VideoPlayerController for multiple Chewie instance, Chewie use controller(the first arguments) as hero's tag






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53268542%2fflutter-using-videoplayer-in-a-listview-returning-multiple-errors%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            you should not use singleton VideoPlayerController for multiple Chewie instance, Chewie use controller(the first arguments) as hero's tag






            share|improve this answer



























              1














              you should not use singleton VideoPlayerController for multiple Chewie instance, Chewie use controller(the first arguments) as hero's tag






              share|improve this answer

























                1












                1








                1







                you should not use singleton VideoPlayerController for multiple Chewie instance, Chewie use controller(the first arguments) as hero's tag






                share|improve this answer













                you should not use singleton VideoPlayerController for multiple Chewie instance, Chewie use controller(the first arguments) as hero's tag







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 18 at 8:05









                Torrent LeeTorrent Lee

                84559




                84559



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53268542%2fflutter-using-videoplayer-in-a-listview-returning-multiple-errors%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Use pre created SQLite database for Android project in kotlin

                    Darth Vader #20

                    Ondo