-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subtitles only seem to work if native text tracks are supported #99
Comments
My fork is based on v1.0.10 Even with those two pull requests, I don't know if it would fix the issue. When I look at the current master branch, I see the following for the function _updateSelectedTextTrack() {
var playerTextTracks = _player.textTracks();
var activeTrack = null;
for (var j = 0; j < playerTextTracks.length; j++) {
if (playerTextTracks[j].mode === 'showing') {
activeTrack = playerTextTracks[j];
break;
}
}
var hlsjsTracks = _video.textTracks;
for (var k = 0; k < hlsjsTracks.length; k++) {
if (hlsjsTracks[k].kind === 'subtitles' || hlsjsTracks[k].kind === 'captions') {
hlsjsTracks[k].mode = activeTrack && _isSameTextTrack(hlsjsTracks[k], activeTrack) ? 'showing' : 'disabled';
}
}
} The key line here is: var hlsjsTracks = _video.textTracks; This implies that I've further seen that because HLS.js is not aware of VideoJS and it attempts to set the text track on the media element itself, this caused errors in Firefox (whose if (!this.player.tech_.featuresNativeTextTracks)
{
data.media.addTextTrack = (type, name, lang) => this.player.addTextTrack(type, name, lang);
} |
AFAIK the only "proper" solution here is to adapt Hls.js cue/text track handling to have it interact directly with Anyway if you have any good and robust way to hook Hls.js text track handling (which you see in #85 may even comes up mid-stream, a.k.a CC tracks) to |
VideoJS provides a
_player.addTextTrack()
method for devices and browsers which lack native text track support. When this method is utilized,_player.textTracks()
will return a list of tracks, but_video.textTracks()
will not return anything. This prevents_updateSelectedTextTrack
from properly setting the track to "showing", and subtitles never displayIn my fork I was able to fix this like so:
Furthermore I replaced all instances of
_video.textTracks
with_player.textTracks()
(which negated most of the_updateTextTrackList()
method, as it was now comparing a list to itself)The text was updated successfully, but these errors were encountered: