WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29384 closed defect (bug) (fixed)

wpview: mejs: Playing one player inside the editor doesn't stop the other

Reported by: iseulde Owned by: wonderboymusic
Milestone: 4.1 Priority: normal
Severity: trivial Version: 4.0
Component: Media Keywords: has-patch
Focuses: javascript Cc:

Description

To reproduce, add two audio/playlist views to the editor, play one and play the other. The first doesn't stop playing.

Attachments (1)

29384.patch (886 bytes) - added by joeyblake 6 years ago.
Fires an event to stop a media player when another one is clicked.

Download all attachments as: .zip

Change History (12)

#1 @iseulde
6 years ago

  • Version set to trunk

#2 @helen
6 years ago

avryl - this is the case with trunk but not previously? Is it because of the iframes?

#3 @iseulde
6 years ago

Right.

#4 @iseulde
6 years ago

  • Severity changed from normal to trivial

#5 @wonderboymusic
6 years ago

  • Focuses javascript added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.1

wp.mce.av.View.stopPlayers() works like a champ because it is triggered by an event with the MCE view - getting the view's iframes' players to signal back to outer space that they are playing will be .... a challenge.

Either we figure this out or decide we don't care.

#6 @helen
6 years ago

I care to some degree as far as the built-in MEjs player goes, which I have a feeling is the only case we can control anyway. Ever-better emulation of the front-end is a good goal.

@joeyblake
6 years ago

Fires an event to stop a media player when another one is clicked.

#7 @joeyblake
6 years ago

  • Keywords has-patch added; needs-patch removed
Last edited 6 years ago by joeyblake (previous) (diff)

#8 follow-up: @wonderboymusic
6 years ago

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

In 30642:

When creating audio and video MCE views, listen to the players within each iframe to capture the "play" event. When a player plays, pause the players in every other iframe sandbox.

Fixes #29384.

#9 in reply to: ↑ 8 @joeyblake
6 years ago

Hey wonderboymusic,

For my own enlightenment, was there another issue that my fix missed? Or some pattern that is preferred that I overlooked?

I only ask so I can approach things differently in the future.

Replying to wonderboymusic:

In 30642:

When creating audio and video MCE views, listen to the players within each iframe to capture the "play" event. When a player plays, pause the players in every other iframe sandbox.

Fixes #29384.

#10 follow-up: @wonderboymusic
6 years ago

joeyblake:

  • Don't want to stop all players, we want to know which one is playing and stop the others
  • We want to bind to an actual "play" event, not hijack a random click
  • We need to be able to separate MEjs sandboxes from other sandboxes, so that they only react to each other, not every iframe

#11 in reply to: ↑ 10 @joeyblake
6 years ago

Gotcha. I was figuring the play event part. Thanks!

Replying to wonderboymusic:

joeyblake:

  • Don't want to stop all players, we want to know which one is playing and stop the others
  • We want to bind to an actual "play" event, not hijack a random click
  • We need to be able to separate MEjs sandboxes from other sandboxes, so that they only react to each other, not every iframe
Note: See TracTickets for help on using tickets.