Giter Club home page Giter Club logo

Comments (27)

ibz096 avatar ibz096 commented on September 2, 2024 1

I noticed that the "button is="google-cast-button"" does not work on Chrome for iOS.

from castvideos-chrome.

lbcd avatar lbcd commented on September 2, 2024 1

Incredible => https://bugs.chromium.org/p/chromium/issues/detail?id=872050&q=ios%20chromecast&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified

from castvideos-chrome.

NoRulesJustFeels avatar NoRulesJustFeels commented on September 2, 2024

Are you using the __onGCastApiAvailable callback?

from castvideos-chrome.

protyposis avatar protyposis commented on September 2, 2024

Yes, using this example unmodified from the master branch. Even within this callback, RemotePlayer is undefined.

from castvideos-chrome.

protyposis avatar protyposis commented on September 2, 2024

Some additional information on this issue. In lack of a debug bridge on iOS, I changed the __onGCastApiAvailable callback to output the members of the cast.framework namespace like this:

window['__onGCastApiAvailable'] = function(isAvailable) {
  if (isAvailable) {
    for (var member in cast.framework) {
      document.getElementById('carousel').innerHTML += '<br>' + member;
    }
    castPlayer.initializeCastPlayer();
  }
};

Here's the results:

Android 7.1.1 / Chrome 55.0.2883.91
Windows 10 / Chrome 55.0.2883.87

VERSION
LoggerLevel
CastState
SessionState
CastContextEventType
SessionEventType
RemotePlayerEventType
ActiveInputState
setLoggerLevel
EventData
ApplicationMetadata
ApplicationStatusEventData
ApplicationMetadataEventData
ActiveInputStateEventData
MediaSessionEventData
VolumeEventData
CastSession
CastStateEventData
SessionStateEventData
CastOptions
CastContext
RemotePlayer
RemotePlayerChangedEvent
RemotePlayerController

iPhone 6 / iOS 9.3.4 / Chrome 55.0.2883.79
iPhone 7 / iOS 10.2 / Chrome 55.0.2883.79
iPad Air 2 / iOS 10.0.2 / Chrome 54.0.2840.66

VERSION
LoggerLevel
CastState
SessionState
CastContextEventType
SessionEventType
RemotePlayerEventType
ActiveInputState
setLoggerLevel
EventData
ApplicationMetadata
ApplicationStatusEventData
ApplicationMetadataEventData
ActiveInputStateEventData
MediaSessionEventData
VolumeEventData
CastSession
CastStateEventData
SessionStateEventData
CastOptions
CastContext

RemotePlayer, RemotePlayerChangedEvent, and RemotePlayerController are missing on iOS.

All of the above have isAvailable set to true. The exception is another iPad Air 2 / iOS 10.2 / Chrome 55.0.2883.79, where isAvailable is false for unknown reasons.

from castvideos-chrome.

NoRulesJustFeels avatar NoRulesJustFeels commented on September 2, 2024

Thanks. We are investigating.

from castvideos-chrome.

iaco79 avatar iaco79 commented on September 2, 2024

Button is="google-cast-button" also doesn't work on windows Chrome "56.0.2924.87", so the user will always need to push the cast button next to the address bar I assume?

from castvideos-chrome.

ibz096 avatar ibz096 commented on September 2, 2024

The "google-cast-button" works fine on Chrome "56.0.2924.87. From what i experienced the button does not appear unless a chromecast device is on and discovered. But from what you are saying the button does not work at all.

from castvideos-chrome.

radiantmediaplayer avatar radiantmediaplayer commented on September 2, 2024

#2

from castvideos-chrome.

kslimani avatar kslimani commented on September 2, 2024

Does someone has a clue how YouTube is technically able to do that ? (on m.youtube.com they display cast icon on top menu bar) It seems they found a workaround for Chrome on iOS device.

from castvideos-chrome.

kslimani avatar kslimani commented on September 2, 2024

After doing more tests, it seems that window['__onGCastApiAvailable'] is broken on Chrome iOS.

Results of my tests is with Chrome browser on some iOS devices, the window.chrome property may not be immediately available.

A workaround is to use a simple setTimeout loop to wait for window.chrome to be available. Then simply check for window.chrome.cast etc...

EDIT: added more explanations.

from castvideos-chrome.

protyposis avatar protyposis commented on September 2, 2024

Gave it another try today and it's now working on all my iOS 10 devices :) Just listening to __onGCastApiAvailable, no timeout workaround. Still not working on iOS 9.

from castvideos-chrome.

kslimani avatar kslimani commented on September 2, 2024

@protyposis i don't think that listening only on __onGCastApiAvailable is enough. In the meantime that Google fix the bug, i recommand to use the workaround i described (for me it work on any iOS device with Chome browser with Cast support).

Take a look at this piece of code.

from castvideos-chrome.

protyposis avatar protyposis commented on September 2, 2024

I can only speak from my own experience because I just ran the tests, and that is that listening for __onGCastApiAvailable is enough.

Yes, window.chrome is not immediately available, but that's what the callback is for. It gets called once it becomes available. The original issue was that only part of the cast.framework namespace was available when the callback was called; that is now fixed on iOS 10, but not on iOS 9. On iOS 9, the RemotePlayer is still missing, no matter how long I wait and how often I try.

from castvideos-chrome.

kslimani avatar kslimani commented on September 2, 2024

@protyposis : on my iPad with iOS 9.3.5 (13G36) it is working with my workaround.

from castvideos-chrome.

kslimani avatar kslimani commented on September 2, 2024

@protyposis could you please try the following :

Clone this exemple and edit the index.html file to add this button (for example, before the "Lauch app" button) :

<button onclick="initializeCastApi()">Init API</button>

Then serve the page using a local http server and try init the api by click on button, then launch app, load media and play.

Tell me if it is working with your iOS 9 device ?

from castvideos-chrome.

protyposis avatar protyposis commented on September 2, 2024

Yes it is working, but only because it is not using cast.framework.

from castvideos-chrome.

kslimani avatar kslimani commented on September 2, 2024

@protyposis you are correct. I did not make tests with cast.framework. The workaround seems to fix only if using low level api.

from castvideos-chrome.

perlambaek avatar perlambaek commented on September 2, 2024

This is still not working for me at all, has anyone actually gotten this to work?

from castvideos-chrome.

jpellizzari avatar jpellizzari commented on September 2, 2024

Seems like this is possibly related: https://stackoverflow.com/questions/26483541/referenceerror-cant-find-variable-gcrweb

from castvideos-chrome.

NoRulesJustFeels avatar NoRulesJustFeels commented on September 2, 2024

Ensure that you load CAF before instantiating any custom components.

from castvideos-chrome.

stkrzysiak avatar stkrzysiak commented on September 2, 2024

This is still an issue, I immediately see Uncaught ReferenceError: cast is not defined a bit frustrating.
Edit: This issue happens when you open index.html w/ chrome. Throw a web server in front of it and access it that way and everything works fine.

from castvideos-chrome.

lbcd avatar lbcd commented on September 2, 2024

Hello it doesn't work for me. ChromeCast button just not appear.
Chrome version : 69.0.3497.91
Work fine on a PC but not on a iPad with Chrome for both.

from castvideos-chrome.

lbcd avatar lbcd commented on September 2, 2024

Update this message on the next day it doesn't work anymore....

In fact you can cast if you change in index.html that

            <script type="text/javascript">
                var castPlayer = new CastPlayer();
                //window['__onGCastApiAvailable'] = function(isAvailable) {
                //    if (isAvailable) {
                        setTimeout(
                            function () { castPlayer.initializeCastPlayer();},
                            1000
                        ) ;
                //    }
                //};
            </script>

But button is not displayed just a black placeholder. And especially you can control anything by play / pause...
And of course it's an ugly way to have it working.

from castvideos-chrome.

lbcd avatar lbcd commented on September 2, 2024

I going to become crazy with this bug. It seems that chrome 69 have a bug about that. I tried to implement CAF directly : https://developers.google.com/cast/docs/chrome_sender_integrate it works on Chrome computer but not on Chrome iOS.

I have logged cast.framework.CastContext.getInstance().getCastState() it is NOT_CONNECTED or CONNECTED when playing on the chromecast on a computer.
It stays to NO_DEVICE_AVAILABLE on Chrome on iOS.

I tried to go on website with ChromeCast on their player but none of then diplay ChromeCast button.

Hope Google will fix this issue quickly.

from castvideos-chrome.

radiantmediaplayer avatar radiantmediaplayer commented on September 2, 2024

@lbcd well at least now we know we should not be expecting Google Cast support in Chrome for iOS.

from castvideos-chrome.

jtromo avatar jtromo commented on September 2, 2024

Closing issue since Chrome for iOS support is deprecated.

from castvideos-chrome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.