-
Notifications
You must be signed in to change notification settings - Fork 800
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
[RNMobile] Android player controls #29990
Conversation
Uses the same icons as the default VP player
Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run
to get started. More details: p9dueE-5Nn-p2 |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. |
Revert attempt to break cache via url params
Also remove null check on style object
import ReplayIcon from './icons/icon-replay.native.js'; | ||
import style from './style.scss'; | ||
|
||
const PlayerControls = ( { isSelected, playEnded, onToggle } ) => { |
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.
When I first started working on this, the Player
was still a small component. It ballooned a bit more after I added the preview logic. Since the player controls are 1. Android only and 2. hopefully a temporary work around I opted to put as much of the logic into a separate component.
Also switch to using aspect-ratio style
@jhnstn Heads up that I pushed this commit c4d0115 to fix syntax and linting issues I noticed when reviewing the code (there was also this CI job failing). |
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.
@jhnstn I tested the controls in an emulator and an actual device but the videos don't play when tapping on them. Have you experienced this?
android-vp-controls.mp4
...s/src/client/block-editor/blocks/video/components/player/controls/icons/icon-pause.native.js
Outdated
Show resolved
Hide resolved
projects/packages/videopress/src/client/block-editor/blocks/video/edit.native.js
Outdated
Show resolved
Hide resolved
...s/packages/videopress/src/client/block-editor/blocks/video/components/player/index.native.js
Show resolved
Hide resolved
This was due to a merge issue. The ref forwarding got lost resolving a merge conflict. I have noticed that there are cases where the video does not play but the audio does. At the moment I am stumped on trying to reproduce this consistently. If you log the events: diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/components/player/index.native.js b/projects/packages/videopress/src/client/block-editor/blocks/video/components/player/index.native.js
index 7ce181dcfe..005a66e44a 100644
--- a/projects/packages/videopress/src/client/block-editor/blocks/video/components/player/index.native.js
+++ b/projects/packages/videopress/src/client/block-editor/blocks/video/components/player/index.native.js
@@ -127,6 +127,7 @@ export default function Player( { isSelected, attributes } ) {
}, [ preview, isPlayerLoaded, isRequestingEmbedPreview, previewCheckAttempts ] );
const onSandboxMessage = useCallback( message => {
+ console.log( 'onSandboxMessage', message );
switch ( message.event ) {
case 'videopress_ready':
setIsPlayerReady( true ); You can see the |
I couldn't reproduce this issue on a physical device (Samsung Galaxy S20 FE 5G - Android 13). But as mentioned internally (p1683110146012529/1682712389.595559-slack-C04LWMHSGLC) this might be easier to be reproduced on specific Android models. I tried emulating a Pixel device and managed to partially reproduce it. However, the video never completely stopped. What I mainly noticed is that the video took longer to load and had some eventual stuttering during the playing. In any case, I found a blocker for this approach related to R-rated videos. Those videos prompt the user to enter the DOB, so we encounter the same issue we had with touch events not being passed to the WebView. The DOB request is controlled by the embedded player, so unless we disable it via the VideoPress URL params as we did with the autoplay, this approach won't cover that issue. |
It seems this approach has too unstable, closing in favor of loading the video preview in a standalone WebView |
Fixes wordpress-mobile/gutenberg-mobile#5646
Depends on WordPress/gutenberg#49663
Proposed changes:
The following apply to Android only
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
On Android
Uploading a new video
On iOS