Code Monkey home page Code Monkey logo

Comments (3)

stiltet avatar stiltet commented on May 19, 2024 5

I had the same issue and managed to fix it by updating the following in "feed_viewmodel.dart" (changes are in bold):

ORIGINAL CODE:

`
changeVideo(index) async {
videoSource.listVideos[prevVideo].controller.pause();
if (videoSource.listVideos[index].controller == null) {
await videoSource.listVideos[index].loadController();
}
videoSource.listVideos[index].controller.play();
videoSource.listVideos[prevVideo].controller.removeListener(() {});

//videoSource.listVideos[prevVideo].controller.dispose();

prevVideo = index;
notifyListeners();

print(index);

}
`

FIXED CODE:

`
changeVideo(index) async {
if (videoSource.listVideos[prevVideo].controller != null) {
videoSource.listVideos[prevVideo].controller.pause();
videoSource.listVideos[prevVideo].controller.removeListener(() {});
}

if (videoSource.listVideos[index].controller == null) {
await videoSource.listVideos[index].loadController();
}
videoSource.listVideos[index].controller.play();

//videoSource.listVideos[prevVideo].controller.dispose();

prevVideo = index;
notifyListeners();

print(index);

}
`

Also works after I've upgraded video_player package to v. 1.0.1.

from flutter-tiktok.

JITENDRA7104 avatar JITENDRA7104 commented on May 19, 2024

hi,
not loading video. please resolved my this issues

from flutter-tiktok.

danielgchap avatar danielgchap commented on May 19, 2024

Please help.... I'm getting the following...

[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: RangeError (index): Invalid value: Valid value range is empty: 0
#0 List.[] (dart:core-patch/growable_array.dart:254:60)
#1 FeedViewModel.loadVideo (package:instapray/screens/video_wall/feed_viewmodel.dart:37:33)
#2 _FeedScreenState.initState (package:instapray/screens/video_wall/feed_screen.dart:29:19)
#3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4632:57)

All I did was download clone and fire up against a firebase proj. Everything else is 100% on point. But the model tries to get the videos before list is loaded, even though the list loads.

from flutter-tiktok.

Related Issues (18)

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.