Skip to content

Commit

Permalink
Merge pull request #1992 from jenshandersson/feat/hlssize
Browse files Browse the repository at this point in the history
Fix video dimensions for HLS streams
  • Loading branch information
jenshandersson committed May 5, 2020
2 parents 1ecb09a + 08c7aaa commit c579d3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Version 5.1.0-alpha6

- Fix iOS bug which would break size of views when video is displayed with controls on a non full-screen React view. [#1931](https://github.com/react-native-community/react-native-video/pull/1931)
- Fix video dimensions being undefined when playing HLS in ios. [#1992](https://github.com/react-native-community/react-native-video/pull/1992)

### Version 5.1.0-alpha5

Expand Down
4 changes: 4 additions & 0 deletions ios/Video/RCTVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,10 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
} else {
orientation = @"portrait";
}
} else if (_playerItem.presentationSize.height) {
width = [NSNumber numberWithFloat:_playerItem.presentationSize.width];
height = [NSNumber numberWithFloat:_playerItem.presentationSize.height];
orientation = _playerItem.presentationSize.width > _playerItem.presentationSize.height ? @"landscape" : @"portrait";
}

if (self.onVideoLoad && _videoLoadStarted) {
Expand Down

0 comments on commit c579d3c

Please sign in to comment.