I'm trying to add closed captions to an amp video. However, I need to include a preroll ad, so instead of using an amp-video tag, I'm using an amp-ima-video tag: https://amp.dev/documentation/components/amp-ima-video/. The documentation says that closed captioning is supported using the track tag in the same way that normal html videos or amp videos do.
When I try using the amp-video tag, I can get closed captioning to appear, and there is button in the controls of the video to toggle the captions. However, when I use the same code, but swap out an amp-ima-video tag for the amp-video tag, the closed captions do not appear. Furthermore, the controls do not even have the ellipsis button from which the user navigates to the closed caption button when using the amp-video tag.
I've tried using similar code for video, amp-video, and amp-ima-video tags. The only difference is that the amp-ima-video tag requires a data-tag attribute that points to the ad you want to play, and this seems to be working.
This is the amp-video code, which shows captioning and a captioning button in the controls:
<amp-video controls
width="640"
height="360"
layout="responsive">
<source src="https://nbcnewsencoding.akamaized.net/nbcnews/video/2019/10/tdy_news_craig_magic_johnson_191028_1178592090.mp4">
<track default label="English" kind="subtitles" srclang="en" src="/test-captions.vtt">
<div fallback>
<p>This browser does not support the video element.</p>
</div>
</amp-video>
This is the amp-ima-video code, which does not show captioning or have a captioning button:
<amp-ima-video controls
width="640"
height="360"
layout="responsive"
data-tag="https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator=">
<source src="https://nbcnewsencoding.akamaized.net/nbcnews/video/2019/10/tdy_news_craig_magic_johnson_191028_1178592090.mp4">
<track default label="English" kind="subtitles" srclang="en" src="/test-captions.vtt">
</amp-ima-video>
The amp-ima-video does not have captions or caption controls, but it should.