Add ugly skipLog
parameter to the synchronizeInventory method
#1341
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.
The
synchronizeInventory
method is an internal method of the RxPlayer allowing to synchronize our internal representation of media buffers (representing which segments are buffered where) with the anounced buffered TimeRanges of the media buffer as indicated by the web browser, which should be more up-to-date (e.g. take into consideration garbage collection).As this internal representation of the buffer is very valuable when debugging, the
synchronizeInventory
produce logs each time it is called.Yet that method is very often called when the debug element (under the
DEBUG_ELEMENT
feature) to be sure it is mostly up-to-date with the browser's buffer as the debug element is only shown in debugging contexts.Calling that method in this context of visual debugging here has consequently the side-effect of producing a large ammount of debug logs, which isn't necessary.
Due to this, I decided to add an optional
skipLog
boolean parameter to thesynchronizeInventory
method. It is ugly, as it leaks debugging-related implementation details into the method signature, but it appears to me to be useful in that specific situation.