Caption hosting matrix
This is a resource-loading investigation, not a WebVTT grammar lesson. The track URL normally shares the document's origin unless the parent media element uses the relevant cross-origin mechanism. Server access policy must still agree with the request. A renamed URL, redirected login response or cached failure can obscure that boundary. The distinct deliverable is a small origin-and-response matrix identifying which exact request failed and whether the file received by the browser is the same approved subtitle revision.
Build the evidence
- 01
Prove the caption file independently of the CDN
Use a minimal known-good VTT beside the review page on one authorized origin and verify it appears with a plain player. Keep the source text identical when moving it to the CDN. Record the page origin, media origin and track origin separately; a subdomain can be a different origin. Check the actual final URL after redirects rather than inferring access from a link that opens in a logged-in tab.
- 02
Inspect request and response together
The example adds crossorigin=anonymous to the parent video before the track is loaded. The caption server must return an appropriate access-control policy for the requesting page, and the resource must remain accessible under that anonymous request model. Check status, redirects, MIME type and body. A successful HTML error page is not a successful subtitle fetch. Do not copy a signed private URL or authentication token into a public debugging report.
- 03
Retest the whole player without broadening access
Confirm that the new media request mode also works for the MP4, since a parent attribute can affect more than the text file. If the service requires credentials, design the intended credential policy with its owner rather than swapping anonymous and credentialed requests at random. Repeat the same-origin and CDN cases after cache changes, retain their exact revisions and use the least exposure needed for authorized reviewers.
A bounded example
Illustrative case: a caption file loads from /captions/en.vtt beside the page but fails from a media subdomain. A CDN response report reveals that the anonymous request receives an access-denied body. The transcript can be perfectly valid and still fail. Another case may require a correct cross-origin header while serving the right body. These examples identify diagnostic branches; they are not claims about AISwapLab's hosting setup or a tested CDN compatibility matrix.
Local diagnostic commands
Documentation example only. The example.test hosts are placeholders, not live endpoints. No private access policy, CDN configuration or browser security setting was changed.
<!-- Set the mode before loading cross-origin media/track resources. -->
<video controls crossorigin="anonymous" src="https://media.example.test/clip.mp4">
<track kind="captions" srclang="en" label="English"
src="https://captions.example.test/en.vtt" default>
</video>
<!-- Replace example origins with authorized endpoints.
Their CORS/access responses must support the actual page request. -->Caption hosting matrix
| Case | Record | Diagnostic value |
|---|---|---|
| Same-origin baseline | Status, body and displayed cues | Separates syntax/player from cross-origin access |
| CDN track | Final URL, request mode and CORS response | Identifies resource-policy mismatch |
| MP4 after mode change | Playback and request outcome | Avoids fixing captions while breaking video |
Acceptance evidence
- The same VTT revision passes a same-origin baseline.
- Page, MP4 and caption origins and redirects are recorded independently.
- The actual request mode and server policy are compatible.
- Debug evidence excludes private signed URLs, session cookies and credentials.
Stop condition
Stop if the fix would make private review media public or bypass an access policy. Ask the asset owner for an authorized delivery design. When the baseline fails too, return to syntax and track-selection checks rather than blaming the CDN merely because its hostname changed. Publication should wait for the intended reviewer access path to work.
