-
Notifications
You must be signed in to change notification settings - Fork 800
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
VideoPress: Add video settings to the VideoPress-enhanced video block #13134
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: August 6, 2019. |
Hmm @mmtr looks like tests are failing in D30868-code from a timeout. Is there a way of triggering another run? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @mmtr! I always ❤️ the detailed testing instructions.
I smoke tested on a Jetpack site with various combinations of settings applied. No errors on second edit.
I think folks can get a video that doesn't play if they turn off controls / don't have autoplay/loop on, but I think we allowed the before.
I just restarted the build in the diff. Let's see if they pass now. |
Just realized that the deprecated version included on this PR doesn't work when using the latest Gutenberg plugin version due to the changes introduced by WordPress/gutenberg#16348. To reproduce the problem:
Will investigate if the deprecations should be defined in a different way. Pinging @talldan @epiqueras @youknowriad as well, since they seem to have been involved in the recents changes for deprecations. |
mmtr, Your synced wpcom patch D30868-code has been updated. |
Noted that this is caused by the deprecations returned by the After WordPress/gutenberg#16348, the deprecations now trigger the Added a workaround in 6a89012 that ensures that our extension doesn't run when the |
@youknowriad @talldan Maybe we should provide a way for the filter to infer whether it's running on a deprecation or not. |
I verified that this no longer breaks existing video blocks on edit. @mmtr is setting the poster image working for you from wp-admin? |
Yup, but I noted that the previewed video player doesn't reflect always the settings I defined on the sidebar. Seems to be the same behavior as noted by @kwight at D30868-code#616950. However, the player that appears on the published view is always correct. Will try to determine what's causing this. |
Turned out to be a bug in core caused by the We render a Note that his only happens when we want to preview a URL that was already previewed before, since these previews are cached, so the block doesn't render the "Generating preview..." placeholder and will keep using the same If the preview has never been generated, the block will render first the "Generating preview..." placeholder and then a new instance of the I'm not sure if there is any workaround for this (AFAIK we cannot force a re-rendering of a child component from the parent), but if this is a blocker we could try something like invalidating the cached previews, so we make sure we render a new instance of the |
Please rebase with #12926 |
Added a workaround in ac48fe8 that invalidates the cached previews before generating a new one. |
This sounds reasonable to me. |
Sorry for not responding, must have missed the notification. I'll work on a PR in gutenberg for this, shouldn't take long to implement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty cool, I love that it works for both local videos and VideoPress videos, nice work!
It tests well, I only found issues with VideoPress videos, when flipping one toggle and then turning it off. If you do that with the Mute toggle for example, &muted=true
is added to the URL, and then it is switched to &muted=false
.
- I think it would be cleaner if the parameter were removed altogether instead of keeping it with the
false
value muted=false
does not actually work. The video is muted as soon as you have the parameter, regardless of its value; in all the examples below we get a muted video.
mmtr, Your synced wpcom patch D30868-code has been updated. |
Thanks for that suggestion @jeherve! Actually it makes sense to don't include any setting in the URL that will have the same effect as the default player, so the URL will look cleaner. I applied some changes in 765e372 based on that approach, and now the VideoPress URLs will contain only the parameters having a value that differs from the default VideoPress player settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works better now, everything appears to be working for me right now, except for autoplay; does it work for you?
I tried in both Chrome and Firefox. Do those browsers not allow autoplay at all?
This seems to be the intended behaviour, for the
I can't get autoplay to work at all in Chrome. This post implies that having both mute and autoplay active should enable autoplay, but this wasn't my experience (their other mentioned situations that allow autoplay didn't work for me either; and the post is old, but it was recently updated). Oddly enough, Firefox did behave that way; I could leave autoplay on, then toggle its effectiveness with the mute setting. It seems like browsers are all a bit inconsistent; since we've been able to determine each setting works as expected in at least one browser, we probably shouldn't hold up the PR on it 🙃 @mmtr I'm still having problems with the editor preview though; I can't interact with it directly at all ¯_(ツ)_/¯ |
Oh! Sorry, just saw your comment in D30868-code:
|
It's not working for me in Chrome but it is in Firefox as long as the video is muted, as @kwight mentioned. Not sure why is not autoplayed in Chrome, since the Definitely not an issue on this PR and something we could investigate in the JavaScript API for VideoPress: https://github.com/Automattic/videopress/issues/38 |
* 7.7 changelog: initial set of changes * Changelog: add #13154 * Changelog: add #13134 * Changelog: add #12699 and many others * Changelog: add #13127 * Changelog: add #13167 * Changelog: add #13225 * Changelog: add #13179 * Changelog: add #13173 * Changelog: add #13232 * Changelog: add #13137 * Changelog: add #13172 * Changelog: add #13182 * Changelog: add #13200 * Changelog: add #13244 * Changelog: add #13267 * Changelog: add #13204 * changelog: add #13205 * Changelog: add #13183 * Changelog: add #13278 * Changelog: add #13162 * Changelog: add #13268 * Changelog: add #13286 * Changelog: add #13273 * Changelog: add #12474 * Changelog: add #13085 * Changelog: add #13266 * Changelog: add #13306 * Changelog: add #13311 * Changelog: add #13302 * Changelog: add #13196 * Changelog: add #12733 * Changelog: add #13261 * Changelog: add #13322 * Changelog: add #13333 * Changelog: add #13335
Fixes #11837.
Changes proposed in this Pull Request:
This PR adds the video settings allowing to customize several options for the VideoPress player rendered by the video block (extended by our VideoPress extension for Gutenberg).
Now, after inserting a VideoPress-enhanced video block, a user can set the following settings:
Given that these settings modifies the URL saved in the block content, any existing post containing a VideoPress-enhanced video block would result in a "invalid content" error. In order to support those posts, a deprecated version of the block has been added.
This PR also introduces a new
playsInline
attribute (added in core in WordPress/gutenberg#14500), but it's currently unmodifiable, since VideoPress doesn't support it yet.Is this a new feature or does it add/remove features to an existing part of Jetpack?
See pafL3P-cU-p2 (Phase 3).
Testing instructions:
Proposed changelog entry for your changes: