GoogleForCreators / web-stories-wp

Web Stories for WordPress
https://wp.stories.google
Apache License 2.0
765 stars 177 forks source link

Add support for `<amp-story-audio-sticker>` #13440

Closed swissspidy closed 3 months ago

swissspidy commented 1 year ago

Feature Description

This new amp-story-audio-sticker extension has been added recently, see https://github.com/ampproject/amphtml/pull/39184

https://github.com/GoogleForCreators/web-stories-wp/assets/841956/85ab1728-3c76-4d20-9106-d6eaa7da54ac

No limits in how many stickers can be added to a story.

Color of the sticker drop shadow and outline can be customized.

Stickers can be added in two different sizes:

The following stickers exist:

Accepted Value Pre-tap Image Post-tap Image
“headphone-cat” Cat Pre-tap Cat Post-tap
“tape-player” Player Pre-tap Player Post-tap
“loud-speaker” Speaker Pre-tap Speaker Post-tap
“audio-cloud” Cloud Pre-tap Cloud Post-tap

Alternatives Considered

Additional Context

Currently blocked by:

swissspidy commented 12 months ago

From chatting with @AnuragVasanwala:

swissspidy commented 10 months ago

Some thoughts on implementation details:

packages/element-library

packages/output

KSES.php

In the editor UI

swissspidy commented 9 months ago

From our discussion just now:

To detect whether a story has any audio (untested but should work):

  const hasAudioAnywhere = useStory(
    ({ state }) =>
      state.story.backgroundAudio ||
      state.pages.some(
        (page) =>
          page.backgroundAudio ||
          page.elements
            .filter(elementIs.video)
            .some((element) => !element.resource.isMuted)
      )
  );