From 2ae0120146804fb799dad8079c3d36c8f52a4582 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Thu, 9 Sep 2021 00:03:38 +0300 Subject: [PATCH 1/2] Add play button for Mobile --- src/components/slideshow/slideshow.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/slideshow/slideshow.js b/src/components/slideshow/slideshow.js index 9f82a0ec7..d1514996f 100644 --- a/src/components/slideshow/slideshow.js +++ b/src/components/slideshow/slideshow.js @@ -172,6 +172,8 @@ export default function (options) { html += '
'; if (actionButtonsOnTop) { + html += getIcon('play_arrow', 'btnSlideshowPause slideshowButton', true); + if (appHost.supports('filedownload') && options.user && options.user.Policy.EnableContentDownloading) { html += getIcon('file_download', 'btnDownload slideshowButton', true); } From 2bf4741d9c9f4c44be79d09ff1906c3a47e1d48e Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Thu, 9 Sep 2021 00:06:09 +0300 Subject: [PATCH 2/2] Autoplay when Play or Shuffle --- src/components/slideshow/slideshow.js | 4 +++- src/controllers/list.js | 9 ++++++--- src/plugins/photoPlayer/plugin.js | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/slideshow/slideshow.js b/src/components/slideshow/slideshow.js index d1514996f..8f4559004 100644 --- a/src/components/slideshow/slideshow.js +++ b/src/components/slideshow/slideshow.js @@ -349,7 +349,7 @@ export default function (options) { minRatio: 1, toggle: true }, - autoplay: !options.interactive, + autoplay: !options.interactive || !!options.autoplay, keyboard: { enabled: true }, @@ -378,6 +378,8 @@ export default function (options) { if (useFakeZoomImage) { swiperInstance.on('zoomChange', onZoomChange); } + + if (swiperInstance.autoplay?.running) onAutoplayStart(); } /** diff --git a/src/controllers/list.js b/src/controllers/list.js index b50b5f91f..b34848bf1 100644 --- a/src/controllers/list.js +++ b/src/controllers/list.js @@ -666,12 +666,14 @@ class ItemsView { if (currentItem && !self.hasFilters) { playbackManager.play({ - items: [currentItem] + items: [currentItem], + autoplay: true }); } else { getItems(self, self.params, currentItem, null, null, 300).then(function (result) { playbackManager.play({ - items: result.Items + items: result.Items, + autoplay: true }); }); } @@ -701,7 +703,8 @@ class ItemsView { } else { getItems(self, self.params, currentItem, 'Random', null, 300).then(function (result) { playbackManager.play({ - items: result.Items + items: result.Items, + autoplay: true }); }); } diff --git a/src/plugins/photoPlayer/plugin.js b/src/plugins/photoPlayer/plugin.js index 42ffd3c7d..aa3ba5f36 100644 --- a/src/plugins/photoPlayer/plugin.js +++ b/src/plugins/photoPlayer/plugin.js @@ -22,6 +22,8 @@ export default class PhotoPlayer { startIndex: index, interval: 11000, interactive: true, + // playbackManager.shuffle has no options. So treat 'shuffle' as a 'play' action + autoplay: options.autoplay || options.shuffle, user: result });