Html5-video tags and subtitles

Source: Internet
Author: User

<VideoID= "Mainvideo"src= "Video.mp4"type= "Video/mp4"controls AutoPlay Loop> < Tracksrc= "EN_TRACK.VTT"Srclang= "en"label= "中文版"Kind= "caption"default> < Tracksrc= "CN_TRACK.VTT"Srclang= "ZH-CN"label= "Simplified Chinese"Kind= "caption"> </Video>

Or

<video width= "640" height= "480" controls>    <source src= "Video.mp4" type= "Video/mp4"/>    <source Src= "VIDEO.WEBM" type= "VIDEO/WEBM"/>    <track src= "SUBTITLES.VTT" kind= "subtitles" srclang= "en" label= " 中文版 "/>    </video>  

  

There are 4 main properties of the track label, such as the following table:

Properties Description

Kind

Define the caption content type, which can only be one of these five: subtitles, captions, descriptions, chapters, metadata .

Src

The URL address of the subtitle file

Srclang

The language type of the subtitle file, the role of the identity information, the player does not use this property.

Label

Subtitle labels, each subtitle element must have a unique, non-repeating label that displays the name when switching subtitles.

Default

Specifies whether it is the default caption. If none is specified, the caption will not be automatically displayed.

Some notes about attributes:
• If no type is specified, the default is caption (Subtitles).
• If the type is a caption (subtitles), you need to specify Srclang.
• Cannot have two tracks of the same type (King) with the same label (label)

The MIME-type convention for WEBVTT subtitle files is "TEXT/VTT" and needs to be configured in a Web server such as IIS or Apache

The MIME type convention for ttml subtitle files is application/ttml+xml

Html5-video tags and subtitles

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.