[wp-trac] [WordPress Trac] #40144: Media: Unable to selectively opt for MediaElement.js for just audio or video shortcodes

WordPress Trac noreply at wordpress.org
Tue Feb 7 07:27:27 UTC 2023


#40144: Media: Unable to selectively opt for MediaElement.js for just audio or
video shortcodes
-------------------------------------+------------------------
 Reporter:  westonruter              |       Owner:  joedolson
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  6.2
Component:  Media                    |     Version:  3.6
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+------------------------

Comment (by obayedmamur):

 I have tested with the refreshed patch:
 [https://core.trac.wordpress.org/attachment/ticket/40144/40144.3.diff]

 I have created a post in the classic editor and:

 Added an audio file and a video file using the [audio] and [video]
 shortcodes.

 Added these two filters in themes function.php file:


 {{{
 add_filter( 'wp_video_shortcode_library', function(){ return
 'some_other_library'; } );
 add_filter( 'wp_audio_shortcode_library', function(){ return
 'some_other_library'; } );
 }}}


 Tested once with both filters available; once with only one filter
 enabled; one with the other filter enabled.

 **Before patch:**
 Both filters: Both audio and video fall back to native players -
 [https://d.pr/i/k7OONM]
 Audio filter: Both audio and video fall back to native players -
 [https://d.pr/i/Rm8NHI]
 Video filter: Both audio and video fall back to native players -
 [https://d.pr/i/d75r7x]

 **After patch:**
 Both filters: Both audio and video fall back to native players -
 [https://d.pr/i/9BQuh4]
 Audio filter: Audio player falls back to native player -
 [https://d.pr/i/IOshs4]
 Video filter: Video player falls back to native player -
 [https://d.pr/i/eoybpX]

 After Patch I have found the expected result.

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


More information about the wp-trac mailing list