Error Handling Failed Autoplay Attempt. DOMException: play() can only be initiated by a user gesture
When I attempt to autoplay and it fails, I receive the error " Uncaught (in promise) DOMException: play() can only be initiated by a user gesture."
I would like to catch the promise rejection and make the player revert to Click To Play on failed autoplay attempts. When I try to catch the promise rejection ( jwplayer().play().catch(err => console.log(err)); I receive the error "Uncaught TypeError: jwplayer(...).play(...).catch is not a function". I also want to note that on failed play attempts, the state of the player remains "playing" and the jwplayer().on('playAttemptFailed') callback is not called.
What is the proper way to handle failed autoplay attempts?