Make WordPress Core

Changeset 54279


Ignore:
Timestamp:
09/21/2022 03:28:56 PM (2 years ago)
Author:
joedolson
Message:

Media: Fix JS TypeError with video playlists and native video.

Verify that the resized property exists on a video in the playlist before attempting to read it. Prevent a TypeError from being thrown and breaking the playlist if a video type requires native video support.

Props afercia, here.
Fixes #47513.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/vendor/mediaelement/wp-playlist.js

    r46800 r54279  
    8686                    this.playerNode.attr( 'poster', this.current.get( 'image' ).src );
    8787                }
    88                 dimensions = this.current.get( 'dimensions' ).resized;
    89                 this.playerNode.attr( dimensions );
     88                dimensions = this.current.get( 'dimensions' );
     89                if ( dimensions && dimensions.resized ) {
     90                    this.playerNode.attr( dimensions.resized );
     91                }
    9092            } else {
    9193                if ( ! this.data.images ) {
Note: See TracChangeset for help on using the changeset viewer.