Skip to content

Commit b7db2f3

Browse files
committed
Add comment
1 parent f5b5414 commit b7db2f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dotcom-rendering/src/components/SelfHostedVideoPlayer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ export const SelfHostedVideoPlayer = forwardRef(
184184
}-${atomId}`;
185185

186186
/**
187-
* We need CORS enabled to show subtitles on a video as it allows access to the VTT file.
187+
* To show subtitles, CORS must be enabled as it allows access to the VTT file.
188188
*
189-
* We don't want a client to not request CORS headers on a video request, then to request
190-
* the same video with CORS headers, as the response could be cached without the headers, which
191-
* will result in the video failing to load. Therefore, we always request CORS headers in production.
189+
* CORS should be enabled in production so that requests are consistent with respect to CORS.
190+
* If a client requests a video without CORS, then later made a request to the same video with
191+
* CORS, then this request could fail as the response could be cached without the headers.
192192
*/
193193
const requestCORS =
194194
showSubtitles || process.env.NODE_ENV === 'production';

0 commit comments

Comments
 (0)