-
Notifications
You must be signed in to change notification settings - Fork 57
Add video block ( first iteration ) #854
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
Conversation
# Conflicts: # gutenberg # react-native-gutenberg-bridge/ios/GutenbergBridgeDelegate.swift
# Conflicts: # gutenberg
# Conflicts: # gutenberg # package.json # yarn.lock
|
Thank you @SergioEstevao - That clarifies a lot!
I definitely agree with that 👍
To do this on Mobile, we might have to import the JetPack block, right?
Still for another PR but needed for release, I think we should show a message of some sort saying that this |
I think we just need to read the VideoPress hash, query the native side (there is an API call that from a VP hash does return video info) and replace it with the video URL when the call returns. |
|
How about self-hosted sites with JP installed @SergioEstevao ? If i understand it right, we're fully supporting the Video block on self-hosted sites without JP, right? |
Looking at the code produced on the block, we may not need to import the other block, we may only need to check if there is guid in the attributes and if so, make sure we write the The rendering should work because the block still is a video block and still has a |
@daniloercoli I didn't test that specific scenario, I was assuming it has the same behaviour has atomic, but maybe not, do you any test site where you can test that. |
I did a test on a self hosted site of mine with an old version of JP installed and got the following response: So I think it's the same of atomic sites. |
|
You used the web version to create the block right?
On this PR branch using mobile you always going to get that.
…On Wed, 8 May 2019 at 14:09, Danilo Ercoli ***@***.***> wrote:
@daniloercoli <https://github.com/daniloercoli> I didn't test that
specific scenario, I was assuming it has the same behaviour has atomic, but
maybe not, do you any test site where you can test that.
I did a test on a self hosted site of mine with an old version of JP
installed and got the following response:
<!-- wp:video {"id":135} -->
<figure class="wp-block-video"><video controls src="http://www.eritreo.it/wp39/wp-content/uploads/2019/05/VID_20190508_150328.mp4"></video></figure>
<!-- /wp:video -->
So I think it's the same of atomic sites.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#854 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAE7CUJ4IQFKBEY3EJ4YHI3PULGIDANCNFSM4HFADZWA>
.
|
|
@etoledom @pinarol The core states are:
Some of this is relevant on the notes you wrote above, but I'll address each of your notes individually: Media blocks are difficult to selectI would expect the entire inner content of the block would be a single tap area that would fill the entire inner content. So on a placeholder, you could tap anywhere on the inside of the block to take the "add video" action – like how the Image block placeholder already works. Some more detailed notes: When a Video block is static (not focused):
When a Video block is focused:
Retry options should have a
|
|
Some updated designs, based on conversations in Slack (@pinarol @etoledom @marecar3 @SergioEstevao): Notes:
|
|
hey @iamthomasbishop I've opened a separate issue to track those enhancements, we think they deserve a separate PR #966 Please note that video block won't be available publicly after merging the current PR, we'll get these UI enhancements and some other fixes first. |
|
I am going to open a separate issue for the unexpected video block html produced by Premium sites. We dug into that issue a lot yesterday but couldn't come up with a certain solution yet. It doesn't look directly related with our changes in this PR. But we'll definitely need to find a solution for that before we make video block publicly available. |
About my own comment here, It turned out I had a problem with my my mobile-secret settings that prevents me from doing this, you can ignore that @etoledom |
Update: we have added handling of invalid content to our project board, it will be resolved for v2. So I think I won't need to open a separate issue for this particular scenario. In the parallel we'll be working with Jetpack team to seek for a better solution. |
etoledom
left a comment
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.
Tested on iOS:
I think this is on a good shape to merge and continue with the rest of tasks. 🎉
As documentation, I found a way to save the local media URL to remote, which is not ideal:
Steps:
- Start uploading a video.
- Make it fail (stopping connectivity).
- Restore connectivity.
- Instead of resuming the upload, save the current post (Publish or Update).
⚠️ The video block has been saved with the local URL.
I think that probably the best would be to not save the local url in the url attribute, but on a new one dedicated for local urls.
To consider as a refactor in the future.
|
Thanks @etoledom 🎉
I agree.
I think this is a good task to do after we have some unit and ui tests because it'll lead us to a kind of refactor. I added an item named I will update branches from master/develop and resolve conflicts. |






To Fix: #855
There are also some more TODO items in this issue: #687 (comment) which are not handled in this PR
This PR introduces video block.
Gutenberg PR: WordPress/gutenberg#14912
This is a breaking change for parent apps:
WPiOS PR: wordpress-mobile/WordPress-iOS#11454
WPAndroid PR: wordpress-mobile/WordPress-Android#9644
iOS Example app:
Android Example app:
(Media option picker is not working but a sample video block is added to content)
Types of changes
filtersuch as 'video', 'image'To Test
Test with both iOS and Android Example apps:
iOS Example App Tests
Note: Video playback isn't very smooth in iOS simulator but there's no problem on real devices as far as I can tell.
Test 1 - Add Video block
Test 2 - Insert video from device (successful) (currently available on iOS example app only)

- At the end of the progress you should be able to tap and play the videoTest 3 - Insert video from device (failing) (currently available on iOS example app only)

- Tap on the gray area and verify that you see the retry option:
- Tap on Retry and see that upload starts againTest 4 - Insert video from device (cancel) (currently available on iOS example app only)

- Choose Cancel and see that media is cleared and you see the placeholder again.Test 5 - Insert video from WP media library (currently available on iOS example app only)
(Since this is the example app we are only updating the block with a video link)
Test 6
Verify that above tests are working for Image block also