[wp-trac] [WordPress Trac] #40935: Facebook Video Works On Preview But Not On Theme
WordPress Trac
noreply at wordpress.org
Tue Jun 13 21:55:53 UTC 2017
#40935: Facebook Video Works On Preview But Not On Theme
--------------------------+--------------------
Reporter: emanweb | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.8.1
Component: Widgets | Version: 4.8
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+--------------------
Changes (by timmydcrawford):
* keywords: needs-patch => has-patch
Comment:
I spent some time exploring the options here - ideally like @westonruter
said above, the most ideal solution would be to respect all whitelisted
embed providers, like Facebook, in this scenario. As he mentioned, we do
need #34115 resolved to proceed there since we can not use any of the
embed shortcode logic without a {{{$post}}}. I would go a bit further and
say to fully leverage oembeds, we should explore a way to add mime types
to the provider list ( https://github.com/WordPress/wordpress-
develop/blob/master/src/wp-includes/class-oembed.php#L57 ) - so we could
properly determine which embeds would work in which context ( Audio vs
Video widget ).
Ultimately though, this kind of brings me back to the notion of a generic
oembed widget. When we do have the ability to use embeds with a post,
perhaps when a user pastes in an approved embed URL, the widget
automatically changes from a Video or an Audio widget to an embed widget.
For the time-being though, we are still restricted by the {{{$post_ID}}}
requirement ( https://github.com/WordPress/wordpress-
develop/blob/master/src/wp-includes/class-wp-embed.php#L193 ) in the embed
shortcode logic. If this were not there, we could add logic to the widget
rendering that detects an embeddable URL, and returns the embed instead of
the {{{wp_video_shortcode}}} logic. As such we are still currently
limited by what {{{mejs}}} supports for playback which is Vimeo and
YouTube.
[[attachment:40935.1.diff]] extends the existing validation logic in
{{{media-widgets.js}}} to ensure the URL inserted in the modal is Vimeo or
YouTube before fetching the oembed/proxy. This allows a URL to an
external .mp4 file to be used still, but also ensures that only the truly
supported external providers can be used.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40935#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list