Skip to content
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

Video Card #62

Open
haidernaqvi87 opened this issue Jul 9, 2022 · 2 comments
Open

Video Card #62

haidernaqvi87 opened this issue Jul 9, 2022 · 2 comments

Comments

@haidernaqvi87
Copy link

Hello team, If I placed a short video instead of Image, then when I swipe the video it keeps on playing with sound. That means it is not destroying the video widget. Any workaround?

@maeddin
Copy link
Contributor

maeddin commented Aug 14, 2022

@haidernaqvi87 Can't you stop the video the moment it is swiped? Depending on what widget you use to play the video, there should be a controller that lets you stop the video. (Usually video_player)

@mghali1
Copy link

mghali1 commented Dec 23, 2022

Hello @haidernaqvi87,

You can use the onWillMoveNext: (index, swipeDirection) param. This function is called before performing a swipe. It will return true or false depending on whether or not you want to allow the movement. Anyways, before returning a true or a false, stop the video from playing.

Now if you're worried about the memory because the video not being destroyed, I guess you can do the following. In the onSwipeCompleted: (index, direction) param, send a function that will nullify or clear or the video from the list. yourList[index] = null; and reset the state setState({}). It will rebuild, but nothing will change on the user's side the controller's index is index + 1 (cause you swiped already). Just make sure that on the card builder, you cater for the null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants