Adding subtitles to video videos in HTML5 (WebVTT)

Source: Internet
Author: User

Although the HTML5 formal standard does not specify which format to use subtitles. But at present the comparison general is the WEBVTT (suffix. vtt), this each browser manufacturer all supports is relatively good.



Examples of 1,WEBVTT files

Webvtt

00:00:01.000--> 00:00:10.000
This is the first line of text, from 1th seconds to 10th seconds.

00:00:15.000--> 00:00:20.000
This is the second line of text, Welcome to Www.111cn.net
2, using the sample
(1) If there are more than one language subtitles can add multiple <track>, for users to switch to select
(2) The <track> that is marked as default is the caption that is used by defaults. If you do not use any subtitles by default, you do not set default.

<video controls Width= "height=" >
<source src= ". /hangge.mp4 "type=" Video/mp4 ">
<track src= "hangge.vtt" srclang= "en" kind= "subtitles" label= "Chinese" default>
<track src= "hangge_en.vtt" srclang= "en" kind= "subtitles" label= "中文版" >
</video>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.