-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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 Video Unavailable problem at YouTube preview #26980
base: master
Are you sure you want to change the base?
Conversation
hey @Sn-Kinos , thank you for your contribution. Could you please describe the exact steps on how to reproduce the issue you are trying to solve so we can create a ticket and associate it with this fix? Thanks! |
@pvev I wonder if there's anything else I need to do 🏃♂️ |
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.
Codewise, LGTM. Waiting for security review.
E2E test triggered successfully for PR #26980. The corresponding commit's status check will be available shortly. |
E2E test run is starting for commit
|
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.
Thanks for the PR, @Sn-Kinos! I always assumed that the fact that YouTube videos didn't play for me in MM was something on my end, not that we were missing some things on the iframe
. Great find!
@@ -75,6 +76,11 @@ export default class YoutubeVideo extends React.PureComponent<Props, State> { | |||
height='360px' | |||
frameBorder='0' | |||
allowFullScreen={true} | |||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" |
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.
Do we need to allow all these things? picture-in-picture
and encrypted-media
are the only ones that seem like they would be applicable to a video in MM. autoplay
is technically applicable, but I don't think we want autoplaying video in MM
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.
It's necessary and the feature has been on src
as autoplay=1
.
Without autoplay | With autoplay |
---|---|
Screen.Recording.2024-05-29.at.11.02.51.mov |
Screen.Recording.2024-05-29.at.11.04.53.mov |
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.
Oh right. I forgot we went from showing a static image to the actual video. That makes sense.
I guess web-share/clipboard-write are needed for a share button and accelerometer/gyroscope are needed for rotating the video then (Edit: and 360 degree videos or whatever those are called)
No changes needed about what I commented on
@Sn-Kinos sorry that this review is taking longer that normal, but there are some security concerns about this change that are being discussed internally. As soon as we define an action, we will let you know. Thanks. |
I understand. I referred this iframe code from another commercial messenger app. I hope it can help you. |
@Sn-Kinos, thank you for your patience. The decision to use the referrer policy strict-origin-when-cross-origin can expose some sensitive information, which may be considered more or less critical depending on the use case. Therefore, this decision should be made by the workspace administrator. Given this, the idea is to make this value configurable through a parameter in the admin console. I wanted to ask if you would like to add this new configuration parameter and set the referrer policy based on that parameter (I would help and guide you through this process). Alternatively, I can merge your PR as it is and then take care of adding this configuration parameter in a subsequent PR. |
@pvev I prefer a subsequents PR. I thought there would be no problem because I brought the parameters used in Slack as it is, but I guess it wasn't? |
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 the contribution @Sn-Kinos 🚀
/update-branch |
@pvev I fixed lint and type error on CI. How can I re-run actions? |
@pvev I fixed code to pass all tests. Is there anything to do for me to merge this? |
Creating a new SpinWick test server using Mattermost Cloud. |
Mattermost test server created! 🎉 Access here: https://mattermost-pr-26980.test.mattermost.cloud
Your Spinwick's installation ID is: |
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.
Summary
Fixed the problem that YouTube preview shows Video Unavailable instead of the video.
youtube_video.tsx
Reproduce
Create a post that occurs Video Unavailable problem. I used https://youtu.be/edsx_MOhVnk on the below screenshots.
Ticket Link
No Tickets. (less than 20 lines of code change)
Screenshots
I haven't change the UI. But I can show about it w/ screenshots.
Release Note