Skip to content

Commit

Permalink
Merge pull request #9 from tritondigital/player-state-issue
Browse files Browse the repository at this point in the history
The mediaplayer status is unknown even if the buffer is full
  • Loading branch information
jd-buys authored Nov 2, 2022
2 parents d97d77d + 2567888 commit cfd9ebf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TritonPlayerSDK/Classes/Player/TDMediaPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NS
BOOL isFromNetwork = ([self.streamURL containsString:@"http://"] || [self.streamURL containsString:@"https://"]);

BOOL isNotFailed = self.mediaPlayerItem.status != AVPlayerItemStatusFailed;
BOOL isReadyToPlay = self.mediaPlayerItem.status == AVPlayerItemStatusReadyToPlay;
BOOL isReadyToPlay = self.mediaPlayerItem.status == AVPlayerItemStatusReadyToPlay || self.mediaPlayerItem.status == AVPlayerItemStatusUnknown;
if((!isFromNetwork && isNotFailed) || (isReadyToPlay && isFromNetwork))
{
// Move state machine to play state
Expand Down

0 comments on commit cfd9ebf

Please sign in to comment.