-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(HLS): Fix missing roles #4760
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@fredrik-telia can you add a regression test? Thanks! |
Incremental code coverage: 100.00% |
I might need some pointers, as there seems to be a test ( When using the player with a real stream, the |
I need some help understanding why this line in the function
actual (using console.log(JSON.stringify(actual)):
vs manifest (same deal using JSON.stringify):
Maybe I'm missing something? |
55ea3d9
to
4677753
Compare
4677753
to
73839c8
Compare
@theodab can you review it? Thanks! |
@avelad the issue that @fredrik-telia is pointing out looks quite serious, since that would mean the unit tests that currently exist for hls parser don't actually verify anything. It looks like whatever two objects are compared will pass the test. Should this be reported as a separate issue? |
I think so |
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.
would it make sense to also populate the kind
property now that roles
are being included?
Here's an expanded version of what you logged in "manifest" for clarity: {
"variants": [
{
"sample": {
"audio": null,
"video": {
"sample": {
"type": "video"
}
}
}
}
],
"textStreams": [
{
"sample": {
"type": "text",
"language": "en",
"kind": "subtitle",
"mimeType": "application/mp4",
"codecs": ""
}
},
{
"sample": {
"type": "text",
"language": "en",
"kind": "subtitle",
"mimeType": "application/mp4",
"codecs": "",
"roles": [
"public.accessibility.describes-spoken-dialog",
"public.accessibility.describes-music-and-sound"
]
}
}
],
"imageStreams": [],
"presentationTimeline": {},
"offlineSessionIds": [],
"minBufferTime": 0,
"sequenceMode": true
} What you're missing in the serialization through JSON is that some of those objects are not actual variants, but rather partial matchers constructed with I'll double-check the existing unit tests to make sure this partial matching is working correctly. |
Partial matching is working, but the test has a particular step that loads the relevant data: await loadAllStreamsFor(actual); This is unrealistic in this case, because it triggers lazy-loading for all streams. The only way a user would trigger a similar code path is by cycling through every text track, audio language, and resolution. So roles are only missing before lazy-loading, and every single test case triggers lazy-loading on every single track before checking expectations. I'll add a test case that fails without your fix. |
Looks like the answer is "yes". That is also missing in the regression test I'm creating. |
I added a regression test. You'll see that it's failing on two counts: missing |
I fixed two bugs in this PR:
Both of these were caught by the new test I added. |
Thank you to @fredrik-telia and @martinstark for highlighting the test issues. I'm very glad to have both the bug and the test issues fixed now! I will merge this when the test pass is complete. |
Issue wasn't caught by the existing tests. Closes #4759 Co-authored-by: Joey Parrish <joeyparrish@google.com>
Issue wasn't caught by the existing tests. Closes #4759 Co-authored-by: Joey Parrish <joeyparrish@google.com>
Issue wasn't caught by the existing tests.
Closes #4759