Since the TextTrack
is added to the videoElement
, your best bet would have been with the videoElement.captureStream()
method, but it currently doesn't incorporate the TextTracks.
Specs about Media Capture from DOM Elements only states that,
Both MediaStream and HTMLMediaElement expose the concept of a "track". Since there is no common type used for HTMLMediaElement, this document uses the term track to refer to either VideoTrack or AudioTrack.
So we can just say that it doesn't speak about TextTracks...
MediaStream.addTrack
can only handle MediaStreamTracks so it's a no-go too.
This unfortunately leads to a nope.
(At least currently - specs may add it in the future, and I guess you can open an issue here about it).
A small playground