Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#25077 closed defect (bug) (fixed)

Native video player doesn't autoplay when using flash fallback

Reported by: leandroprz Owned by: wonderboymusic
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.6
Component: Media Keywords: needs-patch
Focuses: Cc:



I think I found another bug with the new native player.

I'm using this shortcode to show a video:

[video src="video.mp4" width="640" height="360" autoplay="true" loop="true"]

But when using flash it doesn't autoplay or loop the video. It does work fine when using HTML5.

I tested this on a fresh WP 3.6 installation with Twenty Thirteen theme.

Attachments (1)

25077.diff (6.4 KB) - added by wonderboymusic 8 years ago.

Download all attachments as: .zip

Change History (7)

#1 @leandroprz
8 years ago

  • Summary changed from Native video layer doesn't autoplay when using flash fallback to Native video player doesn't autoplay when using flash fallback

#2 @SergeyBiryukov
8 years ago

  • Component changed from Embeds to Media

#3 @wonderboymusic
8 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 3.9

#4 @wonderboymusic
8 years ago

This might be accomplishable on init, adding something like:

success: function(mediaElement, domObject) {
        // also need to detect 'autoplay' somehow
        if (mediaElement.pluginType == 'flash') {
            mediaElement.addEventListener('canplay', function() {
                // Player is ready
        }, false);

8 years ago

#5 @wonderboymusic
8 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 27450:

Support the autoplay attribute, even when the plugin type for a MediaElement instance is Flash. In the media modal, wp.media.view.VideoDetails and wp.media.view.AudioDetails now extend a unified wp.media.view.MediaDetails class which contains all of the player creation and destruction logic. The remove() method mimics the mejs.MediaElementPlayer.remove() method, but does not re-add the audio/video tag to the DOM. The MEjs method is especially problematic when the tag has autoplay="true" and the view has been detached but not destroyed.

Fixes #25077.
See #27016.

#6 @leandroprz
8 years ago

Thanks for the fix, I just tested it and it's working perfectly.

But still doesn't loop the video. I'm not sure if that's related to this one. Should I create another bug report for that?

Note: See TracTickets for help on using tickets.