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

Feat/ui custom castproxy #2464

Closed

Conversation

tecteun
Copy link

@tecteun tecteun commented Mar 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!

@googlebot
Copy link

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).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@joeyparrish
Copy link
Member

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?

@tecteun
Copy link
Author

tecteun commented Mar 20, 2020

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.
The main goal for this custom CastProxy is to be able to use a different Chromecast receiver implementation, using the default Shaka build.

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.

@joeyparrish
Copy link
Member

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 @@

Copy link
Member

Choose a reason for hiding this comment

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

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} */
Copy link
Member

Choose a reason for hiding this comment

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

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']()) {
Copy link
Member

Choose a reason for hiding this comment

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

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']();
Copy link
Member

Choose a reason for hiding this comment

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

Same here. Try reverting these changes once the externs are fixed.

@@ -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) {
Copy link
Member

Choose a reason for hiding this comment

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

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?

@tecteun tecteun force-pushed the feat/ui-custom-castproxy branch from 4629f54 to c356903 Compare April 20, 2020 14:00
@tecteun tecteun force-pushed the feat/ui-custom-castproxy branch from 9ae6a64 to 9f7f537 Compare April 20, 2020 14:47
@joeyparrish
Copy link
Member

I've just noticed that you're developing against the v2.5.x branch. We normally only accept PRs against master. Cherry-picks to a release branch are always done by the team after carefully considering the risk of a change and any backward-compatibility issues it might create. This does not seem like something we would cherry-pick to an older branch.

If you'd like to continue this PR, please rebase against master and address the feedback you've received so far. Thanks!

@tecteun
Copy link
Author

tecteun commented Apr 20, 2020

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 ;)

@joeyparrish
Copy link
Member

No worries! We understand, and there's no urgency from our perspective.

@tecteun tecteun force-pushed the feat/ui-custom-castproxy branch 3 times, most recently from b43a60c to af66d00 Compare April 22, 2020 12:21
@googlebot
Copy link

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.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@tecteun tecteun force-pushed the feat/ui-custom-castproxy branch from 0d369eb to af66d00 Compare July 21, 2020 15:42
@avelad
Copy link
Member

avelad commented May 18, 2022

Soon, we are going to work on #4214 so for now I don't think we're going to add this. If you have any suggestion tell me.

@avelad avelad closed this May 18, 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.

4 participants