Make WordPress Core

Opened 5 months ago

Last modified 12 days ago

#62634 new defect (bug)

Error in mediaelement-and-player.js

Reported by: salmanulharischolakkal's profile salmanulharischolakkal Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.7.1
Component: Media Keywords:
Focuses: javascript, administration Cc:

Description (last modified by sabernhardt)

Summary
When using bulk select in the WordPress Media Library, selecting different types of media files (e.g., switching from a cloud-hosted video to an image) causes a console error:
Uncaught TypeError: Cannot read properties of null (reading 'length').
This issue is traced to the file mediaelement-and-player.js, line 4480.

Steps to Reproduce

  1. Navigate to the WordPress Media Library.
  2. Use the bulk select feature to select multiple media files.
  3. Select a video file hosted on the cloud (large file size).
  4. After selecting the video, quickly click to select an image file.
  5. Observe the console error in the browser's developer tools.

Observed Behavior
The console logs the error:

Uncaught TypeError: Cannot read properties of null (reading 'length') at mediaelement-and-player.js:4480

Expected Behavior

  • Switching between different types of media (cloud-hosted videos and images) should not trigger a JavaScript error.
  • Bulk select functionality should work seamlessly without throwing errors.

Environment Details

  • WordPress Version: 6.7.1
  • Theme/Plugins: WP Offload Media Lite
  • Browser: Edge

Media Files:

  • Cloud Video: File size: > 50mb
  • Image: File size: Any

Additional Notes
Issue is likely related to how mediaelement-and-player.js handles media metadata for files hosted on the cloud vs. locally.
Potential fix might involve adding a null check or handling edge cases for cloud-hosted media.
Would you like assistance debugging this further or crafting a patch for mediaelement-and-player.js?

Attachments (1)

Screenshot 2024-12-03 095848.png (23.2 KB) - added by salmanulharischolakkal 5 months ago.

Download all attachments as: .zip

Change History (2)

#1 @sabernhardt
12 days ago

  • Component changed from Quick/Bulk Edit to Media
  • Description modified (diff)
  • Focuses coding-standards removed
  • Keywords changes-requested removed
  • Summary changed from Bug Report: Error in mediaelement-and-player.js to Error in mediaelement-and-player.js
Note: See TracTickets for help on using tickets.