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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in the ability to get thumbnails for VideoPress via media endpoint. #6631

Merged
merged 2 commits into from
Mar 14, 2017

Conversation

dbtlr
Copy link
Contributor

@dbtlr dbtlr commented Mar 10, 2017

When we pushed out VideoPress, it was missing poster thumbnails. This is needed to make Calypso work correctly with Jetpack sites.

This PR seeks to add thumbnails by adding the wpcom functions that the API tries to call, to add in the images.

Request: Can we get this in the next point release for Jetpack, to make sure we get Calypso working ASAP?

Testing

Simply check the media library in Calypso and make sure thumbnails are loading.

If checking the output for the media API for a Jetpack site, you should see the thumbnails reporting in there like this:

screen shot 2017-03-10 at 11 49 22 pm

@dbtlr dbtlr added [Status] Needs Review This PR is ready for review. [Type] Bug When a feature is broken and / or not performing as intended labels Mar 10, 2017
@dbtlr dbtlr added this to the 4.7.1 milestone Mar 10, 2017
@dbtlr dbtlr requested a review from zinigor March 10, 2017 16:52
@dbtlr dbtlr added the [Feature] VideoPress A feature to help you upload and insert videos on your site. label Mar 10, 2017
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left 2 minor comments, but other than that it appears to work properly:
screen shot 2017-03-13 at 10 56 27

// Switch to photon if needed.
$poster = str_replace(
'https://videos.files.wordpress.com',
'https://i0.wp.com/videos.files.wordpress.com',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use apply_filters( 'jetpack_photon_url, $poster )` here, so all Photon filters / domain sharding / etc can be applied if needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I'll apply this change and test. I was really just trying to fix the fact that Calypso won't work without Photon URLs here. But it makes sense to use the internal methods for this.

// Switch to photon if needed.
$poster = str_replace(
'https://videos.files.wordpress.com',
'https://i0.wp.com/videos.files.wordpress.com',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the jetpack_photon_url filter here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@jeherve jeherve added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Mar 13, 2017
@dbtlr dbtlr added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Mar 13, 2017
@dbtlr
Copy link
Contributor Author

dbtlr commented Mar 13, 2017

@jeherve I've made the requested changes and with a couple tiny gotchas, it seems to be working fine now.

Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good and works in my tests! LGTM!

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Mar 13, 2017
Copy link
Member

@zinigor zinigor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, works good!

@zinigor zinigor merged commit d11f637 into master Mar 14, 2017
@zinigor zinigor removed the [Status] Ready to Merge Go ahead, you can push that green button! label Mar 14, 2017
@zinigor zinigor deleted the add/thumbnails-to-media-for-videopress branch March 14, 2017 13:07
jeherve added a commit that referenced this pull request Mar 14, 2017
dereksmart pushed a commit that referenced this pull request Mar 14, 2017
…t. (#6631)

* Add in the ability to get thumbnails for VideoPress via media endpoint.

* Switch to use photon filter.
@dereksmart
Copy link
Member

merged to 4.7 ebcd7c1

dereksmart pushed a commit that referenced this pull request Mar 14, 2017
* Changelog: add #6641

* Changelog: add #6647

* Changelog: add #6631

* Changelog: add #6630

* Changelog: update release date.
dereksmart pushed a commit that referenced this pull request Mar 14, 2017
* Changelog: add #6641

* Changelog: add #6647

* Changelog: add #6631

* Changelog: add #6630

* Changelog: update release date.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] VideoPress A feature to help you upload and insert videos on your site. [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants