Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [Story Preview] Allow amp-story-360 in preview mode #38229

Merged
merged 7 commits into from
Jun 8, 2022
10 changes: 10 additions & 0 deletions extensions/amp-story-360/0.1/amp-story-360.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ class CameraAnimation {
}

export class AmpStory360 extends AMP.BaseElement {
/** @override */
static previewAllowed(element) {
// We can assume that images are cached, but the same is not necessarily
// true for videos. We only allow preview mode for `AmpStory360` when it
// uses cached sources, because requests for origin sources cannot be made
// due to privacy concerns.
const usesVideo = element.querySelector('amp-video');
return !usesVideo;
}

/** @param {!AmpElement} element */
constructor(element) {
super(element);
Expand Down