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

fix(tapping-video): tapping the video should play/pause #723

Merged
merged 1 commit into from
Dec 25, 2023

Conversation

aliraza556
Copy link
Contributor

Problem:

Users currently cannot toggle play/pause by tapping on the video in our media player. The acceptance criteria specify that tapping on the video when not playing should play the video, and tapping on the video when it is playing should pause the video.

Solution:

I implemented a toggle play/pause functionality by attaching an onClick event handler to the ReactPlayer component. This handler changes the play state based on the current state of the video, allowing users to tap the video to play or pause it.

Changes:

  • Added handleVideoClick Function: Created a function to toggle the play state between play and pause.
  • Attached onClick Handler to ReactPlayer: The ReactPlayer component now has an onClick event that triggers the handleVideoClick function.

Here are the specific code changes:

  1. Within MediaPlayerComponent:

    • Added a handleVideoClick method to toggle isPlaying state.

    • Attached this method to the ReactPlayer component's onClick event.

  2. Modifications in JSX:

    • <Wrapper hidden={hidden} onClick={handleVideoClick}> to ensure the entire player area is clickable.

Evidence:

A short demo video was recorded showing the new functionality in action. It demonstrates the ease with which a user can now play or pause the video with a simple tap, highlighting the responsiveness and effectiveness of the implemented solution.

Testing:

  • UI Tests: Added UI tests to simulate user clicking on the video element and verifying if the video pauses/plays as expected.
  • Manual Testing: Conducted manual testing across different browsers and devices to ensure the click functionality works seamlessly and doesn't interfere with other player controls.

Notes:

Please review the changes and merge this PR if everything is in order. This fix is essential for the upcoming release, and I look forward to any feedback you might have.

@aliraza556
Copy link
Contributor Author

aliraza556 commented Dec 25, 2023

Hi @Rassl @kevkevinpal
I have fixed the tapping video issue #717. Could you take a look and provide your feedback? I know it's Christmas Day, but if you are free and it's possible, could you please review it?

Copy link
Collaborator

@Rassl Rassl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Rassl Rassl merged commit 0d1390c into stakwork:master Dec 25, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants