Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#25077 closed defect (bug) (fixed)

Native video player doesn't autoplay when using flash fallback

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

Description

Hi,

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 13 years ago.

Download all attachments as: .zip

Change History (7)

#1 @leandroprz
13 years ago

  • Summary Native video layer doesn't autoplay when using flash fallback → Native video player doesn't autoplay when using flash fallback

#2 @SergeyBiryukov
13 years ago

  • Component Embeds → Media

#3 @wonderboymusic
13 years ago

  • Keywords needs-patch added
  • Milestone Awaiting Review → 3.9

#4 @wonderboymusic
13 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
                mediaElement.play();
        }, false);
    }
}

#5 @wonderboymusic
13 years ago

  • Owner set to wonderboymusic
  • Resolution → fixed
  • Status new → 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
13 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.