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

[video_player] Add v2 embedding support #2226

Merged
merged 7 commits into from
Nov 13, 2019
Merged

[video_player] Add v2 embedding support #2226

merged 7 commits into from
Nov 13, 2019

Conversation

mklim
Copy link
Contributor

@mklim mklim commented Oct 21, 2019

Description

  • Adds support in the plugin
  • Adds a v2 embedding to the example app
  • Fixes a broken remote example in the example app
  • Increments the Flutter SDK dependency
  • Increments the version
  • Adds e2e tests for some simple use cases of the plugin

Related Issues

Fixes flutter/flutter#41850.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • 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).
  • No, this is not a breaking change.

@mklim mklim requested a review from cyanglaz October 21, 2019 18:16
@mklim mklim requested a review from iskakaushik as a code owner October 21, 2019 18:16
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

LGTM module nits

return exoPlayer.getCurrentPosition();
}
/** Register this with the v2 embedding for the plugin to respond to lifecycle callbacks. */
public VideoPlayerPlugin() {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems not necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's redundant. I think I'm fine having this just as a place to hang the documentation on though.

<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
Copy link
Contributor

Choose a reason for hiding this comment

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

not necessary per Matt's suggestion. #2164 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -8,7 +8,9 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter

flutter_driver:
Copy link
Contributor

Choose a reason for hiding this comment

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

missing flutter version constraints for example app.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not needed here since it matches the Flutter SDK constraints of the plugin itself.

@xster
Copy link
Member

xster commented Oct 29, 2019

Can you sync your PR to head again?

Copy link
Contributor Author

@mklim mklim left a comment

Choose a reason for hiding this comment

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

Can you sync your PR to head again?

Done.

<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -8,7 +8,9 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter

flutter_driver:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not needed here since it matches the Flutter SDK constraints of the plugin itself.

return exoPlayer.getCurrentPosition();
}
/** Register this with the v2 embedding for the plugin to respond to lifecycle callbacks. */
public VideoPlayerPlugin() {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's redundant. I think I'm fine having this just as a place to hang the documentation on though.

Copy link
Member

@xster xster left a comment

Choose a reason for hiding this comment

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

LGTM

@xster
Copy link
Member

xster commented Nov 11, 2019

Is it just broken tests waiting for this?

@mklim
Copy link
Contributor Author

mklim commented Nov 11, 2019

@xster yeah. The plugin code itself LG, but something about the driver tests are failing on iOS devices in CI. I don't usually develop on macOS devices so I haven't taken the time to triage whether it's a CI specific issue or an iOS specific issue.

It's possible that the tests are either catching a real bug or the tests themselves are just not written well. I think the latter is more likely. I wrote them to hit "play" and then wait for a few hundred milliseconds and then hit "pause" and make sure that their current video position isn't 0:00, so it could be that the tests aren't waiting long "enough." A better way to write the tests would be to actually have a future that waits for the current video position to increment past 0:00 and then immediately stops (with a generous upper bound timeout, so that the test doesn't completely hang).

Michael Klimushyn added 6 commits November 12, 2019 12:24
- Migrates the plugin
- Adds a v2 embedding to the example app
- Fixes a broken remote example in the example app
- Increments the Flutter SDK dependency
- Increments the version
- Adds e2e tests for some simple use cases of the plugin
@mklim
Copy link
Contributor Author

mklim commented Nov 12, 2019

These tests pass locally on iOS for me. I'm not sure why they're failing in CI. I'm tempted to skip them on iOS with a TODO for now but I don't think that's a great solution.

@collinjackson do you know any reasons why iOS tests around playing videos would fail in CI?

@xster do you have opinions with skipping the driver tests on iOS until we root cause why they're failing in CI?

@mklim
Copy link
Contributor Author

mklim commented Nov 13, 2019

I'm tentatively skipping the problem tests on iOS for now.

@mklim mklim merged commit a336b28 into flutter:master Nov 13, 2019
@mklim mklim deleted the migrate_video_player branch November 13, 2019 20:12
mormih pushed a commit to mormih/plugins that referenced this pull request Nov 17, 2019
- Adds support in the plugin
- Adds a v2 embedding to the example app
- Fixes a broken remote example in the example app
- Increments the Flutter SDK dependency
- Increments the version
- Adds e2e tests for some simple use cases of the plugin
hjc22 pushed a commit to hjc22/plugins that referenced this pull request Dec 13, 2019
* newCache/blackVideos: (105 commits)
  [connectivity] Fix reachability stream for iOS (flutter#2281)
  [google_sign_in] Port plugin to use the federated Platform Interface (flutter#2266)
  [webview_flutter] Add async NavigationDelegates (flutter#2257)
  Update cirrus to create IOS simulator on 13.2 an xCode 11 (flutter#2275)
  [battery] Update and migrate iOS example project (flutter#2089)
  [url_launcher] DartDoc and test improvements (flutter#2274)
  [google_maps_flutter] Define clang module for iOS, fix analyzer warnings (flutter#2182)
  [video_player] Add v2 embedding support (flutter#2226)
  [path_provider] Update and migrate iOS example project (flutter#2099)
  [sensors] Documentation and test improvements (flutter#2272)
  [image_picker] Lint for public DartDocs (flutter#2270)
  [connectivity] Lint for public DartDocs (flutter#2269)
  [shared_preferences] Update and migrate iOS example project (flutter#2103)
  [quick_actions] Update and migrate iOS example project (flutter#2100)
  [infra] Ignore analyzer issues in CI (flutter#2271)
  [android_intent] Add missing DartDocs (flutter#2268)
  Bump google_maps_flutter pubspec to match CHANGELOG (flutter#2267)
  [google_sign_in] Handle new style URLs in GoogleUserCircleAvatar (flutter#2252)
  [google_sign_in] Move plugin to its subdir to allow for federated implementations. Add platform interface. (flutter#2244)
  Make setMockInitialValues handle non-prefixed keys (flutter#2260)
  ...

# Conflicts:
#	packages/video_player/CHANGELOG.md
#	packages/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java
#	packages/video_player/ios/video_player.podspec
#	packages/video_player/pubspec.yaml
#	packages/video_player/test/video_player_test.dart
sungmin-park pushed a commit to sungmin-park/flutter-plugins that referenced this pull request Dec 17, 2019
- Adds support in the plugin
- Adds a v2 embedding to the example app
- Fixes a broken remote example in the example app
- Increments the Flutter SDK dependency
- Increments the version
- Adds e2e tests for some simple use cases of the plugin
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.

[video_player] Support the v2 Android embedder plugins API
4 participants