Skip to content

Commit c579d3c

Browse files
Merge pull request #1992 from jenshandersson/feat/hlssize
Fix video dimensions for HLS streams
2 parents 1ecb09a + 08c7aaa commit c579d3c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Version 5.1.0-alpha6
44

55
- 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)
6+
- Fix video dimensions being undefined when playing HLS in ios. [#1992](https://github.com/react-native-community/react-native-video/pull/1992)
67

78
### Version 5.1.0-alpha5
89

ios/Video/RCTVideo.m

+4
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,10 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
638638
} else {
639639
orientation = @"portrait";
640640
}
641+
} else if (_playerItem.presentationSize.height) {
642+
width = [NSNumber numberWithFloat:_playerItem.presentationSize.width];
643+
height = [NSNumber numberWithFloat:_playerItem.presentationSize.height];
644+
orientation = _playerItem.presentationSize.width > _playerItem.presentationSize.height ? @"landscape" : @"portrait";
641645
}
642646

643647
if (self.onVideoLoad && _videoLoadStarted) {

0 commit comments

Comments
 (0)