✨ [video cache] Append captions track from cache response#37893
✨ [video cache] Append captions track from cache response#37893processprocess merged 15 commits intoampproject:mainfrom
Conversation
gmajoulet
left a comment
There was a problem hiding this comment.
This will fail to load on publisher's origins: the captions will load from the cdn.ampproject.org URL, while being on the origin URL, resulting in a CORS error.
I believe you will need to set a crossorigin attribute on the <video tag for it to work. You can test this very easily by setting the <track src= pointing to a different domain.
This however needs to happen much earlier in the code process, as the attribute needs to be present BEFORE we send the video cache request, as we use it to determine whether the video URLs need the ACAO header:
https://github.com/ampproject/amphtml/blob/main/extensions/amp-video/0.1/video-cache.js#L233
Because of this, wouldn't we need to set |
The video cache will respond with
captions_url(not implemented at the time of this PR).If the response contains
captions_urland the video does not already have atrackchild, atrackelement will be appended to the video withsrcandtype.