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 thumbnails issues #3858

Merged
merged 4 commits into from Jan 13, 2022
Merged

Fix thumbnails issues #3858

merged 4 commits into from Jan 13, 2022

Conversation

avelad
Copy link
Collaborator

@avelad avelad commented Jan 13, 2022

The commit 264c842 introduce 2 issues:

  • stream.segmentIndex is not always constructed (eg: DASH)
  • In Image track the size of the thumbnail itself is returned and not the size of the complete image, so it is necessary to return the size of the complete image in getThumbnails so that later the UI can correctly place the image if the layout is different to 1x1.

@avelad
Copy link
Collaborator Author

avelad commented Jan 13, 2022

@theodab can you review?

@joeyparrish
Copy link
Member

Why do we need imageHeight and imageWidth? Isn't height/width and offset x, y enough?

@avelad
Copy link
Collaborator Author

avelad commented Jan 13, 2022

@joeyparrish , we need the imageHeight and imageWidth because the thumbnail height/width and the offset don't allow us calculate the full image size. Also before the commit 264c842 the getImageTracks returned the full image size.

@joeyparrish
Copy link
Member

I see that it doesn't allow you to compute the full image size, but if you only need to display a single thumbnail, I don't understand why you need the full image size in the first place. I'm not against providing it, but I want to understand the purpose.

@avelad
Copy link
Collaborator Author

avelad commented Jan 13, 2022

@joeyparrish
If the layout is 1x1, I don't need this information, because the size of the full image and the thumbnail is the same.
If the layout is different of1x1, I want to paint a thumbnail of AxB in a 640x360 rectangle, but the image size is CxD (different from 640x260), so I need to know the scale to be able to adjust the measurements, and crop the full image to show only the specific thumbnail. (see #3371 (comment))

@avelad
Copy link
Collaborator Author

avelad commented Jan 13, 2022

I am seeing that this PR has not fired github action, why? 😮

@joeyparrish
Copy link
Member

I'm not sure why. We have only very recently deployed a GitHub Actions workflow, so I'm sure we will still be surprised and have more to learn. I'll look into it now.

@joeyparrish
Copy link
Member

I can't find any reason for the PR workflow to be skipped. I also can't find any way to trigger it in a way that is linked to this PR. I was able to trigger it manually to run against your commit, but it isn't linked back to this PR. I'm going to try closing and re-opening the PR to see if that triggers the workflow.

@joeyparrish joeyparrish reopened this Jan 13, 2022
@joeyparrish
Copy link
Member

That seems to have worked. I'm really not sure why it didn't work correctly the first time. I'll double-check our workflow triggers for mistakes.

@avelad
Copy link
Collaborator Author

avelad commented Jan 13, 2022

Copy link
Collaborator

@theodab theodab left a comment

Choose a reason for hiding this comment

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

I was going to suggest an alternative approach, which involved making Player.getImageTracks async so that we can create the segment index if necessary.

However, you are right that the segment references are only assigned tilesLayout values by the HLS parser, at the moment. So changing the interface so that we guaranteed can check the segment references would be future-proofing, at best. Probably not worth the hassle of changing our public interface over.

Given that, I think that your approach here is probably ideal.

lib/util/stream_utils.js Show resolved Hide resolved
externs/shaka/player.js Outdated Show resolved Hide resolved
@avelad
Copy link
Collaborator Author

avelad commented Jan 13, 2022

@theodab I do not agree to do Player.getImageTracks async, that would be a breaking change and it should go in 4.0, since we are doing a fix of an existing functionality, we should not change Player.getImageTracks so that it returns a promise.

@avelad avelad requested a review from theodab January 13, 2022 20:00
Copy link
Collaborator

@theodab theodab left a comment

Choose a reason for hiding this comment

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

Oh, I guess it needs to be:

tilesLayout: layout || null,

Since the stream's tilesLayout is string|undefined, not ?string.

@avelad
Copy link
Collaborator Author

avelad commented Jan 13, 2022

Fixed, I used my iPad for the commit instead of turning on the mac ... sorry

@theodab theodab merged commit 087a9b4 into shaka-project:master Jan 13, 2022
@avelad avelad deleted the thumbnails-issue branch January 14, 2022 06:33
@joeyparrish
Copy link
Member

joeyparrish commented Jan 14, 2022

@theodab, sorry for re-requesting your review here. The page was not refreshed, and you had already approved and merged it. Please disregard.

joeyparrish pushed a commit that referenced this pull request Jan 28, 2022
joeyparrish pushed a commit that referenced this pull request Jan 28, 2022
dvoracek-slub pushed a commit to dvoracek-slub/slub_web_sachsendigital that referenced this pull request Mar 11, 2022
@avelad avelad added this to the v4.0 milestone May 4, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants