[wp-trac] [WordPress Trac] #28905: Audio/Video MCE views should use iframe sandboxes
WordPress Trac
noreply at wordpress.org
Tue Jul 15 04:53:30 UTC 2014
#28905: Audio/Video MCE views should use iframe sandboxes
----------------------------+-------------------------
Reporter: wonderboymusic | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.0
Component: Media | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses: javascript
----------------------------+-------------------------
Comment (by wonderboymusic):
[attachment:28905.4.diff] is a few steps away from being really good. All
audio/video/playlists are loaded in iframe sandboxes with all the styles
and scripts their hearts desire. Audio styles are weird, but I working on
it...
The shortcodes are parsed via AJAX, so there is no need for the parsing
logic in `mce-view.js`. Because each document has its own `window`
property, the players will destroy themselves when the iframes die (I will
confirm this with more testing).
Because they are iframes with the scripts in scope, I can delete all of
the crazy browser-specific logic for compatibility. This also fixes a
bunch of issues: YouTube works as the video source, no placeholders need
to be shown when Flash can't communicate with `window.mejs` for plugin-
type media sources, and no compatibility layer is required for Playlists
on front-end vs Tiny MCE-loaded.
None of the shortcode logic needs to be branched for MCE views, and no JS
needs to be branched for init'ing the players on load.
Another reason this is good: eventually, it would be good for all sites to
have the ability to be an oEmbed endpoint themselves. If I have a player
of my band's music on my site and other people want to embed it on their
site, this same iframe-type loading will be useful. Not as a sandbox, but
knowing the basic logic required to render these things in an iframe.
Gonna throw some cold water on my face
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28905#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list