Skip to content

Commit

Permalink
Support Android user agent for YT JS API
Browse files Browse the repository at this point in the history
  • Loading branch information
codepuncher authored and paulirish committed Sep 11, 2022
1 parent f3b132e commit 185af94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lite-yt-embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class LiteYTEmbed extends HTMLElement {
// However Safari and Firefox do not successfully track the user gesture of clicking through the creation/loading of the iframe,
// so they don't autoplay automatically. Instead we must load an additional 300KB (ungz) of JS for the YT Player API
// TODO: chrome android seems to also need this
this.needsYTApiForAutoplay = navigator.vendor.includes('Apple') || navigator.userAgent.includes('Firefox');
this.needsYTApiForAutoplay = navigator.vendor.includes('Apple') || ['Firefox', 'Android'].some(userAgent => navigator.userAgent.includes(userAgent));
}

// // TODO: Support the the user changing the [videoid] attribute
Expand Down

0 comments on commit 185af94

Please sign in to comment.