Listview video reloading
Hello, When using in Listview and scrolling, each video player frame reloads its source. It happens as soon as you scroll away from the listview item and come back to it. It results in some lag or delay when you scroll. After scrolling up and down many times some video player instances are loosing their sources. Is there a way to prevent the video instance from reloading multiple times once it has loaded first time ? May be you should check in the source if the url was loaded before enabling the reload .. thanks.
I'm using nativescript-angular / ios
Sorry for the delay in response. The issue lies with the listview recycling. So you'll definitely need some logic to handle this. I've never tried putting a video in a listview. However, a rough idea would be to use a loaded event on the videoplayer inside the listview, check the binding you have on it and confirm it's correct. You might want to try posting the exact issue on the main nativescript repo and see if one of the core devs has a recommended approach using the listview's event/props to figure out a good approach.
Hi, I have the same issue here. As far as I could see the video src is still set correctly. Also everything else in the ListView item is displayed correct. Just the video hides. Is there any possibility to get more information about what is going on inside the video player? Maybe some events or log messages...?
@bradmartin Do you have any idea how I could solve the problem or I could get any further information like logs?
I have not tried this myself but I believe a good starting point (what I'd try) is to assign dynamic IDs to the videoplayers. Either index based or Id based on the items of the list view. Then use the item loading event for the list view items to grab the videoplayer reference, check it's id, check if it has a src assigned, possibly the current time of the playing video (or some other metadata) and reset it if you need to. If you don't want to reset you could try storing an object of the videoplayer state based on it's id locally (app-settings or a storage plugin) that way you would know that video xyz current time is at X and then when video with id xyz is loading again just read the last know state and assign the values to the player for it. Most importantly is probably trying to call stop on the player when it's loading so that it doesn't autoplay (unless you want that for your users).
On Sun, Jan 14, 2018, 3:59 AM Raman [email protected] wrote:
@bradmartin https://github.com/bradmartin Do you have any idea how I could solve the problem or I could get any further information like logs?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nstudio/nativescript-videoplayer/issues/53#issuecomment-357500350, or mute the thread https://github.com/notifications/unsubscribe-auth/AFulhCtR28TKy3thCPX2Ea3ohHq0xATiks5tKc_pgaJpZM4LdZ7h .
@bradmartin that worked for me. I am storing the current time of the video in the underlying model. Thanks a lot and sorry for the late response.