-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix for #5292 - push to filterSubtitleTracks output if kind is captions #5297
fix for #5292 - push to filterSubtitleTracks output if kind is captions #5297
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onTextTrackChanged
and toggleTrackModes
depend on filterSubtitleTracks
and have test coverage.
describe('toggleTrackModes', function () { |
The issue is the tests are setup to add two subtitle tracks and no captions tracks:
const textTrack1 = videoElement.addTextTrack('subtitles', 'English', 'en');
const textTrack2 = videoElement.addTextTrack('subtitles', 'Swedish', 'se');
We should include a captions track and update the tests so that there is coverage for this issue and we don't repeat the regression in the future.
I'm not sure the best way to go about this in this repo so I just wrapped the test... I added If this is not the right way, I can revert. Like I said, not sure about what to do. |
This does get us coverage. I'm going to merge and create a patch. We can circle back to tests that cover a mix of tracks with different characteristics at a later date. |
@dstreet26 v1.3.5 is up. After merging and cherry picking I updated the tests to just include an additional captions track and test: const textTrack1 = videoElement.addTextTrack('subtitles', 'English', 'en');
const textTrack2 = videoElement.addTextTrack('subtitles', 'Swedish', 'se');
const textTrack3 = videoElement.addTextTrack(
'captions',
'Untitled CC',
'en'
);
textTrack1.groupId = 'default-text-group';
textTrack2.groupId = 'default-text-group';
textTrack3.groupId = 'default-text-group';
subtitleTrackController.groupId = 'default-text-group';
textTrack1.mode = 'disabled';
textTrack2.mode = 'disabled';
textTrack3.mode = 'disabled'; it('should set subtitleTrack if captions track is showing', function () {
expect(subtitleTrackController.subtitleTrack).to.equal(-1);
videoElement.textTracks[2].mode = 'showing';
subtitleTrackController.onTextTracksChanged();
expect(videoElement.textTracks[2].kind).to.equal('captions');
expect(subtitleTrackController.subtitleTrack).to.equal(2);
}); We should have another test that covers setting |
This PR will...
fix #5292
Are there any points in the code the reviewer needs to double check?
I did not test on Edge, which is part of the comments in filterSubtitleTracks..
So I guess just make sure this is still working on different agents/devices as originally intended?
Checklist