-
Notifications
You must be signed in to change notification settings - Fork 381
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
Convert <video /> to amp-video #4
Comments
It looks like AMP-WP currently only handles VideoPress if it is used in the Iframe mode (which is the default), but it is possible to configure VideoPress to fully embed in the page (ie, no Iframe), which then allows for customizing the styling. This can be done via adding the following to the
I use the above (because I want to customize the CSS of the player), and so currently there is no Amp output for my VideoPress videos. I'm not sure what the best route here is--perhaps outputting the same Somehow we need to eventually handle this condition though, as one of the advertised features of VideoPress is customizing the CSS (though admittedly it's listed as being a Beta feature currently), and that can only be done via the above method (as far as I know). Thoughts? |
Yeah, falling back to |
Actually I think the newest version of the VideoPress player no longer uses Flash (I believe it's a combination HTML5 Video and JS), though it is possible to force it to use the "legacy" Flash-based player. But it seems like it might be more trouble than it's worth to try to make things work in the fully-embedded-in-page mode (vs Iframe) for AMP pages as it needs to inject it's own |
Would you mind linking to an example post? I don't have VideoPress readily available on a non-WordPress.com site right now. The non-iframe mode should still work if it's outputting |
I realize now why it's not working--both the legacy player and the new player (in non-iframe mode) build the player itself via Javascript after page load, so there's very little output prior to that (and thus very little available to the Amp-WP plugin to access). However, I do think that little bit ( I realize that it isn't much, but the I don't want to link to my testing site (as it's private), but I have added some code to my live site so that you can toggle between the Legacy player and the New player (configured to fully embed in the page, and not use Iframes). Legacy Player: New Player: If you view the non-Amp versions of this page the CSS is a bit buggered for the new player (particularly in the Share menu) because I've not updated the public site for that yet. I should also mention that you may notice some If we go this route (of building an Iframe string off of the video id, eg, Alternatively (to the above plan), if the VideoPress devs can make it watch for when a page is in "Amp mode" and then actually output more content that would greatly simplify things! It seems all that would be needed is just to output the single Iframe string (not even bother with the :) |
Don't know why I didn't think of this before... This is the simplest solution for now (perhaps this can be documented somewhere for the sake of VideoPress users who are not using the default mode of Iframes?). In
This checks if the Amp-WP plugin is active, and if so checks whether we are on an AMP page or not. And if we are, then the above tells VideoPress to output an Iframe (which can then be properly parsed by the Amp-WP plugin). Otherwise, forego the Iframe and fully embed the VideoPress player in the page (so that it can be styled, etc.). |
See https://github.com/ampproject/amphtml/blob/master/builtins/amp-video.md
WPCOM + Jetpack: Should handle VideoPress as well.
The text was updated successfully, but these errors were encountered: