Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

creativecreatorormaybenot
Copy link
Contributor

@creativecreatorormaybenot creativecreatorormaybenot commented Sep 15, 2020

Description

Playback speed on videos is a very important feature to us and seems to be highly requested as well.
There have been earlier attempts to implement this feature into the video_player plugin, however, the PRs for those have remained stale.

Consequently, I decided to pick up this task and implement playback speed support into the latest version of the video_player plugin.

What this PR accomplishes

This PR adds the playback speed feature on Android, iOS, and web.

I did not copy code from existing PRs (though I did use them as a reference for the Android and iOS implementations). Instead, I designed the API in the way that I figured was most sensible having the learnings from the other PRs in mind. (I actually later figured out just how similar the interface implementations were, even though they were created separately. I suppose it happened because we all followed the existing interface).

Related Issues

Pigeon

I upgraded pigeon to 0.1.7. You might say that this makes the PR harder to review because the generation changed, but I thought about it and I have to disagree:

  • There are changes anyway using the older pigeon version.
  • Generated files should be ignored in PR review anyway.

Testing

Manual testing

I tested this both on Android and on iOS in a production app.
Additionally, I added the feature to the example app and tested that on web and mobile.

Unit (and integration) tests

Integration testing for this feature seems not only very difficult, but most importantly not sensible. I can test the platform calls, but the underlying native libraries and Flutter functionality should do the integration testing.

Having said that, I did include unit tests.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).

Barely breaking

I think formally this is a breaking change, but realistically it is just a hotfix because the only breaking change is toString for VideoPlayerValue, so 🤷🏽‍♀️

@creativecreatorormaybenot creativecreatorormaybenot changed the title [WIP] [video_player] Add playback speed support [WIP] [video_player] Add playback speed support on all platforms Sep 15, 2020
@creativecreatorormaybenot creativecreatorormaybenot changed the title [WIP] [video_player] Add playback speed support on all platforms [video_player] Add playback speed support on all platforms Sep 15, 2020
@creativecreatorormaybenot creativecreatorormaybenot marked this pull request as ready for review September 15, 2020 05:20
@creativecreatorormaybenot
Copy link
Contributor Author

@creativecreatorormaybenot creativecreatorormaybenot marked this pull request as draft September 15, 2020 17:02
@creativecreatorormaybenot creativecreatorormaybenot changed the title [video_player] Add playback speed support on all platforms [wip] [video_player] Add playback speed support on all platforms Sep 15, 2020
@creativecreatorormaybenot creativecreatorormaybenot changed the title [wip] [video_player] Add playback speed support on all platforms [template] [video_player] Add playback speed support on all platforms Sep 15, 2020
@creativecreatorormaybenot
Copy link
Contributor Author

In a discussion with @stuartmorgan, I just now realized that this PR needs to be split up.

I will iteratively roll out the smaller PRs in order to make this work.

The start is the platform interface: #3032
I will leave this PR open until the features are implemented.


The tests failing here is intentional.

@jpiabrantes
Copy link

Was this merged?

@creativecreatorormaybenot
Copy link
Contributor Author

@jpiabrantes No, I am still waiting for review. I will update the merge conflicts today and hope for a review soon.

@creativecreatorormaybenot
Copy link
Contributor Author

(I am bumping the Dart SDK constraint to 2.8 because pigeon requires doing so since 1.7, see changelog)

Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

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

This looks good to me, I didn't find anything blocking, mostly nitpicking!

As you've already done, this needs to be split in 3 separate PRs so we can publish it in order.

@creativecreatorormaybenot
Copy link
Contributor Author

@ditman Thanks so much for going through part 1/3 with me 🚀

I created a PR for part 2/3: #3081

@creativecreatorormaybenot
Copy link
Contributor Author

@ditman Part 3/3 is at #3084 👍

@ditman
Copy link
Member

ditman commented Sep 26, 2020

Let's close this PR since it's been split up in individual PRs now.

@ditman ditman closed this Sep 26, 2020
@ditman
Copy link
Member

ditman commented Sep 26, 2020

Published video_player v0.11.0, which contains the playback speed feature!

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

Successfully merging this pull request may close these issues.

play back speed functionality for video player is missing Feature request: video_player ability to set speed
4 participants