Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
JMM
Experienced
Topic Author
Posts: 154
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   |   PanAurora-Studio.com   |
Externally-hosted using LiteSpeed/Apache Web Server:   GenealogyWings.com/galleries   |
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
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: 154
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   |   PanAurora-Studio.com   |
Externally-hosted using LiteSpeed/Apache Web Server:   GenealogyWings.com/galleries   |
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
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: 154
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   |   PanAurora-Studio.com   |
Externally-hosted using LiteSpeed/Apache Web Server:   GenealogyWings.com/galleries   |
 
pinkrabbit1357
Posts: 19
Joined: 28 Aug 2022, 18:02

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

29 Jan 2024, 12:10

I have some pages that contain videos only and each video has its own track so I can not have audio in these video pages. I tried to disable the audio in the page JSON but didnt work so I found a workaround: download a 1 second "no sound" mp3 then upload it to your page gallery, that way this "no sound" mp3 overwrites the default sample mp3 and does not interfere with my video tracks. hope this helps.
 
User avatar
JMM
Experienced
Topic Author
Posts: 154
Joined: 02 Aug 2021, 11:18

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

29 Jan 2024, 12:32

pinkrabbit1357 wrote: I have some pages that contain videos only and each video has its own track so I can not have audio in these video pages. I tried to disable the audio in the page JSON but didnt work so I found a workaround: download a 1 second "no sound" mp3 then upload it to your page gallery, that way this "no sound" mp3 overwrites the default sample mp3 and does not interfere with my video tracks. hope this helps.
If I understand you correctly, you have some pages that contain videos, but you do not want those pages to have any audio when those videos are playing, is that correct?

If so, there is a product that I use called VideoProc, with which you can open video files, and then extract only the video to a new video file without any audio.  The result is an identical video, but with no audio at all  :relaxed:.  Although I have the paid version of VideoProc, I believe that their free version can remove the audio as well.

Don't know if that product is of any use to you.

Regards,
John
Location: Burlington (Toronto-ish), Ontario, Canada
Self-hosted using Abyss Web Server:   AuroraWings.me   |   GalleryWings.com   |   PanAurora-Studio.com   |
Externally-hosted using LiteSpeed/Apache Web Server:   GenealogyWings.com/galleries   |
 
pinkrabbit1357
Posts: 19
Joined: 28 Aug 2022, 18:02

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

29 Jan 2024, 12:46

My dilemma was that: I did not want to disable audio globally because I only wanted to disable the default audio in my video pages when videos are playing as I have my own audio in the video clips. Since I could not find a way to disable the default audio per folder/page, I used the workaround mentioned above. maybe this workaround could help someone who has the same dilemma as I did. 
 
User avatar
JMM
Experienced
Topic Author
Posts: 154
Joined: 02 Aug 2021, 11:18

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

29 Jan 2024, 13:19

pinkrabbit1357 wrote: My dilemma was that: I did not want to disable audio globally because I only wanted to disable the default audio in my video pages when videos are playing as I have my own audio in the video clips. Since I could not find a way to disable the default audio per folder/page, I used the workaround mentioned above. maybe this workaround could help someone who has the same dilemma as I did. 
Understood.  Nice work-arfound... I'll have to try to remember your trick in case in the future I need to do the same.
Location: Burlington (Toronto-ish), Ontario, Canada
Self-hosted using Abyss Web Server:   AuroraWings.me   |   GalleryWings.com   |   PanAurora-Studio.com   |
Externally-hosted using LiteSpeed/Apache Web Server:   GenealogyWings.com/galleries   |
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

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

29 Jan 2024, 23:22

pinkrabbit1357 wrote: I have some pages that contain videos only and each video has its own track so I can not have audio in these video pages. I tried to disable the audio in the page JSON but didnt work so I found a workaround: download a 1 second "no sound" mp3 then upload it to your page gallery, that way this "no sound" mp3 overwrites the default sample mp3 and does not interfere with my video tracks. hope this helps.
Seems like a good workaround. Thanks for sharing.

The main problem, is that you can't easily just assume to turn off and on (restart) audio from a website whenever you want. This is why browsers often require audio buttons to explicitly be "clicked" by user, before the audio from the website is trusted. Once it's already playing, you can likely control it. Another solution would be to then build a javascript mechanism that "stops" the audio on your specific pages ... But then you would also want to "start" it again when navigating away from the page, but only if the audio was already playing when the visitor navigated to the current page ... as you can see, it gets a bit messy trying to do it "properly" :thinking: