File tree Expand file tree Collapse file tree
packages/web-component/src
components/read-along-component Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import {
2020 extractPages ,
2121 extractAlignment ,
2222 isFileAvailable ,
23+ isIOS ,
2324 getUserPreferences ,
2425 USER_PREFERENCE_VERSION ,
2526 setUserPreferences ,
@@ -1200,6 +1201,7 @@ export class ReadAlongComponent {
12001201 // load basic Howl
12011202 this . audio_howl = new Howl ( {
12021203 src : [ this . audio ] ,
1204+ html5 : isIOS ( ) ,
12031205 preload : false ,
12041206 } ) ;
12051207 // Once loaded, get duration and build Sprite
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ export function zip(arrays): Array<any[]> {
1717 } ) ;
1818}
1919
20+ export function isIOS ( ) : boolean {
21+ return / i P a d | i P h o n e | i P o d / . test ( navigator . userAgent ) ;
22+ }
23+
2024/**
2125 * Return pages from readalong XML file
2226 * @param {string } - the path to the readalong file
@@ -98,7 +102,7 @@ export function extractAlignment(parsed_text: Array<Page>): Alignment {
98102 */
99103export var Sprite = function ( options ) {
100104 var self = this ;
101-
105+ const html5 = isIOS ( ) ;
102106 self . sounds = [ ] ;
103107 // Setup the options to define this sprite display.
104108 self . _sprite = options . sprite ;
@@ -120,6 +124,7 @@ export var Sprite = function (options) {
120124 src : options . src ,
121125 sprite : options . sprite ,
122126 rate : options . rate ,
127+ html5 : html5 ,
123128 onend : function ( ) {
124129 self . _reading$ . next ( "" ) ; //flush the pipe
125130 } ,
You can’t perform that action at this time.
0 commit comments