nidhik / tiktok

17 stars 7 forks source link

If i keep videonode of PostNode to ShouldAutoPlay to true...then even if i scroll down..it still playes old video. #4

Open kalyanichaudhari03 opened 3 years ago

kalyanichaudhari03 commented 3 years ago

Hey Hi, I am stuck at issue of scrolled videos still playing when even if its not visible.. I have tried to pasue it in Tablenode's delegate method , also tried method of PostNode still its keeps playing for videos which are not visible...in my app i am having single video on screen at time. this is below code videoNode.url = getThumbnailURL(post: post) videoNode.shouldAutoplay = true videoNode.shouldAutorepeat = true // The player should preserve the video’s aspect ratio videoNode.gravity = AVLayerVideoGravity.resizeAspectFill.rawValue

    // Since nodes are not created on the main thread, make sure to set the asset on the main thread
    DispatchQueue.main.async {
        self.videoNode.asset = AVAsset(url: self.getVideoURL(post: post)!)
    }
ahsan084 commented 3 years ago

Hello,did you find any solution to this? I am also facing same issue