diff --git a/examples/amp-story/helloworld-bookend.html b/examples/amp-story/helloworld-bookend.html new file mode 100644 index 000000000000..f27814020105 --- /dev/null +++ b/examples/amp-story/helloworld-bookend.html @@ -0,0 +1,52 @@ + + + + + + + My Story + + + + + + + + + + + +

Cover page - manual advance

+

3 page story with a bookend at the end

+
+
+ + + +

Page 1 - auto advance after 3s

+
+
+ + + +

Page 2 - manual advance

+
+
+
+ + diff --git a/examples/amp-story/progress-bar.html b/examples/amp-story/progress-bar.html new file mode 100644 index 000000000000..e4a48681a586 --- /dev/null +++ b/examples/amp-story/progress-bar.html @@ -0,0 +1,95 @@ + + + + + + + + + My Story + + + + + + + + + + + +

Progress Bar examples with bookend

+

This is the cover page. It does not have auto-advance enabled

+
+
+ + + +

Auto advance page

+

This page has auto-advance enabled

+
+
+ + + +

Short version of video

+ + +
+
+ + + +

Full length video

+ + +
+
+ + + + + +

Fourth Page

+

This is the fourth page of this story.

+
+
+
+ + diff --git a/examples/av/ForBiggerJoyrides-short.mp4 b/examples/av/ForBiggerJoyrides-short.mp4 new file mode 100644 index 000000000000..b50df8693869 Binary files /dev/null and b/examples/av/ForBiggerJoyrides-short.mp4 differ diff --git a/extensions/amp-story/0.1/page-advancement.js b/extensions/amp-story/0.1/page-advancement.js index 9ef9f958912a..d2fec90a87c2 100644 --- a/extensions/amp-story/0.1/page-advancement.js +++ b/extensions/amp-story/0.1/page-advancement.js @@ -259,12 +259,16 @@ class ManualAdvancement extends AdvancementConfig { super(); this.element_ = element; this.clickListener_ = this.maybePerformNavigation_.bind(this); + this.hasAutoAdvanceStr_ = this.element_.getAttribute('auto-advance-after'); } /** @override */ start() { super.start(); this.element_.addEventListener('click', this.clickListener_, true); + if (!this.hasAutoAdvanceStr_) { + super.onProgressUpdate(); + } } /** @override */ diff --git a/gulpfile.js b/gulpfile.js index af26cfdb472d..6b42f2bc5316 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -615,7 +615,7 @@ function performBuild(watch) { buildExaminer({watch: watch}), buildSw({watch: watch}), buildWebWorker({watch: watch}), - buildExtensions({bundleOnlyIfListedInFiles: watch}), + buildExtensions({bundleOnlyIfListedInFiles: !watch, watch: watch}), compile(watch), ]); });