Opened 10 years ago
Closed 10 years ago
#27971 closed defect (bug) (fixed)
pauseAllPlayers in media-audiovidio.js stops players on the entire page
Reported by: | raptor235 | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Media | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description
The issue is that players outside of the tinymce get stopped... the function should target the players within the tinymce editor only and don't stop all players on the page weather they're related to the switching between rich text and html mode...
$(document.body)
.on( 'click', '.wp-switch-editor', wp.media.mixin.pauseAllPlayers )
pauseAllPlayers: function() {
var p;
if ( window.mejs && window.mejs.players ) {
for ( p in window.mejs.players ) {
window.mejs.players[p].pause();
}
}
},
Attachments (2)
Change History (9)
#2
@
10 years ago
Hi so we run the company called Sidekick... which is a help/tutorial system within WordPress wordpress.org/plugins/sidekick ... we have an audio player that guides the user through specific scenarios so they can learn WordPress.
The player is within the body under our own div... so when we're trying to teach users about tinymce and have the users switch the tabs... our entire walkthrough experience get's stopped because all media players get stopped... even though our player on the page has nothing to do with the tinymce editor being switched to html mode... this is the scenario we're facing right now... but anyone else that might have a media or audio player playing would get stopped on the page because the tinymce editor is switching... I would suggest that only media players within the actual tinymce editor get stopped not everything on the page...
Bart
#3
@
10 years ago
- Keywords has-patch added; reporter-feedback close removed
- Milestone changed from Awaiting Review to 4.0
27971.diff fixes this by only pausing the players attached to objects. Your use case is unique, but incredibly valid.
#4
@
10 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
In 28364:
In what case would you be editing media and want players to be continuously playing on your site? The players need to be paused because they will be removed when the context changes anyways.
Even if we were to specify the context of body as
body.wp-admin
or something, the editor and media modal could be loaded on the front end, and we would still want to pause the players when editing and switching contexts.I have been trying to think of a good scenario where this would be problematic, please let me know if I am missing somehthing