[wp-trac] [WordPress Trac] #62634: Error in mediaelement-and-player.js (was: Bug Report: Error in mediaelement-and-player.js)

WordPress Trac noreply at wordpress.org
Sat Apr 12 21:54:46 UTC 2025


#62634: Error in mediaelement-and-player.js
---------------------------------+-----------------------------------------
 Reporter:                       |       Owner:  (none)
  salmanulharischolakkal         |
     Type:  defect (bug)         |      Status:  new
 Priority:  normal               |   Milestone:  Awaiting Review
Component:  Media                |     Version:  6.7.1
 Severity:  normal               |  Resolution:
 Keywords:                       |     Focuses:  javascript, administration
---------------------------------+-----------------------------------------
Changes (by sabernhardt):

 * keywords:  changes-requested =>
 * focuses:  javascript, administration, coding-standards => javascript,
     administration
 * component:  Quick/Bulk Edit => Media


Old description:

> **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?

New description:

 **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`?

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62634#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list