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

[ASVideoNode] Several small bug fixes, improved code quality, added more tests. #1549

Merged
merged 4 commits into from
Apr 19, 2016
Merged

[ASVideoNode] Several small bug fixes, improved code quality, added more tests. #1549

merged 4 commits into from
Apr 19, 2016

Conversation

ejensen
Copy link
Contributor

@ejensen ejensen commented Apr 18, 2016

Isolated fixes extracted from #1496 These changes do not touch the player construction / fetchData cleanup from the original PR. I will rebase those changes in a separate PR.

  1. Corrects map between AVLayerVideoGravityResize and its corresponding UIViewContentMode (ScaleToFill instead of Redraw).
  2. Changing gravity now updates the placeholder node's contentMode.
  3. Replacing the playButton now cleans-up the previous button's state.
  4. Fix video stalling caused by backgrounding & foregrounding the app.

static UIViewContentMode ASContentModeFromVideoGravity(NSString *videoGravity) {
if ([videoGravity isEqualToString:AVLayerVideoGravityResizeAspect]) {
return UIViewContentModeScaleAspectFit;
} else if ([videoGravity isEqual:AVLayerVideoGravityResizeAspectFill]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

isEqualToString:

@appleguy appleguy changed the title [ASVideoNode] Various fixes [ASVideoNode] Several small bug fixes, improved code quality, added more tests. Apr 19, 2016
@appleguy appleguy merged commit 8d0fe96 into facebookarchive:master Apr 19, 2016
@appleguy
Copy link
Contributor

@ejensen thanks again! Feel free to wait a few days until the other changes affecting this file have merged, to minimize the risk of conflicts, But I am looking forward to the other diff.

@ejensen ejensen deleted the video-fixes-rebase branch April 19, 2016 04:59
@ejensen
Copy link
Contributor Author

ejensen commented Apr 19, 2016

@appleguy Thanks for the review! I've incorporated your suggestions in the second PR of the bunch. I tried to minimize conflicts as much as possible. Feel free to hold off the second PR until you see fit. I know thrashing on a file is painful. If any conflict arise, I can rebase, wash, and repeat.

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

Successfully merging this pull request may close these issues.

3 participants