-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat: Added setPlaybackRate and tracks #63
base: master
Are you sure you want to change the base?
Conversation
@@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN | |||
- (void)addMessageListener:(CDVInvokedUrlCommand*)command; | |||
- (void)sendMessage:(CDVInvokedUrlCommand*) command; | |||
- (void)mediaPlay:(CDVInvokedUrlCommand*)command; | |||
- (void)mediaPause:(CDVInvokedUrlCommand*)command; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think mediaPause should be removed here?
/** | ||
* Pauses the media item. | ||
* @param {chrome.cast.media.PauseRequest} pauseRequest The optional media pause request. | ||
* @param {function} successCallback Invoked on success. | ||
* @param {function} \ successCallback Invoked on success. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo '/' here
Hi @plauzul ! Thanks for submitting this! And following up with the iOS implementation! (I was just going to ask for it. :p) I looked through your changes it all looks pretty good I think. (I haven't run it yet, really swamped right now. Hopefully I will be able to test it in a few weeks. T.T) Regarding subtitlesI haven't worked with this before. Do the subtitles need to be embed in the video already, or do they come from a separate url? Regarding setPlaybackRateSo there a couple things: 1)Before I add it, I do really want a test to be added to the auto tests. (With the re-write I worked really hard vamping up the tests so that the plugin will be stable hopefully!) This test should be quite easy to write. (You can probably write it without actually running it. If the test has little problems, I won't mind fixing it when I get around to actually testing this.) Two tests should be created:
They should go in the 2)Issue #64, Doesn't really affect this PR, but it might affect how this feature is accessed in the future. 3)Kind of related to Issue #64, the only way I found for setting the playback rate from a desktop chrome browser was this: session.sendMessage(
"urn:x-cast:com.google.cast.media",
{
mediaSessionId: session.media[0].mediaSessionId,
requestId: 12345,
type: 'SET_PLAYBACK_RATE',
playbackRate: 2
},
function () {
console.log('success');
}, function (err) {
console.log(err);
}); This is kind of interesting because that might mean that the native-side implementation of setPlaybackRate might not be required.
If you have everything set up still, could you run the 4)Upon testing the 5)The SetPlaybackRateRequestData for the sendMessage function can also take |
Platforms affected
Android
Motivation and Context
possibility of accelerating videos on android, and viewing subtitles with setMediaTracks
Description
Possibility to change the playbackrate of the video on android, and visualization of subtitles with setMediaTracks. If possible do the same on IOS, I am not IOS developer
Testing
emulator, real device and chromecast
Checklist
npm test
and no errors were found (runnpm style
to auto-fix errors it can)