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

Support Rendering with Audio Context Suspended #55

Open
epihel opened this issue Jan 26, 2019 · 0 comments
Open

Support Rendering with Audio Context Suspended #55

epihel opened this issue Jan 26, 2019 · 0 comments

Comments

@epihel
Copy link

epihel commented Jan 26, 2019

As of version M71 (December 2018), Chrome has disabled autoplaying sound and video (https://goo.gl/7K7WLu). This line:

import { controls, Media, Player } from 'react-media-player';

will trigger the warning The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.

This line in render:

<Player useAudioObject />

will throw the Error:

TypeError: Cannot set property 'oncanplay' of undefined
    at HTML5.js:229
    at Array.forEach (<anonymous>)
    at ProxyComponent._bindAudioObjectEvents (HTML5.js:228)
    at ProxyComponent._bindAudioObjectEvents (react-hot-loader.development.js:693)
    at ProxyComponent.componentDidUpdate (HTML5.js:132)
    at ProxyComponent.componentDidUpdate (react-hot-loader.development.js:683)
    at commitLifeCycles (react-dom.development.js:16242)
    at commitAllLifeCycles (react-dom.development.js:17592)
    at HTMLUnknownElement.callCallback (react-dom.development.js:149)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:199)

Note that removing useAudioObject, as in:

<Player />

will not throw the Error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant