| 
			
			 | 
		#1 | 
| 
			
			
			
			 Junior Member 
			
			![]() 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?  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 5 
				Karma: 10 
				Join Date: Aug 2018 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I have tested and it looks like session data isn't shared between pages in ibooks. How do I stop audio playing on one page when I move to another page?
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Bookmaker & Cat Slave 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503 
				Karma: 158448243 
				Join Date: Apr 2010 
				Location: Phoenix, AZ 
				
				
				Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 Do-er, All of the Things 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 26 
				Karma: 1970 
				Join Date: Jan 2017 
				Location: Midwest 
				
				
				Device: Androids 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			It might be a slightly different use case for what you're trying to do, but have you looked into using "media-overlays" (e.g. SMIL files + audio + XML Markup + OPF udpates)? 
		
	
		
		
		
		
		
		
		
		
		
		
	
	https://www.w3.org/publishing/epub3/...aoverlays.html  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | |
| 
			
			
			
			 Resident Curmudgeon 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,782 
				Karma: 150249619 
				Join Date: Nov 2006 
				Location: Roslindale, Massachusetts 
				
				
				Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#6 | |
| 
			
			
			
			 Bookmaker & Cat Slave 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503 
				Karma: 158448243 
				Join Date: Apr 2010 
				Location: Phoenix, AZ 
				
				
				Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Hitch  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Do-er, All of the Things 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 26 
				Karma: 1970 
				Join Date: Jan 2017 
				Location: Midwest 
				
				
				Device: Androids 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I admittedly don't know for certain, but I thought most of the majors did and what most considered 'best practice' if you're trying to create something like a "Read Along" book. But, it too early/I've not have any coffee for me to get excited about finding sources to confirm. :-P 
		
	
		
		
		
		
		
		
		
		
		
		
	
	IMHO: I would hope that readers/apps support this part of the spec for it's usefulness (and roots in accessibility), over a custom JavaScript implementation. I appreciate that it might not meet the need of the use case of the EPUB creator, but I think it allows for a better, more consistent UX.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 Resident Curmudgeon 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,782 
				Karma: 150249619 
				Join Date: Nov 2006 
				Location: Roslindale, Massachusetts 
				
				
				Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Advanced ePub 3 features is a crap shoot outside of iBooks.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
| Tags | 
| audio, epub, epub 3 | 
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| converting ePub3 with embedded audio for Kindle Fire? | curtf | Kindle Developer's Corner | 6 | 03-21-2017 05:05 PM | 
| feature request: aeneas and epub3 audio books | eclipse123 | Calibre | 5 | 01-20-2016 05:30 PM | 
| Audio Controls in ePub3 | josephmwheeler | ePub | 23 | 06-03-2014 08:09 AM | 
| EPUB3 - Float audio pane with page turns | _savage | ePub | 22 | 01-30-2013 02:38 AM | 
| Audio Controls in ePub3 | josephmwheeler | Apple Devices | 2 | 07-06-2012 01:39 PM |