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

Paginated results in the Brightcove Media Modal #396

Open
1 task done
shreyasikhar opened this issue Jul 1, 2024 · 2 comments
Open
1 task done

Paginated results in the Brightcove Media Modal #396

shreyasikhar opened this issue Jul 1, 2024 · 2 comments

Comments

@shreyasikhar
Copy link

shreyasikhar commented Jul 1, 2024

Is your enhancement related to a problem? Please describe.

Brightcove Media modal fetches the latest 100 videos in the modal in one request by default.

In order to optimize the performance of Brightcove API calls, we wanted to fetch lesser posts with a support of paginated query, so that the next paged request should trigger with next set of results when user clicks on load more videos button or scrolls to the end whichever way possible.

Currently, we can reduce the posts per page using the filter brightcove_posts_per_page, but we can't fetch the results from the next page.

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@shreyasikhar
Copy link
Author

We have explored the codebase and found out that the implementation for paginated results is added on JS scroll event, but for some reason the event callback is not getting called.

This is the file where we found the event: https://github.com/10up/brightcove-video-connect/blob/develop/assets/js/brightcove-admin.js#L1533

Please someone check this.
cc: @oscarssanchez If you can help here.

@Sidsector9
Copy link
Member

This is because the element #brightcove-media-frame-content doesn't have a fixed height which is why the scroll event is not working.

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

No branches or pull requests

2 participants