-
Notifications
You must be signed in to change notification settings - Fork 30
Re-enable self-hosted video stories #14921
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
base: main
Are you sure you want to change the base?
Conversation
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
38110fd to
6de91a0
Compare
Fweddi
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.
How does setting to crossOrigin to anonymous when there are subtitles, work, when it fails if they aren't subtitles?
| showSubtitles && subtitleStyles(subtitleSize), | ||
| ]} | ||
| crossOrigin="anonymous" | ||
| crossOrigin={showSubtitles ? 'anonymous' : undefined} |
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.
How does setting to crossOrigin to anonymous when there are subtitles work, but it fails if there aren't subtitles?
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.
Setting crossOrigin to anonymous is required for subtitles to work because the request for the video will only allow access to a sidecar vtt file if the video request uses CORS headers. CORS headers are not required if there is not a subtitles file.
We experienced issues when we added crossOrigin="anonymous" because some users had the original video request cached before this change (not using CORS headers), then this cached request failed after this change. Therefore I think it's better if always make video requests with CORS headers on production, and only locally omit CORS if it isn't required.
7412ae4 to
3e3428d
Compare
3e3428d to
3115152
Compare
3115152 to
f5b5414
Compare
710b553 to
b7db2f3
Compare
b7db2f3 to
7f6e13f
Compare
What does this change?
Add an
enableCorsprop so that stories do not have to use CORS for video requests.Why?
Stories containing self-hosted video do not work with
crossOriginset toanonymous. The reason for this is the same as why self-hosted videos do not work when developing locally. It's needed to be able to work with a side-car VTT file.It is difficult to continue development without being able to use video stories and without the safety net of Chromatic.
Being unable to check stories when developing self-hosted video has led and may lead to introducing bugs.
What are the alternatives
Screenshots
https://www.chromatic.com/component?appId=63e251470cfbe61776b0ef19&csfId=components-selfhostedvideo&buildNumber=13841&k=693007b20507c3a940c66af4-1300px-interactive-true&h=2&b=-1