Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFeat/ui custom castproxy #2464
Feat/ui custom castproxy #2464
Conversation
googlebot
commented
Mar 20, 2020
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
|
|
I have some technical feedback around what looks like some compiler issues, but first let's discuss your goals with this change. What are the main goals of a custom CastProxy? |
|
I have a project where I would like to use the stock ui, with some minor modifications. One of the modifications being the Chromecast sender implementation. I now can use a custom CastProxy sender implementation, using CAF v3 api's. This works fine for me, using this additional argument for shaka.ui.Overlay. Though, I'm struggling a bit on how to make closure compiler cope with this externally defined castproxy, and make it a good general addition to the project. |
|
Yeah, the compiler is difficult sometimes. I'll leave you some specific technical feedback on the changes about the compiler. Hopefully we'll be able to help you resolve that. I'm open to this change generally, but I wonder if you'd be willing to share your CAF v3 implementation with us as well. Does it use CAF on the sender side instead of the older Cast SDK? Does it still expect Shaka Player on the receiver side, or does it use the CAF default receiver? |
| @@ -0,0 +1,56 @@ | |||
|
|
|||
This comment has been minimized.
This comment has been minimized.
joeyparrish
Mar 20, 2020
Member
When you define externs, you need to have a block comment containing @externs at the top. Please copy the copyright header and @externs block comment from another extern file.
Without that, this file will not be seen as an "external" interface from the environment, and pieces of the implementation can still be renamed and inlined. I see you are using ['foo'] style to avoid renaming, but inlining can't be defeated in this way.
When you fix the externs header, you should see those issues go away.
| @@ -39,7 +39,7 @@ shaka.ui.CastButton = class extends shaka.ui.Element { | |||
| constructor(parent, controls) { | |||
| super(parent, controls); | |||
|
|
|||
| /** @private {shaka.cast.CastProxy} */ | |||
| /** @private {shaka.cast.CastProxy|shaka.extern.CastProxy} */ | |||
This comment has been minimized.
This comment has been minimized.
joeyparrish
Mar 20, 2020
Member
Since shaka.cast.CastProxy is an implementation of shaka.extern.CastProxy, you should just use the base type here.
| @@ -94,12 +94,12 @@ shaka.ui.CastButton = class extends shaka.ui.Element { | |||
|
|
|||
| /** @private */ | |||
| async onCastClick_() { | |||
| if (this.castProxy_.isCasting()) { | |||
| this.castProxy_.suggestDisconnect(); | |||
| if (this.castProxy_['isCasting']()) { | |||
This comment has been minimized.
This comment has been minimized.
joeyparrish
Mar 20, 2020
Member
I believe these changes to bracket notation can all be reverted once you fix the externs file.
| video, player, this.config_.castReceiverAppId); | ||
|
|
||
| /** @private {boolean} */ | ||
| this.castAllowed_ = true; | ||
|
|
||
| /** @private {HTMLMediaElement} */ | ||
| this.video_ = this.castProxy_.getVideo(); | ||
| this.video_ = this.castProxy_['getVideo'](); |
This comment has been minimized.
This comment has been minimized.
| @@ -675,11 +676,15 @@ shaka.ui.Controls.prototype.addControlsContainer_ = function() { | |||
| this.videoContainer_.appendChild(this.controlsContainer_); | |||
|
|
|||
| this.eventManager_.listen(this.controlsContainer_, 'touchstart', (e) => { | |||
| this.onContainerTouch_(e); | |||
| if (!e.defaultPrevented) { | |||
This comment has been minimized.
This comment has been minimized.
joeyparrish
Mar 20, 2020
Member
This looks like it's probably a useful change independent of the Cast changes. What's the use case? Would you be willing to split that into a separate PR?
4629f54
to
c356903
9ae6a64
to
9f7f537
|
I've just noticed that you're developing against the If you'd like to continue this PR, please rebase against |
|
Thanks for the explanation, I'll probably handle this rebase and changes the coming week! I couldn't find any time to finish this MR due to the unexpected chain of events. My productivity plummeted, because, you know, kids ;) |
|
No worries! We understand, and there's no urgency from our perspective. |
b43a60c
to
af66d00
googlebot
commented
Apr 22, 2020
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
0d369eb
to
af66d00

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

tecteun commentedMar 20, 2020
This is an attempt at extending ui/ui.js with an optional external castProxy class.
there are still some open ends, but to start the discussion I started this pull request.
If there are any good idea's on how this should better be implemented, I love to hear them!