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

Added video block creation by dropping #8122

Merged
merged 2 commits into from Jul 24, 2018

Conversation

@caxco93
Copy link
Contributor

caxco93 commented Jul 23, 2018

Addresses #8021

Description

Dropping a video file on an insertion point now creates a Video Block
instead of a File Block.

This was done by adding the corresponding transform for the Video Block
It supports immediate preview until upload.

How has this been tested?

Included tests and manually

Screenshots

Before:
dropvideobefore

After:
dropvideoafters

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
Dropping a video file on an insertion point now creates a Video Block
instead of a File Block.

This was done by adding the corresponding transform for the Video Block
It supports immediate preview until upload.
Copy link
Member

noisysocks left a comment

Great idea! 😍

onFileChange: ( [ { url } ] ) => {
setAttributes( { src: url } );
},
allowedType: 'video',

This comment has been minimized.

Copy link
@noisysocks

noisysocks Jul 23, 2018

Member

We'll need to handle any errors that happen during the upload here using onError. See #8066 for an example that fixes the File block.

Copy link
Member

noisysocks left a comment

Works well! Thanks @caxco93.

@noisysocks noisysocks merged commit 04320fb into WordPress:master Jul 24, 2018
2 checks passed
2 checks passed
codecov/project 48.96% (+0.09%) compared to c835820
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@noisysocks noisysocks added this to the 3.4 milestone Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.