-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Customer Home: Promote Free Photo Library #39506
Customer Home: Promote Free Photo Library #39506
Conversation
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.
Thanks @Aurorum!
This works well on my tests but I wonder if we could avoid to download a 1.17MB GIF file every time the Customer Home is loaded. Could we maybe embed a video in a video
element using preload="none"
or preload="metadata"
so the video is downloaded only when the user wants to play it?
Thanks @mmtr, I'm getting this error when I try to do that:
Is it possible to upload the video somewhere so I can use a link to embed it? Here's the video I used, by the way: https://cdn.discordapp.com/attachments/448937740399017985/679361412115464222/free-photo-library-demonstration.mp4 (note: downloads instantly) |
@mmtr would you like to help with adding the video assets? I'm actually not sure if this needs to be on wpcom or if the normal Calypso asset folders would work here. cc @josephscott @sgomes if y'all had any suggestions. |
Just to clarify, we won't play the video unless the customer chooses to play it. Is that correct? If this is the case, then LGTM! Thanks, @Aurorum! |
Currently it's a GIF that auto-plays whenever the Customer Home is loaded. My understanding is that the intention is to switch that to a video which someone can choose to play, but that would need to be uploaded somewhere so that I could embed it I think. |
@Aurorum I don't think it's any different to use a video file or a gif file through an assets import. Uploading to The other, less ideal option is to keep the whole thing as a I agree with the sentiment that folks have expressed that we should not be loading a 1.7MB |
Oh, seems we're missing a webpack loader for video files. I guess that adding a module.exports.loader = options => ( {
test: /\.(?:gif|jpg|jpeg|png|svg)$/i,
use: [
{
loader: require.resolve( 'file-loader' ),
options: {
name: '[name]-[hash].[ext]',
outputPath: 'images/',
...options,
},
},
],
}, {
test: /\.(?:mp4)$/i,
use: [
{
loader: require.resolve( 'file-loader' ),
options: {
name: '[name]-[hash].[ext]',
outputPath: 'videos/',
...options,
},
},
],
} ); @sgomes would you suggest going this way further? I don't expect we'll need to load many videos in Calypso, so it might be better to just upload the video somewhere else and add a proper weback loader in the future if we start adding more videos. @Aurorum in the meantime, I uploaded the video to the WP.com CDN so you can use this URL: https://wpcom.files.wordpress.com/2020/02/free-photo-library-demonstration.mp4 |
'create stunning designs.' | ||
) } | ||
</p> | ||
<Button href={ localizeUrl( 'https://support.wordpress.com/free-photo-library/' ) }> |
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.
Linking to the support docs makes sense as a first step. @dezzie what do you think of an external icon for the button or link, similar to our support card?
Posting my previous question here, in case it's missed in the review thread: @Automattic/manage should we be concerned about non-English users? Video is quite simple and I think most of the users should be able to follow it despite showing an English interface. |
@mmtr I'm not concerned about non-English users. You're right that the video is simple enough. And the "Learn more" button will take them to the support doc that has more information and still screenshots if they need it. |
Good point about localization, let's maybe start with EN and add locale specific assets if this appears to help folks? |
Looking pretty good so far @Aurorum 💖 If this PR thread gets a little long lived, we can always land incremental work under a feature flag. Some larger design questions for @lcollette @dezzie @danhauk
|
Should be safe to use it as long as we use a MP4 video. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#Browser_compatibility and https://www.w3schools.com/html/html5_video.asp (HTML Video - Browser Support) |
Agreed, @gwwar. Let's go with a modal as a first step, then we can revisit. |
Just so I understand correctly, someone would click the thumbnail of the video, and then a dialogue/modal would appear with the video at a larger size which could be dismissed, correct? |
That's correct, @Aurorum. :) |
client/my-sites/customer-home/free-photo-library-card/index.jsx
Outdated
Show resolved
Hide resolved
Really looking good @Aurorum I think we're almost code complete here. 🎉 Thanks for sticking with it! Some last things we might want to touch up:
Some screenshots for documentation: Non-Blocking but @lcollette what do we think of the overall video content here? I think I just realized that folks might not understand how to get to the Block-Editor. We could show flows in context to home here, or have another mini clip on editing sites/pages. (Just thinking in general on how to build up these educational clips). I think we might also need annotations or audio guidance in future iterations. |
I removed that. :)
I was thinking that too. The https://developers.google.com/web/updates/2016/07/autoplay Although that article shouldn't really apply since the video is
I think that would tie well into the solution for #39132, and I opened a PR for that in #39617. Still very much a WIP there tho :) |
Did you try using a capitalized param |
That works, thanks @mmtr! Video should now autoplay. :) |
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.
Awesome work here @Aurorum, as usual! Let me know what do you think about using a functional component with hooks. Other than that, this is ready to go.
client/my-sites/customer-home/free-photo-library-card/index.jsx
Outdated
Show resolved
Hide resolved
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~457 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
Changes proposed in this Pull Request
This promotes the Free Photo Library in the Customer Home with a
GIFvideo demonstrating how to use it and a link to the support document on it: https://en.support.wordpress.com/free-photo-library/Testing instructions
It should work fine in the Customer Home, although I'm unsure when this should disappear; I feel a GIF could become distracting. I think making it dismissable isn't a bad idea, but most of the conversation about that seems to be ongoing in #39147.
Fixes #39067