Comments (3)
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.
hi,
not loading video. please resolved my this issues
from flutter-tiktok.
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)
- Use local database instead of Firebase HOT 4
- F-Droid HOT 1
- Out Of Memory Exception when scrolling through many videos HOT 1
- TikTok
- First video freezes due to race condition with loading of first videos
- Get video data from api
- Not valid
- use
- Plans on making the web-based (Chrome) version
- Firebase Database HOT 5
- Getting Error HOT 1
- google-services.json HOT 1
- VideoPlayerController is not disposing. HOT 1
- Can you make a tutorial for this please? HOT 3
- Google credentials in public repo? HOT 1
- CocoaPods can't be downloaded HOT 1
- Icon getter not defined HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter-tiktok.