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

Feature detect setTimeout in auto setup for SSR #7247

Merged
merged 1 commit into from
Jun 2, 2021

Commits on May 25, 2021

  1. Feature detect setTimeout in auto setup for SSR

    In some server side rendering environments (e.g., `execjs` since
    version 2.8.0 [1]) `setTimeout` is not available. Since
    `autoSetupTimeout` runs when Video.js is imported and tries to
    schedule `autoSetup`, this can lead to errors of the following form in
    server side rendering:
    
        TypeError: scheduler is not a function
    
    `autoSetup` already bailed out if run outside of a browser environment
    or if globally disabled. To prevent calling `setTimeout`, we already
    perform the `Dom.isReal` check in `autoSetupTimeout`. Checking
    `options.autoSetup` has to remain in `autoSetup` to preserve backwards
    compatiblity with apps that set the option after Video.js has loaded
    but before the next tick.
    
    [1] rails/execjs#43
    tf committed May 25, 2021
    Configuration menu
    Copy the full SHA
    88be349 View commit details
    Browse the repository at this point in the history