طريقة addTextTrack () لـ HTML Audio / Video DOM

❮ مرجع DOM الصوت / الفيديو HTML

مثال

أضف مسارًا نصيًا جديدًا إلى الفيديو:

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 ، والذي يمثل مسار النص الجديد

❮ مرجع DOM الصوت / الفيديو HTML