-
Notifications
You must be signed in to change notification settings - Fork 102
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
feat: export racing bar animation as video #743
base: master
Are you sure you want to change the base?
Conversation
715593f
to
f66a485
Compare
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.
Hello @lhbvvvvv, I cannot solve the canvas is not origin-clean
error at the moment. It is an issue that not easy to circumvent.
However, I refactored the code in a React way, which may help you be more familiar with the React world.
This PR may linger for a while until we find a solution.
<button | ||
className="perceptor-button" | ||
onClick={mediaControlersRef.current?.play} | ||
> | ||
{getMessageByLocale( | ||
'component_projectRacingBar_ReplayButton', | ||
options.locale | ||
)} | ||
</button> | ||
<button | ||
className="perceptor-button" | ||
onClick={mediaControlersRef.current?.startRecording} | ||
> | ||
Start Recording | ||
</button> | ||
<button | ||
className="perceptor-button" | ||
onClick={mediaControlersRef.current?.stopRecording} | ||
> | ||
Stop Recording | ||
</button> |
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.
@lhbvvvvv @andyhuang18
This is a way to control the child component in its parent component. Here I use forwardRef and useImperativeHandle to let the parent component use the media player controllers provided by its child component. I think this is a great example to help you get familiar with React :)
cc @wxharry
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.
Thank you for your guidance~ Through this example I can better understand the control between components.
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.
Compared to my previous code has definitely improved. Thanks for your guidance.
Brief Information
This pull request is in the type of (more info about types):
Related issues (all available keywords):
Details
Implement the function of exporting racing bar animation as video.
Checklist
Others