How to use <span> or <p> to display video subtitles - html

I was wondering how I could possibly use <span> or <p> tag to display video subtitle text (.vtt / .srt) in a <video> tag in HTML?
I have searched all over the internet but couldn't find solution.
I want to use a captioning system similar to that YouTube has, I also tried reverse-engineering a YouTube video page via inspect element but still no luck.
Any help is highly appreciated, thanks!

The <track> tag specifies text tracks for or elements.
This element is used to specify subtitles, caption files or other files containing text, that should be visible when the media is playing.
Tracks are formatted in WebVTT format (.vtt files).

Related

What is the purpose of using the embed tag in html?

I want to know what's embed tag is used for?
from W3SCHOOL :
The tag defines a container for an external resource, such as a web page, a picture, a media player, or a plug-in application
I'm confused about external resource
I mean what is external resource?
The external resource is an address that you receive your media. e.g src of an image, a text HTML, a video, etc. But as said in : https://www.w3schools.com/tags/tag_embed.asp
Suggestion
To display a picture, it is better to use the <img> tag.
To display HTML, it is better to use the <iframe> tag.
To display video or audio, it is better to use the <video> and <audio> tags.

Making a video element with no sound accessible

I am currently working on a web page with a silent video banner.
I am using the aXe Chrome browser plugin that highlights potential accessibility issues with the content of the page and it's throwing two issues related accessibility for the video element:
Ensure <video> elements have captions
Ensure <video> elements have audio descriptions
I just wanted to know if there are any recommendations in communicating that the video element has no audio in an accessible way.
video accessibility has two concerns : captions for replacing sound, and audio decription (or textual alternatives) for describing the images.
The fact that your video is silent does not mean that you do not need a textual description of what appears in the video.
In your case, I would look at the attribute controls="muted" which can be an hint for indicating assistive technologies that a video does not have currently any sound.
I will choose between one of the following:
a) I will set the aria-describedby attribute on the video element to point to the div containing the description.
b) OR If your video is only decorative, then I would set the aria-hidden=true attribute on a parent element

Is it possible to move an HTML5 video CC under the video?

A client wants the subtitles out of the way of the video, so they want it underneath the video. We are using vtt files for our captions. Can this be done in CSS? Maybe some settings in the vtt file?
short answer... no.
longer answer... you could parse the vtt and manually display the captions outside the <video> tag, there are a few JS libraries out there to do this (eg Mozilla have a very thorough implementation, though depending on your captions you may be able to get away with something a lot more lightweight)

Is it possible to use ttml or vtt with the html 5 audio element?

Using the display vtt or ttml as a track element with the html 5 audio tag without the use of javascript? I.E. is there a way to display the vtt or ttml as closed cationioning in the audio tag? I'm trying to display podcast transcripts, just fyi.
According to MDN, any track elements inside an audio element are ignored. Apparently since there is no visual area on an audio element like there is on video, there is no way to display it. The suggestion I found was to just use a video element -- you can pass it an audio file and it will play it. You then just use CSS to size the element as needed, and to style the audio cues.

place an alt tag for a flash image

Hi
I have a flash file. Which contain images. I want to place an ALT tag for the animated flash. Is it possible to place an ALT tag for flash?
Please give me a solution
Thanks in advance
Alternative content for objects (for when they fail to load) goes between <object> and </object>.
If the Flash does load, then any alternative content needs to be exposed to accessibility APIs from inside the Flash object. Screen readers, braille displays, etc can then access it.
WebAIM has a guide to making Flash content as accessible as possible.