Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ugly skipLog parameter to the synchronizeInventory method #1341

Merged
merged 1 commit into from
Dec 27, 2023

Commits on Dec 22, 2023

  1. Add ugly skipLog parameter to the synchronizeInventory method

    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 it is an element 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
    the `synchronizeInventory` 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.
    peaBerberian committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    1acbb35 View commit details
    Browse the repository at this point in the history