Home › Forums › General Issues › How to add captions to videos for ADA compliance? › Reply To: How to add captions to videos for ADA compliance?
This is what I would do if I needed to do this. (after doing a little research)
I would use a URL field for the video and not an oembed field.
I would add an additional file field to upload the captions
In my PHP code I would do
<?php
$shortcode = '[video src="'.get_field('video_url_field').'"]';
$shortcode .= '<track srclang="en" label="English" kind="subtitles" src="'.get_field('captions-file-field').'" default>';
$shortcode .= '[/video]';
echo do_shortcode($shortcode);
?>
See this https://stphnwlkr.co/web/adding-video-to-wordpress/
It might be possible to use an oembed field if you get the value without formatting so that ACF does not do the formatting of the field.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.