Skip to content

Commit ab3978b

Browse files
committed
Switch initialization loop to native JS
1 parent 8c3e294 commit ab3978b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎scripts/ableplayer-base.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ function ablePlayerSetupWindow() {
2222
console.warn('Required dependency DOMPurify not available. Please use the full Able Player bundle which has DOMPurify built in. Or, keep using this bundle, and include DOMPurify separately.')
2323
}
2424

25-
$('video, audio').each(function (index, element) {
26-
if ($(element).data('able-player') !== undefined) {
27-
new AblePlayer($(this));
25+
document.querySelectorAll( 'video,audio' ).forEach( ( element ) => {
26+
if ( element.dataset.ablePlayer !== undefined ) {
27+
new AblePlayer( $( element ) );
2828
}
29-
});
29+
} );
3030
});
3131

3232
// YouTube player support; pass ready event to jQuery so we can catch in player.

0 commit comments

Comments
 (0)