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

Initial support for VideoPress v5 #20181

Merged
merged 18 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

24.4
-----

* [**] [Jetpack-only] Block editor: Introduce VideoPress v5 support, to fix issues using video block with dotcom and Jetpack sites [https://github.com/wordpress-mobile/gutenberg-mobile/pull/6634]

24.3
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,7 @@ private GutenbergPropsBuilder getGutenbergPropsBuilder() {
false,
false,
false,
false,
true,
false,
!isFreeWPCom,
Expand All @@ -2506,6 +2507,7 @@ private GutenbergPropsBuilder getGutenbergPropsBuilder() {
SiteUtils.supportsLayoutGridFeature(mSite),
SiteUtils.supportsTiledGalleryFeature(mSite),
SiteUtils.supportsVideoPressFeature(mSite),
SiteUtils.supportsVideoPressV5Feature(mSite, SiteUtils.WP_VIDEOPRESS_V5_JETPACK_VERSION),
SiteUtils.supportsEmbedVariationFeature(mSite, SiteUtils.WP_FACEBOOK_EMBED_JETPACK_VERSION),
SiteUtils.supportsEmbedVariationFeature(mSite, SiteUtils.WP_INSTAGRAM_EMBED_JETPACK_VERSION),
SiteUtils.supportsEmbedVariationFeature(mSite, SiteUtils.WP_LOOM_EMBED_JETPACK_VERSION),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class SiteUtils {
public static final String GB_EDITOR_NAME = "gutenberg";
public static final String AZTEC_EDITOR_NAME = "aztec";
public static final String WP_STORIES_CREATOR_NAME = "wp_stories_creator";
public static final String WP_VIDEOPRESS_V5_JETPACK_VERSION = "8.5";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note, I chose this version number based on the Jetpack version we support for the Contact Info block.

I couldn't find a definite version that the VideoPress v5 code was introduced on the web, and could find it supported as far back as Jetpack v7.2. I know the official stance is that we support "two releases prior to the current version", which is why I simply chose the oldest version we support for another block rather than going back to find a specific older version where web began supporting v5.

I'm open to changing this if others have feelings about what the version should be.

public static final String WP_STORIES_JETPACK_VERSION = "9.1";
public static final String WP_CONTACT_INFO_JETPACK_VERSION = "8.5";
public static final String WP_FACEBOOK_EMBED_JETPACK_VERSION = "9.0";
Expand Down Expand Up @@ -340,6 +341,11 @@ public static boolean supportsVideoPressFeature(SiteModel site) {
return site != null && site.isWPCom();
}

public static boolean supportsVideoPressV5Feature(SiteModel site, String minimalJetpackVersion) {
return site != null && site.isWPCom() || site.isWPComAtomic() || checkMinimalJetpackVersion(site,
minimalJetpackVersion);
}

public static boolean supportsEmbedVariationFeature(SiteModel site, String minimalJetpackVersion) {
return site != null && (site.isWPCom() || checkMinimalJetpackVersion(site, minimalJetpackVersion));
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ext {
automatticRestVersion = '1.0.8'
automatticStoriesVersion = '2.4.0'
automatticTracksVersion = '3.4.0'
gutenbergMobileVersion = 'v1.112.0'
gutenbergMobileVersion = 'v1.113.0-alpha1'
wordPressAztecVersion = 'v2.0'
wordPressFluxCVersion = '2.67.0'
wordPressLoginVersion = '1.14.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ data class GutenbergPropsBuilder(
private val enableLayoutGridBlock: Boolean,
private val enableTiledGalleryBlock: Boolean,
private val enableVideoPressBlock: Boolean,
private val enableVideoPressV5Support: Boolean,
private val enableFacebookEmbed: Boolean,
private val enableInstagramEmbed: Boolean,
private val enableLoomEmbed: Boolean,
Expand All @@ -38,6 +39,7 @@ data class GutenbergPropsBuilder(
enableLayoutGridBlock = enableLayoutGridBlock,
enableTiledGalleryBlock = enableTiledGalleryBlock,
enableVideoPressBlock = enableVideoPressBlock,
enableVideoPressV5Support = enableVideoPressV5Support,
enableFacebookEmbed = enableFacebookEmbed,
enableInstagramEmbed = enableInstagramEmbed,
enableLoomEmbed = enableLoomEmbed,
Expand Down
Loading