Skip to content

Commit

Permalink
fix: respect autoPlay
Browse files Browse the repository at this point in the history
  • Loading branch information
tomups authored May 1, 2024
1 parent 2ab3ccd commit ef3285e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions components/TerminalPlayer/TerminalPlayer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ if (!validProps.success) {

const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
const player = players.get(entry.target);

if (player) {
const settings = entry.target.getAttribute('data-astro-asciinema-settings');
if (player && settings && JSON.parse(settings).autoPlay) {
if (entry.isIntersecting) {
player.play();
} else {
Expand Down

0 comments on commit ef3285e

Please sign in to comment.