Search…

X3 Photo Gallery Support Forums

Search…
 
daniel
Experienced
Topic Author
Posts: 27
Joined: 28 Sep 2007, 12:42

Audio museum type

Yesterday, 09:31

Hello, I need expert help, I am unable to program this. 

Here's my problem: 
I have a page with 60 images. 
For each image, I have an audio.mp3 comment that is its own, of the museum type. That is 60 mp3.
I would like to have a button at the title level of the image to access his audio comment.mp3. 

The button to have an optional listening to the comment of the image. 

Could you help me, thank you.
In reality I have six pages of 60 images or 360 mp3. But I think the reasoning for one page can be applied to the other five remaining.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14455
Joined: 30 Sep 2006, 03:37

Re: Audio museum type

Yesterday, 21:06

Ok, so there are a couple of minor challenges here.

Automation
First of all, if you have images and audio files in the same dir, with matching file names, you could easily create a caption template. For example if you have image name ABC123.jpg, there should be audio file audio_ABC123.jpg (or a similar pattern that allows us to match image file name with audio file names).

With the above, we can go to page settings > gallery > captions > caption defaults > default image description and create a template-based description, linking to each image's audio `{path}/audio_{file_name}.mp3`.

How to play the audio
Did you put any idea into how you want the audio to play? Just a "play" button or some text link "Play commentary"? The easy solution here, would be to simply open the audio in a new window or popup. However, I am guessing you want a more streamlined solution, where the audio is simply played in the background on X3 website? This would require some javascript: 1. create a global "hidden" audioplayer on the page, 2. Have links for each image that trigger and play specific audio files, in the global hidden audioplayer on the page.

Then of course it could get more complicated, if you want each button/link at each image to be able to start/stop the audio, and/or if you want the button to display the current play state of the current commentary (eg it changes changes text or color while playing, and reverts when complete).