问题
I have a webpage that uses the iframe Youtube player api. I'd like to give the user the ability to Chromecast the currently loaded Youtube video.
I've been looking through the Chromecast sender guide. I'm only seeing how to get the session and receiver objects if the user first calls the chrome.cast.requestSession(onRequestSessionSuccess, onLaunchError) function by clicking a button that I create on the page.
Is there a way to get the session and receiver objects if they clicked on the Youtube player/Chrome extension button to connect to a device, and not the button I provide?
Thanks!
来源:https://stackoverflow.com/questions/24939094/is-it-possible-to-listen-for-when-the-chromecast-plugin-connects-with-a-device-f