Skip to content

Treat "autoplay" on media elements (video, audio) as data-autoplay #4658

@alvarotrigo

Description

@alvarotrigo

Right now fullPage.js only automatically plays videos when reaching the section if they contain the attribute data-autoplay.
However, it could make sense to automatically apply the same behaviour to elements containing autoplay.

The developer would expect those to automatically play too.

So, while it's true that developers might want to apply data-autoplay and not autoplay in order to only start playing a video when landing on that specific section, it doesn't seem to make sense to apply autoplay but not data-autoplay.

Whenever autoplay is present, data-autoplay should be too.

Steps to reproduce it

  1. Access https://codepen.io/alvarotrigo/pen/rNEgJzJ
  2. Scroll down
  3. Video won't autoplay

Versions

All browsers and fullPage.js <= 4.0.29

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions