Comments (27)
I noticed that the "button is="google-cast-button"" does not work on Chrome for iOS.
from castvideos-chrome.
from castvideos-chrome.
Are you using the __onGCastApiAvailable callback?
from castvideos-chrome.
Yes, using this example unmodified from the master branch. Even within this callback, RemotePlayer
is undefined.
from castvideos-chrome.
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.
Thanks. We are investigating.
from castvideos-chrome.
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.
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.
from castvideos-chrome.
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.
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.
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.
@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.
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.
@protyposis : on my iPad with iOS 9.3.5 (13G36) it is working with my workaround.
from castvideos-chrome.
@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.
Yes it is working, but only because it is not using cast.framework
.
from castvideos-chrome.
@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.
This is still not working for me at all, has anyone actually gotten this to work?
from castvideos-chrome.
Seems like this is possibly related: https://stackoverflow.com/questions/26483541/referenceerror-cant-find-variable-gcrweb
from castvideos-chrome.
Ensure that you load CAF before instantiating any custom components.
from castvideos-chrome.
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.
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.
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.
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.
@lbcd well at least now we know we should not be expecting Google Cast support in Chrome for iOS.
from castvideos-chrome.
Closing issue since Chrome for iOS support is deprecated.
from castvideos-chrome.
Related Issues (20)
- Question: multiple players handling HOT 3
- [Deprecation] Errors for M73 ( March 2019 ) HOT 3
- Initialization in Vue.js
- Initialization and transmission of video stream HOT 1
- home LAN web server, self-signed cert, chromecast not work HOT 3
- issue
- integration with react(chrome cast) HOT 2
- Cast button does not show when using application id. HOT 2
- Is it working with Cordova? HOT 2
- Builtin chrome cast button casts the video HOT 1
- No re-connection on page refresh HOT 1
- Cast button doesn't appear on mobile HOT 3
- Chromebook - Fails to load - cast is not defined HOT 2
- Wish-list: Chromecast Audio example HOT 1
- Media Sample URLs using http scheme
- Detect ChromeCast available receivers in JS
- DEFAULT_MEDIA_RECEIVER_APP_ID doesn't work while C0868879 does
- [Cast Docs] Codelab HOT 1
- Cast button not showing up for Custom Receiver or Styled Media Receiver Applications HOT 2
- Googlecast not working with AES 128 encryption without IV
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from castvideos-chrome.