New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
获取此问题视频更改 vdos #42
Comments
Try to play your url in video_player example first. |
thanks for reply @mjl0602 actually, I have pushed your HomePage screen inside another screen, and it gives me these errors and crashes the app.
could you pls tell me how to make it efficient, crash free or should i have to explicitly dispose controller after coming back to prev screen, anything! |
You should try to load less video when init video page view by set TikTokVideoListController.loadMoreCount, TikTokVideoListController.preloadCount and TikTokVideoListController.disposeCount. And dispose all video when you exit video page view. |
I have used these values
and disposed using this when falling back to initial screen
and still this issue persist |
It seems that you did not provide the correct log. So, I suggest you try to reduce the count of your video to only ONE. And if the crash still happend, you can try video_player directly to see whether the crash is from video_player plugin, or not. |
If you want to pause video after some duration, you should use your custom timer and use video controller to pause the video when timer done. Use setstate here because every time our state changed, we should call setState(markNeedsBuild). |
thanks @mjl0602 ur prev comment helped me |
sry prev comment got deleted why we use setstate here, bcs of this pageview itembuilder called multiple times. But cant do bcs of pageview builder called multiple times, can't run timer or store instance value to be executed after duration. |
See this. |
look code below //------$$$$$ after every this block itemBuilder: (context, i) {
|
You should not create timer in you build function. Create your timer when some event happed or in initState. |
ok if i want to execute something only once in every page inside pageview how can i do that. Currently if i execute it in itembuilder its called multiple times. |
Create timer in initState and it will be called only once. |
yes you are right but i want it to execute on every video starting == on every new video scroll (once) |
Add listener to TikTokVideoListController.index(is a ValueNotifier), add timer when index.value changed. |
very very thanks @mjl0602 u helped me alot thanks again |
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(VideoError, Video player had error com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.64001F, -1, null, [540, 960, 30.0], [-1, -1]), format_supported=YES, null, null)
The text was updated successfully, but these errors were encountered: