Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for VideoPress in core Media Video Widget. #7215

Merged
merged 3 commits into from May 29, 2017

Conversation

Projects
None yet
5 participants
@timmyc
Copy link
Member

timmyc commented May 20, 2017

Changes proposed in this Pull Request:

The new Media Widgets are going to be released in WordPress 4.8, and currently VideoPress does not work seamlessly with the new Video Media Widget. The issue arises when uploading a new video from within the media modal launched by the Video Widget, and the subsequent url from the attachment is returned as the attachment page - not the CDN VideoPress file or oembed url.

This PR seeks to fix that problem by extending a few methods on the Video Media Widget, and adding logic to the wp_video_shortcode override so VideoPress oembed url's get rendered like they do within the editor for example.

Further details and discussion:
https://core.trac.wordpress.org/ticket/40808
xwp/wp-core-media-widgets#160

Testing instructions:

  • You must be running trunk, or a nightly build, and manually apply the patch on the trac ticket if it has yet to be merged in ( at the time of PR creation, the fix has yet to be merged to trunk )
  • Additionally, this PR is dependent upon a minor WPCOM API update that I have been working with @dbtlr on - I will post back here when that has been merged, but until then please ping me for a diff to apply to your sandbox

Hopefully these two steps will be un-needed very soon 馃槃

To actually test things out, open up the Customizer | Widgets screen on a site that has a plan with VideoPress enabled. Add a video widget, and upload a new file. In the customizer preview, verify that the VideoPress oembed player is shown, and it should show the transcoding progress in real time, and be playable once the video is ready.

@timmyc timmyc requested a review from dbtlr May 20, 2017

@westonruter

This comment has been minimized.

Copy link
Contributor

westonruter commented May 20, 2017

You must be running trunk, or a nightly build, and manually apply the patch on the trac ticket if it has yet to be merged in ( at the time of PR creation, the fix has yet to be merged to trunk )

Core patch has been committed: https://core.trac.wordpress.org/changeset/40810

This will be included in 4.8-beta2.

@jeherve jeherve modified the milestone: 5.0 May 26, 2017

@zinigor
Copy link
Member

zinigor left a comment

Overall this looks good to me!

@dbtlr

dbtlr approved these changes May 29, 2017

Copy link
Contributor

dbtlr left a comment

LGTM

@zinigor zinigor merged commit 66318b5 into master May 29, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@zinigor zinigor deleted the update/videopress-media-widget-compat branch May 29, 2017

zinigor added a commit that referenced this pull request Jun 29, 2017

REST API: Fix Missing videopress_guid in upload media response
Summary: During testing of the new Media Video Widget, the videopress_guid which is needed to construct the proper oembed url was missing in API responses for me.  The following minor change fixes this issue.  Additional details #7215

Test Plan: See the PR linked above for test instructions

Reviewers: codebykat

Reviewed By: codebykat

Subscribers: dbtlr

Differential Revision: https://[private link]

Merges r156992-wpcom.

zinigor added a commit that referenced this pull request Aug 28, 2017

REST API: Fix Missing videopress_guid in upload media response
Summary: During testing of the new Media Video Widget, the videopress_guid which is needed to construct the proper oembed url was missing in API responses for me.  The following minor change fixes this issue.  Additional details #7215

Test Plan: See the PR linked above for test instructions

Reviewers: codebykat

Reviewed By: codebykat

Subscribers: dbtlr

Differential Revision: https://[private link]

Merges r156992-wpcom.

samhotchkiss added a commit that referenced this pull request Aug 29, 2017

Merge API code from wpcom & Moved endpoint instantiations to files th鈥
鈥t declare their classes. (#7700)

* API: initialize "list posts" endpoint v1.2, add test for new param, run previous tests on new version

Merges r156796-wpcom.

* Sites: Add options to the query arguments to pick them when limiting

r157700-wpcom allowed the site endpoint to pre-emptively ignore fields and options passed. This teaches the API to pass along the options value if it is supplied. Fields are special, and specified on the root endpoint class.

Merges r157706-wpcom.

* Publicize: Remove old endpoints for publicize scheduling

Summary:
During our meetup we introduced endpoints for scheduling publicize acitons.
Since we ditnt have any data structures at this point, the architecture was in flux.
In https://[private link] @sirbrillig introduced v2 API endpoints.
This is a cleanup of these endpoints.

Test Plan:
- Test API still works (load calypso, etc)
- Test republicize still works ( on a business site go to posts list,  click sharing under a post and share it to twitter. Go to your twitter page and see that post )

Reviewers: sirbrillig, lamosty, artpi, retrofox

Reviewed By: sirbrillig, retrofox

Subscribers: sirbrillig

Differential Revision: https://[private link]

Merges r157868-wpcom.

* API: add net_neutrality to site settings endpoint

See: https://[private link]

Merges r158940-wpcom.

* API: Net Neutrality: Disables Net Neutrality feature

Stops requiring Net Neutrality plugin as mu-plugin and removes API changes. Next step is to remove the actual plugin. Two-step process to minimize chances of errors.

Merges r159248-wpcom.

* Rest-API: Introduce a bulk post deletion endpoint

Summary:
This diff introduces a new bulk post deletion endpoint. The endpoint will be used in the future to enable bulk deletion of posts via Calypso. The endpoint follows the behavior of the current single-delete endpoint: if trash is enabled, the first call will send a post to the trash, and subsequent calls will permanently delete a post. If trash isn't enabled, any call will permanently delete a post.

Trello card: https://trello.com/c/P55zEhRd

Test Plan:
```
cd ~/public_html/bin/tests/api-v1/ && phpunit suites/Post/BulkDeletePostTest.php
```

To test manually, apply the diff, sandbox `[private link]` and make requests using the [api console](https://[private link]) or some other tool against your sandboxed api.

Reviewers: #tanooki, mattormeeple

Reviewed By: #tanooki, mattormeeple

Subscribers: mattormeeple

Differential Revision: https://[private link]

Merges r160522-wpcom.

* Comments management: move Comments tree endpoint to WP.com REST API

Splitting out the include of recently added endpoint file to avoid
mid-deploy fatals.

Differential Revision: https://[private link]

Merges r160898-wpcom.

* REST API: Allow `posts_per_page` to be get/set from the settings endpoint

Summary:
In order to add the `posts_per_page` to Calypso, this Diff adds the ability to get/set the setting from the REST endpoint.

[Trello card](https://trello.com/c/dZQHF7vE)

Test Plan:
* Make sure tests pass:

```
cd ~/public_html/bin/tests/api-v1 && phpunit suites/Site/SiteSettingsTest.php
```

* Sandbox public-api
* Retrieve settings for one of your sites: https://[private link].1/sites/[private link]
* Make sure the response contains `posts_per_page` and the setting matches the setting for your site
* Post to the same endpoint and update the setting (by posting the key `posts_per_page` with any integer value)
* Make sure the value is properly updated

Reviewers: #tanooki, mattormeeple

Reviewed By: #tanooki, mattormeeple

Subscribers: mattormeeple

Differential Revision: https://[private link]

Merges r155891-wpcom.

* class.wpcom-json-api-site-settings-endpoint.php: Resolve divergence from Jetpack.

Summary:
This merges the following commits:
    - a698e2f
    - 259c1d8
    - 52f2d87
    - a8de343
    - 7c24905
    - b37cd69
    - 348017e
    - 67e3bce
    - a5f1be0
    - ebe937a
    - 26dbd2a
    - cfc5267
    - 436a3ea

Test Plan: This diff was created automatically with no test plan.

Reviewers: aduthie7, vindl

Reviewed By: vindl

Subscribers: zinigor, eliorivero

Maniphest Tasks: T511

Differential Revision: https://[private link]

Merges r156010-wpcom.

* API: add net_neutrality to site settings endpoint

See: https://[private link]

Merges r158940-wpcom.

* API: Fix issue where updated net_neutrality setting was returned in different format when saved than when retrieved

Merges r159009-wpcom.

* API: Net Neutrality: Rename net neutrality option so it is a fresh opt-in

Merges r159016-wpcom.

* API: Net Neutrality: Disables Net Neutrality feature

Stops requiring Net Neutrality plugin as mu-plugin and removes API changes. Next step is to remove the actual plugin. Two-step process to minimize chances of errors.

Merges r159248-wpcom.

* REST API: Settings: fix `jetpack_relatedposts_enabled`

See Automattic/wp-calypso#69

The REST API settings endpoint includes a property `jetpack_relatedposts_enabled`, which is true if the Related Posts plugin will display related posts. The value from this endpoint is incorrect, however, when a site has not modified their settings. This is because the `Jetpack_RelatedPosts` plugin defaults the setting to be enabled if it is not set.

This change modifies the endpoint to use the same logic: if the setting is not set, it will default to reporting `jetpack_relatedposts_enabled` as true.

Some sites (VIP and Jetpack) default this setting to `false` instead, but the way this is accomplished is that when the plugin is loaded by `wp-content/mu-plugins/related-posts.php`, it actively changes the option to `false`. Since that loader should still be used by the REST API, that should mean that such sites will continue to have `jetpack_relatedposts_enabled` reported correctly.

Merges r159322-wpcom.

* REST API: Fix Missing videopress_guid in upload media response

Summary: During testing of the new Media Video Widget, the videopress_guid which is needed to construct the proper oembed url was missing in API responses for me.  The following minor change fixes this issue.  Additional details #7215

Test Plan: See the PR linked above for test instructions

Reviewers: codebykat

Reviewed By: codebykat

Subscribers: dbtlr

Differential Revision: https://[private link]

Merges r156992-wpcom.

* Fix an issue that was reported in Jetpack 5.1 while uploading images that was due to merging in WPCOM only code. This adds in a WPCOM exclusion to remove videopress processing.

Merges r158493-wpcom.

* There were some issues with the videopress_guid not return for some Jetpack requests. This attempts to normalize how media items are accessed and how add a couple of failure exceptions to help recover if they are encountered.

Merges r159298-wpcom.

* Rest-API: Introduce a bulk post deletion endpoint

Note: This commit only adds the new endpoint file. The remainder of D6769 will follow in a subsequent commit.

Summary:
This diff introduces a new bulk post deletion endpoint. The endpoint will be used in the future to enable bulk deletion of posts via Calypso. The endpoint follows the behavior of the current single-delete endpoint: if trash is enabled, the first call will send a post to the trash, and subsequent calls will permanently delete a post. If trash isn't enabled, any call will permanently delete a post.

Author: @jonathansadowski
Merges r160521-wpcom.

* Synchronising the changes between dotcom and Jetpack: removing an unneeded array reference.

* Removed the Publicize endpoint that was moved in r161306-wpcom.

* Minor whitespace change.

* Moved endpoint instantiations to files that declare their classes.

* Whitespace fixes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.