Skip to content

Instantly share code, notes, and snippets.

View ferferga's full-sized avatar
💭
I may be slow to respond (429 Too Many Requests)

Fernando Fernández ferferga

💭
I may be slow to respond (429 Too Many Requests)
  • Spain
  • 09:57 (UTC +02:00)
View GitHub Profile
@nathansearles
nathansearles / isAutoplaySupported.js
Last active December 13, 2022 11:06
Test if HTML5 video autoplay is supported
// isAutoplaySupported(callback);
// Test if HTML5 video autoplay is supported
isAutoplaySupported = function(callback) {
// Is the callback a function?
if (typeof callback !== 'function') {
console.log('isAutoplaySupported: Callback must be a function!');
return false;
}
// Check if sessionStorage exist for autoplaySupported,
// if so we don't need to check for support again