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

ChromeCast remote control #1941

Closed
bojant987 opened this issue May 15, 2019 · 5 comments
Closed

ChromeCast remote control #1941

bojant987 opened this issue May 15, 2019 · 5 comments
Labels
status: archived Archived and locked; will not be updated type: question A question from the community

Comments

@bojant987
Copy link

I'm having a tough time getting the Shaka player UI to control both local player and remote ChromeCast player.
I'm using castProxy.getPlayer() and castProxy.getVideo() for pretty much everything but UI controls are working only for local player. I can call methods manually, ie proxyVideo.pause(), etc, and it works. But i figure that it should probably work out of the box, i just can't figure out how to get it working.
Basically i instantiate CastProxy, get player and video and use them for setting up shaka and UI controls. Only place where i couldn't use proxyVideo is when instantiating shaka.ui.Overlay since it throws and error Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
So, i'm not sure whether this is the reason controls are not working for both players out of the box, or it's just not possible and should be done manually, or i'm missing something.
Any help would be appreciated.

@bojant987 bojant987 added the type: question A question from the community label May 15, 2019
@ismena
Copy link
Contributor

ismena commented May 15, 2019

Hi @bojant987

Are you using our UI with auto setup? (via data attributes in HTML)
Do you have a Chromecast receiver app?
Could you post the code sample for how you're using/accessing the UI on your receiver.

Please take a look at our demo receiver app for an example of accessing the UI.

@ismena ismena added the status: waiting on response Waiting on a response from the reporter(s) of the issue label May 15, 2019
@bojant987
Copy link
Author

I'm using your demo receiver app as a starting boilerplate, so far i just added some network request filters for license server calls, the rest is the same. So the problem shouldn't be in the receiver i guess.
As for instantiating UI, i'm not using auto setup with data attributes in HTML, i do this:
const ui = new shaka.ui.Overlay(proxyPlayer, videoContainer, localVideo); ui.configure(uiConfig);
I'm passing uiConfig with a list of controlPanelElements to render.
I can't pass proxyVideo to Overlay, it throws error i mentioned in the comment above.
I'm not sure whether controls should work for both players when used like this.
Right now i'm using my own custom UI where i call proxyVideo methods manually, so it works.
But it would be nice if default UI worked.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label May 16, 2019
@joeyparrish
Copy link
Member

Ah, I see. With the UI library, it will create the proxy for you. Try this instead:

const ui = new shaka.ui.Overlay(localPlayer, videoContainer, localVideo);
uiConfig.castReceiverAppId = 'FILL_IN_YOUR_APP_ID_HERE';
ui.configure(uiConfig);

const proxyPlayer = ui.getControls().getPlayer();

There seems to be a bug here, in that ui.getPlayer() always returns a local player. I'll get that fixed. In the mean time, ui.getControls().getPlayer() returns the proxied player as it should.

@joeyparrish
Copy link
Member

We made a change to clarify getPlayer() in ui and make it always return the proxied one. This will appear in v2.5.1. In the mean time, you can use getControls().getPlayer() to get the proxy, pass the local player to Overlay, and configure it with your app ID.

Does this answer your question?

@bojant987
Copy link
Author

Yeah, it does. Thanks for the quick response and fix.
I'll try it out later today, closing the issue now.

joeyparrish added a commit that referenced this issue May 20, 2019
The controls have the cast proxy and the proxied player, so the UI
itself offering direct access to the local player is confusing.
Instead, we will send all requests through the controls, which have
explicit getPlayer() and getLocalPlayer() methods for access to the
proxied and local players.

Closes #1941

Change-Id: I1d6154d76b1b3b5b550e55e39efcbb2c451f7569
@shaka-project shaka-project locked and limited conversation to collaborators Jul 16, 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: question A question from the community
Projects
None yet
Development

No branches or pull requests

4 participants