The Wayback Machine - https://web.archive.org/web/20200915050929/https://github.com/google/shaka-player/pull/2464
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

Open
wants to merge 9 commits into
base: v2.5.x
from
Open

Conversation

@tecteun
Copy link

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!

Teun van Roovert added 2 commits Mar 13, 2020
@googlebot
Copy link

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

📝 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

joeyparrish commented Mar 20, 2020

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

joeyparrish commented Mar 20, 2020

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.

@joeyparrish

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.

@joeyparrish

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.

@joeyparrish

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.

@joeyparrish

joeyparrish Mar 20, 2020

Member

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

This comment has been minimized.

@joeyparrish

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?

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

joeyparrish commented Apr 20, 2020

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

joeyparrish commented Apr 20, 2020

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

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

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.
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 tecteun:feat/ui-custom-castproxy branch from 0d369eb to af66d00 Jul 21, 2020
tecteun added 3 commits Jul 21, 2020
… calls, in case of chromecast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.