HTML 오디오/비디오 DOM addTextTrack() 메서드

❮ HTML 오디오/비디오 DOM 참조

예시

비디오에 새 텍스트 트랙 추가:

var text1 = myVid.addTextTrack("caption");
text1.addCue(new TextTrackCue("Test text", 01.000, 04.000, "", "", "", true));

정의 및 사용

addTextTrack() 메서드는 새 TextTrack 개체를 만들고 반환합니다.

새 TextTrack 개체가 오디오/비디오 요소의 텍스트 트랙 목록에 추가됩니다.


브라우저 지원

Method
addTextTrack() Not supported Not supported Not supported Not supported Not supported

통사론

audio|video.addTextTrack(kind,label,language)

매개변수 값

Value Description
kind Specifies the kind of text track.

Possible values:

  • "subtitles"
  • "caption"
  • "descriptions"
  • "chapters"
  •  "metadata"
label A string specifying the label for the text track. Is used to identify the text track for the users
language A two-letter language code that specifies the language of the text track.
To view all available language codes, go to our Language code reference

기술적 세부 사항

반환 값: 새 텍스트 트랙을 나타내는 TextTrack 개체

❮ HTML 오디오/비디오 DOM 참조