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

Custom UI control not working because property names get changed by minification. #2011

Closed
shvelo opened this issue Jun 24, 2019 · 3 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@shvelo
Copy link

shvelo commented Jun 24, 2019

I'm trying to make a custom UI controller, but because minification changes all the object property names in Shaka libraries, I cannot access any of them. The example in https://shaka-player-demo.appspot.com/docs/api/tutorial-ui-customization.html does not work at all because this.parent is undefined, having changed to this.l, I can't even find what this.eventManager is changed to.

Is there anything I can do besides using the uncompiled player?

@shvelo shvelo added the type: question A question from the community label Jun 24, 2019
@ismena
Copy link
Contributor

ismena commented Jun 24, 2019

Hi @shvelo
Thanks for bringing this up, I will update the tutorial!

Try adding your custom button to build/types/ui and then running build/all.py.

You can also forgo extending shaka.UI.Element if you don't need it's members and just implement shaka.extern.IUIElement like the close button does on our demo page.

@joeyparrish
Copy link
Member

You should be able to extend shaka.UI.Element and take advantage of things like this.eventManager without adding your custom button to the library. We'll take this as a bug and try to fix it in the next release. In the mean time, adding it to the library as @ismena described should be a usable workaround.
Thanks for reporting!

@joeyparrish joeyparrish added type: bug Something isn't working correctly and removed type: question A question from the community labels Jun 24, 2019
@shaka-bot shaka-bot added this to the v2.6 milestone Jun 24, 2019
@ismena
Copy link
Contributor

ismena commented Jun 25, 2019

Ok, this should be working in the latest master now even without the above workaround. Please, let us know how it goes!

shaka-bot pushed a commit that referenced this issue Jun 28, 2019
Issue #2011

Change-Id: I51c828b0457133ccee4b3f3ff2e1a33da8b3a34c
TheModMaker pushed a commit that referenced this issue Jul 3, 2019
This enables custom buttons that aren't part of the
library to be used in compiled mode.

Closes #2011

Change-Id: I500f93a86bfd2893948e594a969b6f8208836251
TheModMaker pushed a commit that referenced this issue Jul 3, 2019
Issue #2011

Change-Id: I51c828b0457133ccee4b3f3ff2e1a33da8b3a34c
AnteWall pushed a commit to AnteWall/shaka-player that referenced this issue Jul 17, 2019
This enables custom buttons that aren't part of the
library to be used in compiled mode.

Closes shaka-project#2011

Change-Id: I500f93a86bfd2893948e594a969b6f8208836251
AnteWall pushed a commit to AnteWall/shaka-player that referenced this issue Jul 17, 2019
Issue shaka-project#2011

Change-Id: I51c828b0457133ccee4b3f3ff2e1a33da8b3a34c
@shaka-project shaka-project locked and limited conversation to collaborators Aug 24, 2019
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
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 type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

4 participants