Make WordPress Core


Ignore:
Timestamp:
09/11/2022 10:17:04 PM (21 months ago)
Author:
antpb
Message:

Media: Add muted property for video elements.

This change allows for the muted property to be used in video elements which solves for content that wishes to autoPlay when a page is viewed. Adding muted to video elements adhears to the requirements browsers have to honor autoPlay functionality.

Props prokium, peterwilsoncc, costdev, johnbillion, Benouare.
Fixes #54788.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/media.php

    r54097 r54128  
    10241024    /**
    10251025     * @ticket 35367
     1026     * @ticket 54788
    10261027     * @depends test_video_shortcode_body
    10271028     */
     
    10361037        $this->assertStringNotContainsString( 'loop', $actual );
    10371038        $this->assertStringNotContainsString( 'autoplay', $actual );
     1039        $this->assertStringNotContainsString( 'muted', $actual );
    10381040        $this->assertStringContainsString( 'preload="metadata"', $actual );
    10391041        $this->assertStringContainsString( 'width="640"', $actual );
     
    10471049                'loop'     => true,
    10481050                'autoplay' => true,
     1051                'muted'    => true,
    10491052                'preload'  => true,
    10501053                'width'    => 123,
     
    10581061        $this->assertStringContainsString( 'loop="1"', $actual );
    10591062        $this->assertStringContainsString( 'autoplay="1"', $actual );
     1063        $this->assertStringContainsString( 'muted', $actual );
    10601064        $this->assertStringContainsString( 'preload="1"', $actual );
    10611065        $this->assertStringContainsString( 'width="123"', $actual );
Note: See TracChangeset for help on using the changeset viewer.