Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
ScrollView - Improving Video Feed
Post Flair (click to view more posts with a particular flair)
Post Body

I currently have a video feed that mirrors that of Tik Tok (video plays, user scrolls new video plays, etc).

The issue I'm currently encountering is when I scroll to the next video, it takes a good few seconds to load the new video, not creating a smooth experience.

I'm thinking a possible workaround could be I display let's say three videos at the same time, but technically only display 1 (keep the other videos out of view until they are called). When I scroll, we push the next video into view and take the previous view out of sight.

  Is that a possible workaround here? Any tips would be greatly appreciated.

ScrollView {
                LazyVStack (spacing: 0){
                    ForEach(feedLogic.videoPosts) { video in
               // let urlString = (FeedLogic.shared.videoURLsFeed as? [String] ?? [])[index]
                        FeedIndividualBox(video: video, player: player,userName: video.name ,isShowingTab: isShowingTab, tabMatrice: .constant(video.tabMatrice), handleLikes: handleUserLikes)
                            .containerRelativeFrame([.horizontal, .vertical])
                            .id(video.id)
                            .task{ playInitialVideo()
                        }
                    }
                    .onAppear { player.play() }
                }
                .scrollTargetLayout()
            }
            .scrollDisabled(isShowingTab ? true : false )
            .scrollPosition(id: $scrollPosition)
            .scrollTargetBehavior(.paging)
           .ignoresSafeArea()
            .onChange(of: scrollPosition) { oldValue, newValue in
                playVideoOnChangeOfScrollPosition(videoID: newValue)
            }

Author
Account Strength
90%
Account Age
9 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,143
Link Karma
599
Comment Karma
544
Profile updated: 4 days ago
Posts updated: 1 month ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
6 months ago