Skip to content
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

Add support for setRate on Android. Fix setRate on iOS when seeking. #196

Closed
wants to merge 1 commit into from

Conversation

BuddyLReno
Copy link
Contributor

Platforms affected

  • Android
  • iOS

What does this PR do?

  • Fix rate setting when seeking audio tracks on iOS.
  • Adds setRate support for android.

What testing has been done on this change?

Physical device testing on:

  • iPhone X (iOS 12)
  • iPhone 6 (iOS 11)
  • OnePlus 5T (Oreo 8.1)
  • Samsung Galaxy S8 (Nougat 7.1)

Checklist

  • Reported an issue in the JIRA database
  • Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
  • Added automated test coverage as appropriate for this change.

rganchev added a commit to asteasolutions/cordova-plugin-media that referenced this pull request Mar 15, 2019
rganchev added a commit to asteasolutions/cordova-plugin-media that referenced this pull request Mar 19, 2019
This reverts commit 6686cf0.
@hphirke
Copy link

hphirke commented May 3, 2019

Why was this reverted? Does it break anything?

@bricedupuy
Copy link

Can this be merged please?

@janpio
Copy link
Member

janpio commented May 29, 2019

@himanshuphirke Nobody reverted anything in this branch, the commits you are seeing were in a fork of this repo: https://github.com/asteasolutions/cordova-plugin-media

@bricedupuy Did you review and test this code and can guarantee that it works as expected?

} else {
console.warn('media.setRate method is currently not supported for', cordova.platformId, 'platform.');
}
exec(null, null, "Media", "setRate", [this.id, rate]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to all platforms now (incl. WP, still), however the actual support is only for iOS and Android, as far as I understand.

Copy link

@mikhail-irdeto mikhail-irdeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd probably be nicer to have the bugfix for iOS and the feature for Android as separate PRs. Thanks!

@mikhail-irdeto
Copy link

It looks like on Android setRate() only works when media is already playing (after play() is called) but on iOS the behaviour is that one can set rate both before and after playback is started.


public void setRate(float speed) {
// Check for API 23+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If setRate requires API 23, then we should add that as a quirk in the documentation stating that devices with a lower API level will be a no operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants