You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a problem for hosted cordova apps that run on both cordova apps and in desktop chrome.
Currently, you can use the exact same script to control a chromecast on cordova and on desktop chrome. Which is super convenient.
(Aside from functions under chrome.cast.cordova, these functions supply operations that are impossible in the browser, and should be isolated to that).
Adding media.setPlaybackRate would break this.
This functionality is possible in chrome desktop via:
How do we handle this situation while inconveniencing the desktop/cdv devs minimally?
Options
Here's what I can think of so far:
Drop media.setPlaybackRate and only use sendMessage. Add a documentation note on how to set playback rate with sendMessage.
Requires users to use a really ugly piece of code.
Requires ugly documentation.
(4th imo)
Keep media.setPlaybackRate and add a note that this is a cordova exclusive function.
Requires desktop/cdv devs to write conditional code.
Requires some ugly documentation, but only targeted at desktop/cdv devs
(2nd imo)
Rename it to chrome.cast.cordova.setPlaybackRate.
Doesn't fit with the rest of the cordova exclusive functions.
Is actually possible to do on browser, so shouldn't exactly be cordova exclusive.
Requires desktop/cdv devs to write conditional code.
Requires some special documentation.
(3rd imo)
Make a file, "cast-convenience-functions.js" (or something), that has media.setPlaybackRate which just calls the built sendMessage function. Add a note for desktop-compatibly-hosted-web-app that they must include a copy of this file on their site to be able to use media.setPlaybackRate.
desktop/cdv devs have to add a file to their website
Requires documentation targeted at desktop/cdv devs
But will only need to add this note once eg. media.setPlaybackRate*, * points to note they need to add file
desktop/cdv devs will need to update the file if they update the plugin and want to use new convenience functions.
completely non-cordova devs can use this file as well
(best imo)
Conclusion
I like option 4 the best atm.
I would prefer to keep my chromecast controlling script as clean as possible. Currently, it doesn't even mention cordova once, I would like to keep it that way.
But I would like to hear any feedback about this issue/idea. Particularly from other desktop/cdv devs. But all welcome!
The text was updated successfully, but these errors were encountered:
Terminology
desktop/cdv devs: devs who write a hosted app that runs on both cordova apps and on desktop browsers
Why am I asking this question
This question arose when looking into PR #63.
The PR will add the function
chrome.cast.media.setPlaybackRate
.Unfortunately,
media.setPlaybackRate
doesn't exist in the official Google Cast API for Chrome.This is a problem for hosted cordova apps that run on both cordova apps and in desktop chrome.
Currently, you can use the exact same script to control a chromecast on cordova and on desktop chrome. Which is super convenient.
(Aside from functions under
chrome.cast.cordova
, these functions supply operations that are impossible in the browser, and should be isolated to that).Adding
media.setPlaybackRate
would break this.This functionality is possible in chrome desktop via:
Actual Question
How do we handle this situation while inconveniencing the desktop/cdv devs minimally?
Options
Here's what I can think of so far:
media.setPlaybackRate
and only usesendMessage
. Add a documentation note on how to set playback rate withsendMessage
.media.setPlaybackRate
and add a note that this is a cordova exclusive function.chrome.cast.cordova.setPlaybackRate
.media.setPlaybackRate
which just calls the builtsendMessage
function. Add a note for desktop-compatibly-hosted-web-app that they must include a copy of this file on their site to be able to usemedia.setPlaybackRate
.media.setPlaybackRate*
, * points to note they need to add fileConclusion
I like option 4 the best atm.
I would prefer to keep my chromecast controlling script as clean as possible. Currently, it doesn't even mention cordova once, I would like to keep it that way.
But I would like to hear any feedback about this issue/idea. Particularly from other desktop/cdv devs. But all welcome!
The text was updated successfully, but these errors were encountered: