[buddypress-trac] [BuddyPress Trac] #6772: BuddyPress Embeds for activity, user profiles, groups

buddypress-trac noreply at wordpress.org
Fri May 13 22:19:25 UTC 2016


#6772: BuddyPress Embeds for activity, user profiles, groups
------------------------------------+------------------
 Reporter:  imath                   |       Owner:
     Type:  idea                    |      Status:  new
 Priority:  normal                  |   Milestone:  2.6
Component:  API                     |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
------------------------------------+------------------

Comment (by r-a-y):

 @imath - I was finally able to duplicate your problem with YouTube and
 Vimeo!

 Check out `08.patch`.

 The problem is WP adds a `'sandbox="allow-scripts"` attribute to the
 `<iframe>`.  In order for YouTube and Vimeo embeds to work (as well as
 Twitter, Soundcloud, Ted, DailyMotion, SlideShare and Kickstarter), we
 have to add the `allow-same-origin` value to the `<iframe>` `sandbox`
 attribute as well.  I'm only adding the `allow-same-origin` value if an
 activity item as an oEmbed item that matches the sites listed above.

 We could also fix this by removing the `sandbox` attribute altogether but
 I opted to leave it.

 *Mozilla says that having both `sandbox="allow-same-origin allow-scripts"`
 is about the same as not adding the `sandbox` attribute:
 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-
 sandbox

 Anyway, here's a GIF :)
 [[Image(http://i.cubeupload.com/MTXp9c.gif)]]

 Please let me know if this works for you, imath.

 `08.patch` also:
 - Fixes a bug with rendering XML oEmbed responses as JSON.  See the new
 `BP_oEmbed_Component::oembed_xml_request()` method for the fix.
 - Media embeds will now also work with inline MP3 and video links.  Copy
 and paste a URL to a MP3 or video file and the embed template should show
 it.  The browser's native HTML5 player is used for this.
 - Based on imath's feedback, the activity embed template now uses the
 activity action.  My only concern with this is with long action strings
 and long usernames.
 - Inline CSS is moved to the `'embed_head'` hook for now.
 - fluidvids.js is moved to the `'embed_footer'` hook for now.
 - Based on imath's `07.suggestions.patch`, I decided to add a `header-
 activity.php` template part.

 ----

 @mercime - Thanks for testing.  I think your bug is not related to this
 ticket though; I've opened a new issue for this - #7063.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6772#comment:32>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list