-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[video_player] foundation - reduce seek accuracy to fix seek to end bug #3784
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
Merged
auto-submit
merged 20 commits into
flutter:main
from
tarrinneal:video-player-seekToEnd-bug
May 11, 2023
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
45fb3a5
remove seek accuracy
tarrinneal 426c067
minimal tolerance
tarrinneal 7d167e2
tolerance only when seeking to duration
tarrinneal b78ae9b
format
tarrinneal cc5b173
changelog and comment
tarrinneal aa9fbbd
tests?
tarrinneal 041dcb3
clean up
tarrinneal c6861f4
format
tarrinneal 747a421
DI
tarrinneal 2e12e1a
test set up
tarrinneal d130337
move interface
tarrinneal 7e8fada
Pesky *, I'm sure I'll revert this before it lands
tarrinneal b61eace
no tolerance test
tarrinneal 6a586d1
Finish tests
tarrinneal c9bd628
Merge 'main' into video-player-seekToEnd-bug
tarrinneal ce41a1f
review changes
tarrinneal 3ef8801
format
tarrinneal 46f3c7d
Nits and stub change
tarrinneal fb9b9b8
rename plugin registrar
tarrinneal 7aeb3db
format
tarrinneal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
format
- Loading branch information
commit c6861f4da1f883a1bb7f2b3bd581760b63c3ac58
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you write a unit test (XCTest) for this behavior?
Uh oh!
There was an error while loading. Please reload this page.
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 have no idea what I didn't think of that when @tarrinneal and I were talking about testing for this 🤦🏻
It looks like we don't currently have a way to mock out the underlying
AVPlayer, which significantly reduces testability. I would suggest wrapping the current call to[AVPlayer playerWithPlayerItem:]in a factory object, and do DI of that factory. So you'd make a test-only header that declared:AVPlayerinstance factory (which it looks like would just be a single method)The, similar to the other DI you did recently, you'd have a private implementation of that protocol that's the default version, just wrapping
[AVPlayer playerWithPlayerItem:], but tests could replace it with something vending mock AVPlayer instances where you could validate the tolerance parameter.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.
Can also try stubbing the constructor directly if it's easier:
Uh oh!
There was an error while loading. Please reload this page.
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.
Please don't. OCMock class mocking is giant foot-gun; it's incredibly easy to accidentally leak mocking across tests.
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.
gotcha. i did that a few times for camera plugin iirc. i should clean that up sometime.