Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
JMM
Experienced
Topic Author
Posts: 143
Joined: 02 Aug 2021, 11:18

Audio Player Plugin use on only 1 specific gallery AND its sub-galleries

08 Jul 2023, 05:08

Hello, Karl,

I have no idea if X3 is capable of doing the following, and quite likely I am (yet again) trying to do the impossible with X3  :upside_down:.

I wish to use the Audio Player Plugin on one of my X3 sites.  I note your recommendation to:
Only include audio if you really need to. Audio on websites is not considered good practice and will hog the bandwidth of your visitors.
I will have a warning to the users, before they enter that gallery (folder), that it contains audio and that they might wish to turn their volume down, or mute their speakers if the audio will disturb other people around them  :slight_smile:.

The audio file that I wish to use is just over 18-minutes long, and I wish to use it on only 1 of my galleries HERE and its sub-galleries (WARNING TO YOU: Lower your speakers  :sunglasses:), not on my entire X3 site.

While experimenting, when I place that MP3 file in the /custom/audio folder, I can navigate to & from all the sub-galleries and that audio file continues to play continously with no interruptions, which is exactly how I wish the audio to play.

But again, I wish for that audio file to play only when users end up in that 1 specific gallery & all of its sub-galleries, and not when the user is outside of that 1 specific gallery.

Looking at this:
You can also upload mp3 files directly into your pages, in which case they will play when the specific page is visited.
...when I disable that audio file in the /custom/audio folder and instead have it located in that 1 specific gallery that I want it to play from, the audio file plays fine, but only while I'm in that 1 actual gallery... when I go into any of the sub-galleries (folders) in that gallery with the audio file, the audio stops, which is exact the way X3 says it works:
in which case they will play when the specific page is visited.
So it would seem that in order for this to work for me, I would need that MP3 file to be located in X3's default /custom/audio folder, but somehow tell X3 to play that audio file only when the user is in that 1 specific gallery and/or any of its sub-galleries, and nowhere else.

Am I (yet again) wishing for X3 to do the impossible, or would there be a simple way of accomplishing this?

Thank you in advance & have yourself a great day.

Regards,
John
Location: Burlington (Toronto-ish), Ontario, Canada
Self-hosted using Abyss Web server:   AuroraWings.me   |   GalleryWings.com   |   GenealogyWings.com/Galleries   |   PanAurora-Studio.com   |
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13929
Joined: 30 Sep 2006, 03:37

Re: Audio Player Plugin use on only 1 specific gallery AND its sub-galleries

08 Jul 2023, 05:33

Ok, so basically X3 can do this:
  1. Global audio ENABLED, can be disabled on a per-folder basis.
  2. Global audio DISABLED, can be enabled on a per-folder basis.
  3. Folder-specific audio (folder only).
There is no option to set audio enabled on ONE folder, and then have this "inherited" upon subfolders. Your most practical solution would be #2, upload audio to /custom/audio, keep it disabled by default (from Settings > Audio), and then enable the audio for each folder where you want the audio to play. This isn't too complicated, as you simply need to enable the audio for each page (subfolder) where you want it enabled.

Personally, I wouldn't bother with any "warnings". The point is, audio may or may not be able to play automatically. Depending on the browser, the user may need to click "play" to start the audio. Then following this "click", the audio would thereafter be able to play automatically, also on consecutive visits, because the browser considers the website "trusted" by the user in terms of audio (they have after all clicked play). This is how browsers work to prevent unknown websites from automatically playing audio without the users consent.
 
User avatar
JMM
Experienced
Topic Author
Posts: 143
Joined: 02 Aug 2021, 11:18

Re: Audio Player Plugin use on only 1 specific gallery AND its sub-galleries

08 Jul 2023, 17:47

Hello, Karl, thanks for getting back to me.

2.  Global audio DISABLED, can be enabled on a per-folder basis.
This is what I will go with.

upload audio to /custom/audio, keep it disabled by default (from Settings > Audio)
I've disabled (unchecked) the audio in global Settings > Plugins > Audio Player
Image

and then enable the audio for each folder where you want the audio to play. This isn't too complicated, as you simply need to enable the audio for each page (subfolder) where you want it enabled.
This is where I'm having a problem, even before I initially created this post, as I can't see any place within individual pages (subfolders) where I can enable audio:
Image

Unless you mean for me to enable the audio on the individual folders using a different method?

Thanks in advance.
Location: Burlington (Toronto-ish), Ontario, Canada
Self-hosted using Abyss Web server:   AuroraWings.me   |   GalleryWings.com   |   GenealogyWings.com/Galleries   |   PanAurora-Studio.com   |
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13929
Joined: 30 Sep 2006, 03:37

Re: Audio Player Plugin use on only 1 specific gallery AND its sub-galleries

09 Jul 2023, 01:28

Sorry, I was wrong, option #2 does not exist. Unlike any other "plugins", that can be enabled on a per-page basis, it doesn't quite work like that for audio. If this was possible, it means audio would have to start/stop as the visitors navigates around different pages. Not only is this a challenge for browsers that block audio autoplay, but it would be complicated to implement the logic for each page ... Visitor enters a page with audio enabled: Was previously playing? Try to play, although might fail. Was playing, but previously paused by user? Show audio, but don't play it. Then add to the logics "loop" disabled? Autoplay disabled? Of course, this while the user is navigating between folders with and without audio enabled.

Sorry for the confusion. Audio is either global, or available when uploaded specifically to a folder, which means we can easier generate the logic. One could perhaps add some custom CSS/JS that hides the audio player on all, except some pages ... And then tries to play the audio for those pages, and stop it when navigating to a page where audio is disabled. This feature would ignore "remembering" the state of the users audio (in case they paused it), and blatantly try to play it, and it can't take into consideration failure to autoplay the audio.
 
User avatar
JMM
Experienced
Topic Author
Posts: 143
Joined: 02 Aug 2021, 11:18

Re: Audio Player Plugin use on only 1 specific gallery AND its sub-galleries

09 Jul 2023, 02:46

Completely understood, no problem.

I ended up just placing an obvious (to visitors) label on that gallery, allowing them to click the label to listen to the audio.

Have yourself a great day.
Location: Burlington (Toronto-ish), Ontario, Canada
Self-hosted using Abyss Web server:   AuroraWings.me   |   GalleryWings.com   |   GenealogyWings.com/Galleries   |   PanAurora-Studio.com   |