This commit is contained in:
parent
4bf2b2c45f
commit
f73b7a0484
@ -195,7 +195,7 @@ static NSString *const timedMetadata = @"timedMetadata";
|
||||
@"atValue": [NSNumber numberWithLongLong:currentTime.value],
|
||||
@"atTimescale": [NSNumber numberWithInt:currentTime.timescale],
|
||||
@"target": self.reactTag,
|
||||
@"seekableDuration": [NSNumber numberWithFloat:CMTimeGetSeconds([self playerItemSeekableTimeRange].duration)],
|
||||
@"seekableDuration": [self calculateSeekableDuration],
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -225,6 +225,16 @@ static NSString *const timedMetadata = @"timedMetadata";
|
||||
return [NSNumber numberWithInteger:0];
|
||||
}
|
||||
|
||||
- (NSNumber *)calculateSeekableDuration
|
||||
{
|
||||
CMTimeRange timeRange = [self playerItemSeekableTimeRange];
|
||||
if (CMTIME_IS_NUMERIC(timeRange.duration))
|
||||
{
|
||||
return [NSNumber numberWithFloat:CMTimeGetSeconds(timeRange.duration)];
|
||||
}
|
||||
return [NSNumber numberWithInteger:0];
|
||||
}
|
||||
|
||||
- (void)addPlayerItemObservers
|
||||
{
|
||||
[_playerItem addObserver:self forKeyPath:statusKeyPath options:0 context:nil];
|
||||
|
Loading…
Reference in New Issue
Block a user