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)!)
}
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