Skip to content

Commit ef2120b

Browse files
zachrnolanMatt Apperson
authored andcommitted
added removePlayerLayer to fix iOS crash (TheWidlarzGroup#650)
1 parent 72a46bc commit ef2120b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ios/RCTVideo.m

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ - (void)dealloc
141141
{
142142
[[NSNotificationCenter defaultCenter] removeObserver:self];
143143
[self removePlayerItemObservers];
144+
[self removePlayerLayer];
144145
[_player removeObserver:self forKeyPath:playbackRate context:nil];
145146
}
146147

@@ -327,23 +328,23 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
327328
if ([keyPath isEqualToString: timedMetadata])
328329
{
329330

330-
331+
331332
NSArray<AVMetadataItem *> *items = [change objectForKey:@"new"];
332333
if (items && ![items isEqual:[NSNull null]] && items.count > 0) {
333-
334+
334335
NSMutableArray *array = [NSMutableArray new];
335336
for (AVMetadataItem *item in items) {
336-
337+
337338
NSString *value = item.value;
338339
NSString *identifier = item.identifier;
339-
340+
340341
if (![value isEqual: [NSNull null]]) {
341342
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjects:@[value, identifier] forKeys:@[@"value", @"identifier"]];
342-
343+
343344
[array addObject:dictionary];
344345
}
345346
}
346-
347+
347348
self.onTimedMetadata(@{
348349
@"target": self.reactTag,
349350
@"metadata": array

0 commit comments

Comments
 (0)