Skip to content

Conversation

@krishana7911
Copy link
Contributor

Description

This update addresses two key problems:

  1. Shimmer Loading Issue

    • Video containers sometimes retained the .animate-video-loading class, causing shimmer effects to persist.
    • Implemented a debounced shimmer removal routine to reliably clear the animation state.
  2. Skin & Player Initialization Issue

    • GODAMPlayer wasn’t always being initialized correctly after AJAX updates, BuddyPress comment replies, or Magnific Popup loads.
    • Added retry logic, popup-specific handling, and mutation observers to ensure consistent initialization.

Changes Made

  • Refactored GODAM integration script for clarity and reliability.
  • Introduced safe GODAMPlayer wrapper with retry mechanism.
  • Added popup handling with delayed initialization for Magnific Popup.
  • Added mutation observers for dynamically added comments/activities.
  • Implemented debounced shimmer removal.
  • Cleaned up code (removed debug logs, consolidated duplicate logic).
  • Added structured comments to explain critical logic points.

Testing

  • Verified player initializes correctly on initial page load.
  • Verified skin loads correctly in BuddyPress activity stream comments/replies.
  • Verified videos inside Magnific Popup load properly with skin applied.
  • Verified shimmer always gets removed after initialization.
  • Verified no JS errors occur in multisite setup.

Notes

This refactor also prepares the codebase for easier future maintenance by separating responsibilities and reducing duplicate init calls.

@krishana7911 krishana7911 self-assigned this Aug 28, 2025
@krishana7911 krishana7911 requested a review from Copilot August 28, 2025 08:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes GODAMPlayer shimmer loading and initialization issues in the rtMedia plugin by refactoring the GODAM integration to be more reliable and maintainable.

  • Relocates GODAM integration code from rtmedia-functions.php to a dedicated godam-integration.php file for better organization
  • Implements debounced shimmer removal and retry logic for robust player initialization across different contexts (AJAX updates, BuddyPress comments, Magnific Popup)
  • Enhances the AJAX comment refresh system with better error handling and exponential backoff retry mechanisms

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
templates/media/godam-integration.php New dedicated file containing all GODAM integration logic with improved error handling and skin loading
index.php Adds require statement to load the new godam-integration.php file
app/main/controllers/template/rtmedia-functions.php Removes GODAM integration code that was moved to the dedicated file
app/assets/js/godam-integration.js Complete rewrite with retry mechanisms, debounced shimmer removal, and comprehensive event handling
app/assets/js/godam-ajax-refresh.js Refactored to use class-based architecture with improved error handling and retry logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@krishana7911 krishana7911 merged commit f2d4491 into develop Sep 1, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

4 participants