Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for error when attempting to playback live audio streams.
A live stream will not return a duration or a current time value. Resolved issue #40 by checking player
duration
orcurrentTime
againstCMTIME_IS_INDEFINITE
orCMTIME_IS_INVALID
respectively and return-1
if invalid.Adds methods to
ReactPlayer
forduration
andposition
that accommodates check of live streams that wouldn't have a known duration or position. If duration and position are unknown/invalid the-duration
or-position
method will return-1
. Implements usage of these methods inAudioPlayer
allowing playback of live streams without throwing an error on the React side likeRCTJSONStringify() encountered the following error: Invalid number value (NaN)
... as the number now return will be-1
.This fix will cause no significant changes in usage of the library. Note again that live stream
duration
andposition
values will be-1
.