Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A quick component for inline videos in our articles in advance of the Grapher redesign post.
I opted to implement this without syncing the file from Google Drive like we do for images, as we're likely going to refactor that code soon with CF Images anyway, and it'd be a lot of extra complexity for a feature we're probably not going to use very much.
This means we'll need to ensure our mp4 files are hosted somewhere stable (in my demo I'm using a DO bucket) - these will be tracked in the
posts_gdocs_links
table so we can keep an eye on them and make sure they're not 404'ing.The
filename
property used with theposter
attribute for the video, which is recommended if you're usingpreload="none"
for the video element.These images are getting baked and resized like all our other images, even though we're only using the source image for the
poster
. If we think it's worth it, we could add an event listener to pick a resized version for further mobile pagespeed improvements.video.demo.mp4