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

Support for iframe #79

Open
fpauk opened this issue Jan 29, 2021 · 5 comments
Open

Support for iframe #79

fpauk opened this issue Jan 29, 2021 · 5 comments

Comments

@fpauk
Copy link

fpauk commented Jan 29, 2021

Hi there

Is there a way getting this to work in an iframe?

Regards
Flemming

@Lindsay-Needs-Sleep
Copy link
Collaborator

If you mean, your cordova app uses an iframe, and you want the iframe to be able to control the chromecast....

Probably?

2 potential ways:

  1. You would need to get the cordova libs injected into the iframe (so that it can access window.cordova (it should have access to the chrome.cast object as well. (Not totally sure if there are any webview permissions or things with cordova that prevent iframes from triggering native calls. Could check around and see if anyone has done any native calls for an cordova plugin from an iframe.)

  2. This should definitely work, but it is a lot more work probably. Establish a messaging system between your iframe and the iframe container. The iframe can tell the container what commands it wants executed regarding the chromecast controls. (I haven't done much playing with messaging between and iframe and container, but I believe this should work.)

@Arthurferrera
Copy link

Hello, any updates on this case? I have the same doubt.

I'm trying to broadcast a video that is implemented with an iframe, but I still don't know a solution for that.

Thanks.

@Lindsay-Needs-Sleep
Copy link
Collaborator

Sorry, I would need more details to hazard a guess.

@Arthurferrera
Copy link

Arthurferrera commented Mar 12, 2021

Okay, look at my code

I have an iframe like this:

<iframe [src]="link" style="top: 0;" allowfullscreen></iframe>

In it is used a generic link and not a link with extension .mp4 or .m3u8, in the header of this screen I have a button that takes the iframe link and sends it to the chromecast, but does not load the video.

Link example: https://player.com/?mediaId=123&share=false

This link is not functional, it is just to show the existing attributes.

@Lindsay-Needs-Sleep
Copy link
Collaborator

Lindsay-Needs-Sleep commented Mar 12, 2021

(I might be wrong so please forgive me...)

If you are trying to cast that url....

  • You are not casting a video directly (I believe)
  • You are wanting to cast a url
    • aka. the chromecast will display the webpage to be found at that url, which is probably a full screen video I'm guessing?

You could look at the DeMille/url-cast-reciever talked about in this issue: #78

This issue might also be of interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants