Merge branch 'master' into feature/text-tracks

This commit is contained in:
Hampton Maxwell 2018-06-04 11:47:16 -07:00
commit 03017c0f63
4 changed files with 16 additions and 13 deletions

View File

@ -1,6 +1,9 @@
## Changelog
Upcoming release
* Prevent multiple onEnd notifications on iOS (https://github.com/react-native-community/react-native-video/pull/832)
* Fix doing a partial swipe on iOS causing a black screen (https://github.com/react-native-community/react-native-video/pull/1048)
* Fix crash when switching to a new source on iOS (https://github.com/react-native-community/react-native-video/pull/974)
* Add cookie support for ExoPlayer (https://github.com/react-native-community/react-native-video/pull/922)
* Remove ExoPlayer onMetadata that wasn't being used (https://github.com/react-native-community/react-native-video/pull/1040)
* Fix bug where setting the progress interval on iOS didn't work (https://github.com/react-native-community/react-native-video/pull/800)

View File

@ -86,7 +86,7 @@ include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
```
If you need to use the old Android media player based player, use the following instead:
If you need to use the old Android MediaPlayer based player, use the following instead:
```gradle
include ':react-native-video'

View File

@ -152,8 +152,8 @@ static NSString *const timedMetadata = @"timedMetadata";
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self removePlayerItemObservers];
[self removePlayerLayer];
[self removePlayerItemObservers];
[_player removeObserver:self forKeyPath:playbackRate context:nil];
}
@ -264,9 +264,6 @@ static NSString *const timedMetadata = @"timedMetadata";
* observer set */
- (void)removePlayerItemObservers
{
if (_playerLayer) {
[_playerLayer removeObserver:self forKeyPath:readyForDisplayKeyPath];
}
if (_playerItemObserversSet) {
[_playerItem removeObserver:self forKeyPath:statusKeyPath];
[_playerItem removeObserver:self forKeyPath:playbackBufferEmptyKeyPath];
@ -280,13 +277,13 @@ static NSString *const timedMetadata = @"timedMetadata";
- (void)setSrc:(NSDictionary *)source
{
[self removePlayerLayer];
[self removePlayerTimeObserver];
[self removePlayerItemObservers];
_playerItem = [self playerItemForSource:source];
[self addPlayerItemObservers];
[_player pause];
[self removePlayerLayer];
[_playerViewController.view removeFromSuperview];
_playerViewController = nil;
@ -466,10 +463,17 @@ static NSString *const timedMetadata = @"timedMetadata";
- (void)attachListeners
{
// listen for end of file
[[NSNotificationCenter defaultCenter] removeObserver:self
name:AVPlayerItemDidPlayToEndTimeNotification
object:[_player currentItem]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:[_player currentItem]];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:AVPlayerItemPlaybackStalledNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playbackStalled:)
name:AVPlayerItemPlaybackStalledNotification

View File

@ -8,13 +8,9 @@
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
[_rctDelegate videoPlayerViewControllerDidDismiss:self];
}
- (void)viewWillDisappear:(BOOL)animated {
[_rctDelegate videoPlayerViewControllerWillDismiss:self];
[super viewWillDisappear:animated];
[super viewDidDisappear:animated];
[_rctDelegate videoPlayerViewControllerWillDismiss:self];
[_rctDelegate videoPlayerViewControllerDidDismiss:self];
}
@end