Skip to content
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

fix(playback-watcher): ignore subtitles #980

Merged
merged 2 commits into from
Oct 30, 2020
Merged

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Oct 26, 2020

It's possible that a subtitle track will have segments without any text
in them depending on how the subtitles and captions were created.
Therefor, we should ignore it in the playback-watcher where we're
checking for excessive downloads.

It's possible that a subtitle track will have segments without any text
in them depending on how the subtitles and captions where created.
Therefor, we should ignore it in the playback-watcher were we're
checking for excessive downloads.
@@ -219,18 +218,6 @@ export default class PlaybackWatcher {
this.resetSegmentDownloads_(type);
this.tech_.trigger({type: 'usage', name: `vhs-${type}-download-exclusion`});

if (type === 'subtitle') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think by removing this we will still try to blacklist subtitle tracks when we don't have subtitles in the segments. Should we just return early for subtitles tracks, or, in loaderTypes above, remove subtitles?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, we'll still try to exclude it but at least it won't be removed. Yeah, exiting early here when it's of type subtitle sounds good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to return here but not remove the track.

this.setup();
const loader = this.mpc[`${type}SegmentLoader_`];
const track = {label: 'foobar', mode: 'showing'};
if (type !== 'subtitle') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps we should just return in here if type === 'subtitle' would keep the changes down. LGTM otherwise.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that but it didn't seem to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems strange. It wouldn't execute for other loader types of returning early on subtitles?

@gkatsev gkatsev merged commit 8987194 into 2.2.x Oct 30, 2020
gkatsev added a commit that referenced this pull request Oct 30, 2020
It's possible that a subtitle track will have segments without any text
in them depending on how the subtitles and captions were created.
Therefor, we should ignore it in the playback-watcher where we're
checking for excessive downloads.
Copy link
Contributor

@gesinger gesinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review, just catching up.

this.setup();
const loader = this.mpc[`${type}SegmentLoader_`];
const track = {label: 'foobar', mode: 'showing'};
if (type !== 'subtitle') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems strange. It wouldn't execute for other loader types of returning early on subtitles?

loader.track = () => track;
sinon.stub(this.player.tech_.textTracks(), 'removeTrack');
}
if (type === 'subtitle') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this past be removed because we return early on subtitles?

expectedUsage['vhs-rendition-blacklisted'] = 1;
expectedUsage['hls-rendition-blacklisted'] = 1;
}
if (type !== 'subtitle') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conditional probably can be removed.


if (type !== 'subtitle') {
const message = 'Playback cannot continue. No available working or supported playlists.';
if (type !== 'subtitle') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conditional probably can be removed, and the else as well.

@@ -220,14 +219,6 @@ export default class PlaybackWatcher {
this.tech_.trigger({type: 'usage', name: `vhs-${type}-download-exclusion`});

if (type === 'subtitle') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth having a comment here. Something like // subtitles aren't guaranteed to be present for every bit of video, therefore, we can't determine whether downloads have stalled based on the subtitle's buffer

@gkatsev gkatsev deleted the subs-playback-watcher branch November 2, 2020 22:16
gkatsev added a commit that referenced this pull request Nov 2, 2020
Updates based on late comments from #980.
gkatsev added a commit that referenced this pull request Nov 3, 2020
Updates based on late comments from #980.
gkatsev added a commit that referenced this pull request Nov 3, 2020
Updates based on late comments from #980.
evanfarina pushed a commit to evanfarina/http-streaming that referenced this pull request Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants