View Single Post
Old 08-17-2018, 01:54 PM   #1
Barra
Junior Member
Barra began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Aug 2018
Device: none
Stop audio on another page for Epub3

I have audio clips on each page in my book. However, if the user chooses to play a clip, I wish for only one clip to be heard at a time. I have solved this for a single page using JavaScript but I don’t know how to do it for multiple pages. In other words I don’t want multiple audio clips playing at once. And I want all audio to stop when the user turns the page.

I thought that maybe I could store a “current page” variable in a cookie or session with each page monitoring this variable using JavaScript. But I read somewhere that cookies can’t be shared between pages. Is this true and how can I stop the audio playing when a new clip is chosen?
Barra is offline   Reply With Quote