Track"
(Track) |
m ((via JWB)) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
*Java API: <javadoc>org.zkoss.zul.Track</javadoc> | *Java API: <javadoc>org.zkoss.zul.Track</javadoc> | ||
*JavaScript API: <javadoc directory="jsdoc">zul.med.Track</javadoc> | *JavaScript API: <javadoc directory="jsdoc">zul.med.Track</javadoc> | ||
− | + | {{versionSince| 9.5.0}} | |
= Employment/Purpose = | = Employment/Purpose = | ||
− | It lets you specify some timed text tracks like captions or subtitles for media components. | + | It lets you specify some timed text tracks like captions or subtitles for media components such as [[ZK_Component_Reference/Multimedia_and_Miscellaneous/Audio | Audio]] or [[ZK_Component_Reference/Multimedia_and_Miscellaneous/Video | Video]]. |
= Example = | = Example = | ||
Line 18: | Line 18: | ||
<track kind="subtitles" src="transcript_zh.vtt" srclang="zh"/> | <track kind="subtitles" src="transcript_zh.vtt" srclang="zh"/> | ||
</video> | </video> | ||
+ | </source> | ||
+ | |||
+ | [[Image:ZKComRef_Audio_Example.png]] | ||
+ | <source lang="xml" > | ||
+ | <audio src="music.wav" controls="true"> | ||
+ | <track kind="captions" src="music_lyric.vtt" srclang="en" default="true"/> | ||
+ | <track kind="subtitles" src="music_lyric_fr.vtt" srclang="fr"/> | ||
+ | <track kind="subtitles" src="music_lyric_de.vtt" srclang="de"/> | ||
+ | <track kind="subtitles" src="music_lyric_zh.vtt" srclang="zh"/> | ||
+ | </audio> | ||
</source> | </source> | ||
Line 33: | Line 43: | ||
Specify what kind of track it is. Allowed values are: | Specify what kind of track it is. Allowed values are: | ||
− | {| | + | {| class='wikitable' | width="100%" |
! <center>Name</center> | ! <center>Name</center> | ||
! <center>Description</center> | ! <center>Description</center> | ||
Line 61: | Line 71: | ||
==Srclang== | ==Srclang== | ||
Specify what language this track is. It's required if the kind is <code>subtitles</code>. | Specify what language this track is. It's required if the kind is <code>subtitles</code>. | ||
+ | It must be a valid BCP 47 language tag. For instance, <code>fr-FR</code> and <code>en-US</code> are valid. | ||
=Supported Events= | =Supported Events= | ||
− | {| | + | {| class='wikitable' | width="100%" |
! <center>Name</center> | ! <center>Name</center> | ||
! <center>Event Type</center> | ! <center>Event Type</center> | ||
Line 76: | Line 87: | ||
=Use Cases= | =Use Cases= | ||
− | {| | + | {| class='wikitable' | width="100%" |
! Version !! Description !! Example Location | ! Version !! Description !! Example Location | ||
|- | |- | ||
Line 86: | Line 97: | ||
=Version History= | =Version History= | ||
{{LastUpdated}} | {{LastUpdated}} | ||
− | {| | + | {| class='wikitable' | width="100%" |
! Version !! Date !! Content | ! Version !! Date !! Content | ||
|- | |- | ||
| 9.5.0 | | 9.5.0 | ||
| September 2020 | | September 2020 | ||
− | | [https://tracker.zkoss.org/browse/ZK-4649 ZK-4649]: Video supports to add tracks | + | | [https://tracker.zkoss.org/browse/ZK-4648 ZK-4648]: Audio supports to add tracks |
+ | [https://tracker.zkoss.org/browse/ZK-4649 ZK-4649]: Video supports to add tracks | ||
|} | |} | ||
{{ZKComponentReferencePageFooter}} | {{ZKComponentReferencePageFooter}} |
Latest revision as of 07:50, 14 January 2022
Track
Since 9.5.0
Employment/Purpose
It lets you specify some timed text tracks like captions or subtitles for media components such as Audio or Video.
Example
<video src="course.mp4" controls="true">
<track kind="captions" src="transcript.vtt" srclang="en" default="true"/>
<track kind="subtitles" src="transcript_fr.vtt" srclang="fr"/>
<track kind="subtitles" src="transcript_de.vtt" srclang="de"/>
<track kind="subtitles" src="transcript_zh.vtt" srclang="zh"/>
</video>
<audio src="music.wav" controls="true">
<track kind="captions" src="music_lyric.vtt" srclang="en" default="true"/>
<track kind="subtitles" src="music_lyric_fr.vtt" srclang="fr"/>
<track kind="subtitles" src="music_lyric_de.vtt" srclang="de"/>
<track kind="subtitles" src="music_lyric_zh.vtt" srclang="zh"/>
</audio>
Supported Browsers
It is compatible with HTML5-supported browsers, like IE 10, Edge, Firefox, Opera, Chrome, and Safari.
Tracks don't be supported in Internet Explorer 9.
Properties
Default
Specify if the track should be used by default. It must be used on one track only.
Kind
Specify what kind of track it is. Allowed values are:
Closed subtitles. | |
Closed captions. | |
A textual description about what this video/audio is. | |
Chapter titles for users to navigate. | |
A track used by scripts. |
Label
Specify a user-readable title. Used by browsers to show on the list of available tracks.
Src
The URL of the source file. The file must be in WebVTT format. This attribute is required.
Srclang
Specify what language this track is. It's required if the kind is subtitles
.
It must be a valid BCP 47 language tag. For instance, fr-FR
and en-US
are valid.
Supported Events
None | None |
- Inherited Supported Events: XulElement
Supported Children
*NONE
Use Cases
Version | Description | Example Location |
---|---|---|
Version History
Version | Date | Content |
---|---|---|
9.5.0 | September 2020 | ZK-4648: Audio supports to add tracks
ZK-4649: Video supports to add tracks |