@internetarchive/bookreader 5.0.0-64 → 5.0.0-65

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"plugins/plugin.tts.js","mappings":";gtDACAA,EAAA,kBAAAC,CAAA,MAAAA,EAAA,GAAAC,EAAAC,OAAAC,UAAAC,EAAAH,EAAAI,eAAAC,EAAAJ,OAAAI,gBAAA,SAAAC,EAAAC,EAAAC,GAAAF,EAAAC,GAAAC,EAAAC,KAAA,EAAAC,EAAA,mBAAAC,OAAAA,OAAA,GAAAC,EAAAF,EAAAG,UAAA,aAAAC,EAAAJ,EAAAK,eAAA,kBAAAC,EAAAN,EAAAO,aAAA,yBAAAC,EAAAZ,EAAAC,EAAAE,GAAA,OAAAR,OAAAI,eAAAC,EAAAC,EAAA,CAAAE,MAAAA,EAAAU,YAAA,EAAAC,cAAA,EAAAC,UAAA,IAAAf,EAAAC,EAAA,KAAAW,EAAA,aAAAI,GAAAJ,EAAA,SAAAZ,EAAAC,EAAAE,GAAA,OAAAH,EAAAC,GAAAE,CAAA,WAAAc,EAAAC,EAAAC,EAAAC,EAAAC,GAAA,IAAAC,EAAAH,GAAAA,EAAAvB,qBAAA2B,EAAAJ,EAAAI,EAAAC,EAAA7B,OAAA8B,OAAAH,EAAA1B,WAAA8B,EAAA,IAAAC,EAAAN,GAAA,WAAAtB,EAAAyB,EAAA,WAAArB,MAAAyB,EAAAV,EAAAE,EAAAM,KAAAF,CAAA,UAAAK,EAAAC,EAAA9B,EAAA+B,GAAA,WAAAC,KAAA,SAAAD,IAAAD,EAAAG,KAAAjC,EAAA+B,GAAA,OAAAf,GAAA,OAAAgB,KAAA,QAAAD,IAAAf,EAAA,EAAAvB,EAAAwB,KAAAA,EAAA,IAAAiB,EAAA,YAAAX,IAAA,UAAAY,IAAA,UAAAC,IAAA,KAAAC,EAAA,GAAAzB,EAAAyB,EAAA/B,GAAA,8BAAAgC,EAAA3C,OAAA4C,eAAAC,EAAAF,GAAAA,EAAAA,EAAAG,EAAA,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GAAe0nB,YACtCl5B,EAAe,IAAI0R,GAQa7C,GAAoC,iBAAnBA,EAAO3kB,SAMxD2kB,EAAO3kB,QAAQwnB,aAAeA,EAC9B7C,EAAO3kB,QAAQ8V,aAAeA,QAmD7B,KArBD,aAiBE,MAAO,CACLlP,YAAa4gB,EACbynB,YAXF,SAAqBC,GACnB,IAAK/0B,EAAOrE,cAAgBo5B,aAAqBxK,SAAU,CACzD,IAAIz6B,EAAWilC,EAAU1nB,GACrBvd,aAAoBud,IACtBrN,EAAOrE,aAAe7L,EAE1B,CACA,OAAOkQ,EAAOrE,YAChB,EAKD,gCAOHqE,EAAOqN,aAAeA,EAQtBrN,EAAOrE,aAAeA,CAEtB,CAxnMA,CAwnMEqE","sources":["webpack://@internetarchive/bookreader/./src/plugins/tts/PageChunk.js","webpack://@internetarchive/bookreader/./src/plugins/tts/PageChunkIterator.js","webpack://@internetarchive/bookreader/./src/plugins/tts/AbstractTTSEngine.js","webpack://@internetarchive/bookreader/./src/plugins/tts/FestivalTTSEngine.js","webpack://@internetarchive/bookreader/./src/util/browserSniffing.js","webpack://@internetarchive/bookreader/./src/plugins/tts/utils.js","webpack://@internetarchive/bookreader/./src/plugins/tts/WebTTSEngine.js","webpack://@internetarchive/bookreader/./src/plugins/tts/plugin.tts.js","webpack://@internetarchive/bookreader/./src/plugins/tts/tooltip_dict.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/number-parse-float.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.object.entries.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.parse-float.js","webpack://@internetarchive/bookreader/./node_modules/iso-language-codes/js/data.js","webpack://@internetarchive/bookreader/./node_modules/jquery.browser/dist/jquery.browser.js","webpack://@internetarchive/bookreader/./node_modules/soundmanager2/script/soundmanager2.js"],"sourcesContent":["/**\n * Class to manage a 'chunk' (approximately a paragraph) of text on a page.\n */\nexport default class PageChunk {\n /**\n * @param {number} leafIndex\n * @param {number} chunkIndex\n * @param {string} text\n * @param {DJVURect[]} lineRects\n */\n constructor(leafIndex, chunkIndex, text, lineRects) {\n this.leafIndex = leafIndex;\n this.chunkIndex = chunkIndex;\n this.text = text;\n this.lineRects = lineRects;\n }\n\n /**\n * @param {string} server\n * @param {string} bookPath\n * @param {number} leafIndex\n * @return {Promise<PageChunk[]>}\n */\n static async fetch(server, bookPath, leafIndex) {\n const chunks = await $.ajax({\n type: 'GET',\n url: `https://${server}/BookReader/BookReaderGetTextWrapper.php`,\n dataType:'jsonp',\n cache: true,\n data: {\n path: `${bookPath}_djvu.xml`,\n page: leafIndex\n }\n });\n return PageChunk._fromTextWrapperResponse(leafIndex, chunks);\n }\n\n /**\n * Convert the response from BookReaderGetTextWrapper.php into a {@link PageChunk} instance\n * @param {number} leafIndex\n * @param {Array<[String, ...DJVURect[]]>} chunksResponse\n * @return {PageChunk[]}\n */\n static _fromTextWrapperResponse(leafIndex, chunksResponse) {\n return chunksResponse.map((c, i) => {\n const correctedLineRects = PageChunk._fixChunkRects(c.slice(1));\n const correctedText = PageChunk._removeDanglingHyphens(c[0]);\n return new PageChunk(leafIndex, i, correctedText, correctedLineRects);\n });\n }\n\n /**\n * @private\n * Sometimes the first rectangle will be ridiculously wide/tall. Find those and fix them\n * *NOTE*: Modifies the original array and returns it.\n * *NOTE*: This should probably be fixed on the petabox side, and then removed here\n * Has 2 problems:\n * - If the rect is the last rect on the page (and hence the only rect in the array),\n * the rect's size isn't fixed\n * - Because this relies on the second rect, there's a chance it won't be the right\n * width\n * @param {DJVURect[]} rects\n * @return {DJVURect[]}\n */\n static _fixChunkRects(rects) {\n if (rects.length < 2) return rects;\n\n const [firstRect, secondRect] = rects;\n const [left, bottom, right] = firstRect;\n const width = right - left;\n const secondHeight = secondRect[1] - secondRect[3];\n const secondWidth = secondRect[2] - secondRect[0];\n const secondRight = secondRect[2];\n\n if (width > secondWidth * 30) {\n // Set the end to be the same\n firstRect[2] = secondRight;\n // And the top to be the same height\n firstRect[3] = bottom - secondHeight;\n }\n\n return rects;\n }\n\n /**\n * Remove \"dangling\" hyphens from read aloud text to avoid TTS stuttering\n * @param {string} text\n * @return {string}\n */\n static _removeDanglingHyphens(text) {\n // Some books mis-OCR a dangling hyphen as a ¬ (mathematical not sign) . Since in math\n // the not sign should not appear followed by a space, we think we can safely assume\n // this should be replaced.\n return text.replace(/[-¬]\\s+/g, '');\n }\n}\n\n/**\n * @typedef {[number, number, number, number]} DJVURect\n * coords are in l,b,r,t order\n */\n","import PageChunk from './PageChunk.js';\n\n/**\n * Class that iterates over the page chunks of a book; caching/buffering\n * as much as possible to try to ensure a smooth experience.\n */\nexport default class PageChunkIterator {\n /**\n * @param {number} pageCount total number of pages\n * @param {number} start page to start on\n * @param {PageChunkIteratorOptions} opts\n */\n constructor(pageCount, start, opts) {\n this.pageCount = pageCount;\n this.opts = Object.assign({}, DEFAULT_OPTS, opts);\n /** Position in the chunk sequence */\n this._cursor = { page: start, chunk: 0 };\n /** @type {Object<number, PageChunk[]>} leaf index -> chunks*/\n this._bufferedPages = {};\n /** @type {Object<number, PromiseLike<PageChunk[]>} leaf index -> chunks*/\n this._bufferingPages = {};\n /**\n * @type {Promise} promise that manages cursor modifications so that they\n * happen in order triggered as opposed to order the server responds\n **/\n this._cursorLock = Promise.resolve();\n }\n\n /**\n * Get the next chunk\n * @return {PromiseLike<\"__PageChunkIterator.AT_END__\" | PageChunk>}\n */\n next() {\n return this._cursorLock = this._cursorLock\n .then(() => this._nextUncontrolled());\n }\n\n /**\n * Sends the cursor back 1\n * @return {Promise}\n **/\n decrement() {\n return this._cursorLock = this._cursorLock\n .then(() => this._decrementUncontrolled());\n }\n\n /**\n * Gets without ensuring synchronization. Since this iterator has a lot of async\n * code, calling e.g. \"next\" twice (before the first call to next has finished)\n * would cause the system to be in a weird state. To avoid that, we make sure calls\n * to next and decrement (functions that modify the cursor) are synchronized,\n * so that regardless how long it takes for one to respond, they'll always be executed\n * in the correct order.\n * @return {PromiseLike<\"__PageChunkIterator.AT_END__\" | PageChunk>}\n */\n async _nextUncontrolled() {\n if (this._cursor.page == this.pageCount) {\n return Promise.resolve(PageChunkIterator.AT_END);\n }\n this._recenterBuffer(this._cursor.page);\n const chunks = await this._fetchPageChunks(this._cursor.page);\n if (this._cursor.chunk == chunks.length) {\n this._cursor.page++;\n this._cursor.chunk = 0;\n return this._nextUncontrolled();\n }\n return chunks[this._cursor.chunk++];\n }\n\n /**\n * Decrements without ensuring synchronization. (See {@link PageChunkIterator._nextUncontrolled});\n * @return {Promise}\n */\n _decrementUncontrolled() {\n let cursorChangePromise = Promise.resolve();\n\n if (this._cursor.chunk > 0) {\n this._cursor.chunk--;\n } else if (this._cursor.page > 0) {\n this._cursor.page--;\n // Go back possibly multiple pages, because pages can be blank\n cursorChangePromise = this._fetchPageChunks(this._cursor.page)\n .then(prevPageChunks => {\n if (prevPageChunks.length == 0) return this._decrementUncontrolled();\n else this._cursor.chunk = prevPageChunks.length - 1;\n });\n }\n\n return cursorChangePromise\n .then(() => this._fetchPageChunks(this._cursor.page));\n }\n\n /**\n * Recenter the buffer around the provided page index\n * @param {number} index\n */\n _recenterBuffer(index) {\n const start = Math.max(0, index - this.opts.pageBufferSize);\n const end = Math.min(this.pageCount, index + this.opts.pageBufferSize + 1);\n for (let i = start; i < end; i++) {\n this._fetchPageChunks(i);\n }\n\n this._removePageFromBuffer(start - 1);\n this._removePageFromBuffer(end + 1);\n }\n\n /**\n * @param {number} index\n */\n _removePageFromBuffer(index) {\n delete this._bufferingPages[index];\n delete this._bufferedPages[index];\n }\n\n /**\n * Fetches the chunks on a page; checks the buffer, so it won't make unnecessary\n * requests if it's called multiple times for the same index.\n * @param {number} index\n * @return {Promise<PageChunk[]>}\n */\n _fetchPageChunks(index) {\n if (index in this._bufferingPages) return this._bufferingPages[index];\n if (index in this._bufferedPages) return Promise.resolve(this._bufferedPages[index]);\n\n this._bufferingPages[index] = this._fetchPageChunksDirect(index)\n .then(chunks => {\n delete this._bufferingPages[index];\n this._bufferedPages[index] = chunks;\n return chunks;\n });\n\n return this._bufferingPages[index];\n }\n\n /**\n * Fetches a page without checking buffer\n * @param {number} index\n */\n _fetchPageChunksDirect(index) {\n return PageChunk.fetch(this.opts.server, this.opts.bookPath, index);\n }\n}\n\nPageChunkIterator.AT_END = \"__PageChunkIterator.AT_END__\";\n\n/** @type {PageChunkIteratorOptions} */\nconst DEFAULT_OPTS = {\n server: null,\n bookPath: null,\n pageBufferSize: 2,\n};\n\n/**\n * @typedef {Object} PageChunkIteratorOptions\n * @property {string} server\n * @property {string} bookPath\n * @property {number} [pageBufferSize] number of pages to buffer before/after the current page\n */\n","import PageChunkIterator from './PageChunkIterator.js';\n/** @typedef {import('./utils.js').ISO6391} ISO6391 */\n/** @typedef {import('./PageChunk.js')} PageChunk */\n\n/**\n * @export\n * @typedef {Object} TTSEngineOptions\n * @property {String} server\n * @property {String} bookPath\n * @property {ISO6391} bookLanguage\n * @property {Function} onLoadingStart\n * @property {Function} onLoadingComplete\n * @property {Function} onDone called when the entire book is done\n * @property {function(PageChunk): PromiseLike} beforeChunkPlay will delay the playing of the chunk\n * @property {function(PageChunk): void} afterChunkPlay fires once a chunk has fully finished\n */\n\n/**\n * @typedef {Object} AbstractTTSSound\n * @property {PageChunk} chunk\n * @property {boolean} loaded\n * @property {number} rate\n * @property {SpeechSynthesisVoice} voice\n * @property {(callback: Function) => void} load\n * @property {() => PromiseLike} play\n * @property {() => Promise} stop\n * @property {() => void} pause\n * @property {() => void} resume\n * @property {() => void} finish force the sound to 'finish'\n * @property {number => void} setPlaybackRate\n * @property {SpeechSynthesisVoice => void} setVoice\n **/\n\n/** Handling bookreader's text-to-speech */\nexport default class AbstractTTSEngine {\n /**\n * @protected\n * @param {TTSEngineOptions} options\n */\n constructor(options) {\n this.playing = false;\n this.paused = false;\n this.opts = options;\n /** @type {PageChunkIterator} */\n this._chunkIterator = null;\n /** @type {AbstractTTSSound} */\n this.activeSound = null;\n this.playbackRate = 1;\n /** Events we can bind to */\n this.events = $({});\n /** @type {SpeechSynthesisVoice} */\n this.voice = null;\n // Listen for voice changes (fired by subclasses)\n this.events.on('voiceschanged', this.updateBestVoice);\n this.events.trigger('voiceschanged');\n }\n\n /**\n * @abstract\n * @return {boolean}\n */\n static isSupported() { throw new Error(\"Unimplemented abstract class\"); }\n\n /**\n * @abstract\n * @return {SpeechSynthesisVoice[]}\n */\n getVoices() { throw new Error(\"Unimplemented abstract class\"); }\n\n /** @abstract */\n init() { return null; }\n\n updateBestVoice = () => {\n this.voice = AbstractTTSEngine.getBestBookVoice(this.getVoices(), this.opts.bookLanguage);\n }\n\n /**\n * @param {number} leafIndex\n * @param {number} numLeafs total number of leafs in the current book\n */\n start(leafIndex, numLeafs) {\n this.playing = true;\n this.opts.onLoadingStart();\n\n this._chunkIterator = new PageChunkIterator(numLeafs, leafIndex, {\n server: this.opts.server,\n bookPath: this.opts.bookPath,\n pageBufferSize: 5,\n });\n\n this.step();\n this.events.trigger('start');\n }\n\n stop() {\n if (this.activeSound) this.activeSound.stop();\n this.playing = false;\n this._chunkIterator = null;\n this.activeSound = null;\n this.events.trigger('stop');\n }\n\n /** @public */\n pause() {\n const fireEvent = !this.paused && this.activeSound;\n this.paused = true;\n if (this.activeSound) this.activeSound.pause();\n if (fireEvent) this.events.trigger('pause');\n }\n\n /** @public */\n resume() {\n const fireEvent = this.paused && this.activeSound;\n this.paused = false;\n if (this.activeSound) this.activeSound.resume();\n if (fireEvent) this.events.trigger('resume');\n }\n\n togglePlayPause() {\n if (this.paused) this.resume();\n else this.pause();\n }\n\n /** @public */\n jumpForward() {\n if (this.activeSound) this.activeSound.finish();\n }\n\n /** @public */\n async jumpBackward() {\n await Promise.all([\n this.activeSound.stop(),\n this._chunkIterator.decrement()\n .then(() => this._chunkIterator.decrement())\n ]);\n this.step();\n }\n\n /** @param {string} voiceURI */\n setVoice(voiceURI) {\n // if the user actively selects a voice, don't re-choose best voice anymore\n // MS Edge fires voices changed randomly very often\n this.events.off('voiceschanged', this.updateBestVoice);\n this.voice = this.getVoices().find(voice => voice.voiceURI === voiceURI);\n if (this.activeSound) this.activeSound.setVoice(this.voice);\n }\n\n /** @param {number} newRate */\n setPlaybackRate(newRate) {\n this.playbackRate = newRate;\n if (this.activeSound) this.activeSound.setPlaybackRate(newRate);\n }\n\n /** @private */\n async step() {\n const chunk = await this._chunkIterator.next();\n if (chunk == PageChunkIterator.AT_END) {\n this.stop();\n this.opts.onDone();\n return;\n }\n this.opts.onLoadingStart();\n const sound = this.createSound(chunk);\n sound.chunk = chunk;\n sound.rate = this.playbackRate;\n sound.voice = this.voice;\n sound.load(() => this.opts.onLoadingComplete());\n\n this.opts.onLoadingComplete();\n\n await this.opts.beforeChunkPlay(chunk);\n\n if (!this.playing) return;\n\n const playPromise = await this.playSound(sound)\n .then(()=> this.opts.afterChunkPlay(sound.chunk));\n\n if (this.paused) this.pause();\n await playPromise;\n\n if (this.playing) return this.step();\n }\n\n /**\n * @abstract\n * @param {PageChunk} chunk\n * @return {AbstractTTSSound}\n */\n createSound(chunk) { throw new Error(\"Unimplemented abstract class\"); }\n\n /**\n * @param {AbstractTTSSound} sound\n * @return {PromiseLike} promise called once playing finished\n */\n playSound(sound) {\n this.activeSound = sound;\n if (!this.activeSound.loaded) this.opts.onLoadingStart();\n return this.activeSound.play();\n }\n\n /** Convenience wrapper for {@see AbstractTTSEngine.getBestVoice} */\n getBestVoice() {\n return AbstractTTSEngine.getBestBookVoice(this.getVoices(), this.opts.bookLanguage);\n }\n\n /**\n * @private\n * Find the best voice to use given the available voices, the book language, and the user's\n * languages.\n * @param {SpeechSynthesisVoice[]} voices\n * @param {ISO6391} bookLanguage\n * @param {string[]} userLanguages languages in BCP47 format (e.g. en-US). Ordered by preference.\n * @return {SpeechSynthesisVoice | undefined}\n */\n static getBestBookVoice(voices, bookLanguage, userLanguages = navigator.languages) {\n const bookLangVoices = voices.filter(v => v.lang.startsWith(bookLanguage));\n // navigator.languages browser support isn't great yet, so get just 1 language otherwise\n // Sample navigator.languages: [\"en-CA\", \"fr-CA\", \"fr\", \"en-US\", \"en\", \"de-DE\", \"de\"]\n userLanguages = userLanguages || (navigator.language ? [navigator.language] : []);\n\n // user languages that match the book language\n const matchingUserLangs = userLanguages.filter(lang => lang.startsWith(bookLanguage));\n\n // Try to find voices that intersect these two sets\n return AbstractTTSEngine.getMatchingVoice(matchingUserLangs, bookLangVoices) ||\n // no user languages match the books; let's return the best voice for the book language\n (bookLangVoices.find(v => v.default) || bookLangVoices[0])\n // No voices match the book language? let's find a voice in the user's language\n // and ignore book lang\n || AbstractTTSEngine.getMatchingVoice(userLanguages, voices)\n // C'mon! Ok, just read with whatever we got!\n || (voices.find(v => v.default) || voices[0]);\n }\n\n /**\n * @private\n * Get the best voice that matches one of the BCP47 languages (order by preference)\n * @param {string[]} languages in BCP 47 format (e.g. 'en-US', or 'en'); ordered by preference\n * @param {SpeechSynthesisVoice[]} voices voices to choose from\n * @return {SpeechSynthesisVoice | undefined}\n */\n static getMatchingVoice(languages, voices) {\n for (const lang of languages) {\n // Chrome Android was returning voice languages like `en_US` instead of `en-US`\n const matchingVoices = voices.filter(v => v.lang.replace('_', '-').startsWith(lang));\n if (matchingVoices.length) {\n return matchingVoices.find(v => v.default) || matchingVoices[0];\n }\n }\n }\n}\n","import AbstractTTSEngine from './AbstractTTSEngine.js';\nimport { sleep } from '../../BookReader/utils.js';\n/* global soundManager */\nimport 'soundmanager2';\nimport 'jquery.browser';\n\n/** @typedef {import(\"./AbstractTTSEngine.js\").TTSEngineOptions} TTSEngineOptions */\n/** @typedef {import(\"./AbstractTTSEngine.js\").AbstractTTSSound} AbstractTTSSound */\n\n/**\n * @extends AbstractTTSEngine\n * TTS using Festival endpoint\n **/\nexport default class FestivalTTSEngine extends AbstractTTSEngine {\n /** @override */\n static isSupported() {\n return typeof(soundManager) !== 'undefined' && soundManager.supported();\n }\n\n /** @param {TTSEngineOptions} options */\n constructor(options) {\n super(options);\n // $.browsers is sometimes undefined on some Android browsers :/\n // Likely related to when $.browser was moved to npm\n /** @type {'mp3' | 'ogg'} format of audio to get */\n this.audioFormat = $.browser?.mozilla ? 'ogg' : 'mp3'; //eslint-disable-line no-jquery/no-browser\n }\n\n /** @override */\n getVoices() {\n return [\n { default: true, lang: \"en-US\", localService: false, name: \"Festival - English (US)\", voiceURI: null }\n ];\n }\n\n /** @override */\n init() {\n // setup sound manager\n soundManager.setup({\n debugMode: false,\n // Note, there's a bug in Chrome regarding range requests.\n // Flash is used as a workaround.\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=505707\n preferFlash: true,\n url: '/bookreader/BookReader/soundmanager/swf',\n useHTML5Audio: true,\n //flash 8 version of swf is buggy when calling play() on a sound that is still loading\n flashVersion: 9\n });\n }\n\n /**\n * @override\n * @param {number} leafIndex\n * @param {number} numLeafs total number of leafs in the current book\n */\n start(leafIndex, numLeafs) {\n let promise = null;\n\n // Hack for iOS\n if (navigator.userAgent.match(/mobile/i)) {\n promise = this.iOSCaptureUserIntentHack();\n }\n\n promise = promise || Promise.resolve();\n promise.then(() => super.start(leafIndex, numLeafs));\n }\n\n /** @override */\n createSound(chunk) {\n return new FestivalTTSSound(this.getSoundUrl(chunk.text));\n }\n\n /**\n * @private\n * Get URL for audio that says this text\n * @param {String} dataString the thing to say\n * @return {String} url\n */\n getSoundUrl(dataString) {\n return 'https://' + this.opts.server + '/BookReader/BookReaderGetTTS.php?string='\n + encodeURIComponent(dataString)\n + '&format=.' + this.audioFormat;\n }\n\n /**\n * @private\n * Security restrictions require playback to be triggered\n * by a user click/touch. This intention gets lost in the async calls\n * on iOS, but, for some reason, if we start the audio here, it works.\n * See https://stackoverflow.com/questions/12206631/html5-audio-cant-play-through-javascript-unless-triggered-manually-once\n * @return {PromiseLike}\n */\n async iOSCaptureUserIntentHack() {\n const sound = soundManager.createSound({ url: SILENCE_1MS[this.audioFormat] });\n await new Promise(res => sound.play({onfinish: res}));\n sound.destruct();\n }\n}\n\n/** @extends AbstractTTSSound */\nclass FestivalTTSSound {\n /** @param {string} soundUrl **/\n constructor(soundUrl) {\n this.soundUrl = soundUrl;\n /** @type {SMSound} */\n this.sound = null;\n this.rate = 1;\n /** @type {function} calling this resolves the \"play\" promise */\n this._finishResolver = null;\n }\n\n get loaded() {\n return this.sound && this.sound.loaded;\n }\n\n load(onload) {\n this.sound = soundManager.createSound({\n url: this.soundUrl,\n // API recommended, but only fires once play started on safari\n onload: () => {\n if (this.rate != 1) this.sound.setPlaybackRate(this.rate);\n onload();\n },\n onresume: async () => {\n await sleep(25);\n if (this.rate != 1) this.sound.setPlaybackRate(this.rate);\n }\n });\n return this.sound.load();\n }\n\n async play() {\n await new Promise(res => {\n this._finishResolver = res;\n this.sound.play({ onfinish: res });\n });\n this.sound.destruct();\n }\n\n /** @override */\n stop() {\n this.sound.stop();\n return Promise.resolve();\n }\n\n /** @override */\n pause() { this.sound.pause(); }\n /** @override */\n resume() { this.sound.resume(); }\n /** @override */\n setPlaybackRate(rate) {\n this.rate = rate;\n this.sound.setPlaybackRate(rate);\n }\n\n /** @override */\n finish() {\n this.sound.stop();\n this._finishResolver();\n }\n}\n\n/** Needed to capture the audio context for iOS hack. Generated using Audacity. */\nconst SILENCE_1MS = {\n mp3: 'data:audio/mp3;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAAAeTEFNRTMuOTlyBJwAAAAAAAAAADUgJAaUQQABrgAAAnHIf8sZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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+4wQk6RaUOAgAAAAAAAQAeAACSDSAiIpo5jg6PD5AQkRGSEpMTlAAAAAAA4AGADwCAJAWIiIhmjqPD4wMkRGSEpMTkBCUAAAAAAAAAAAAICAgAAAAAAAQAAAAICE9nZ1MABCwAAAAAAAAAFRIAAAIAAAAPBTD1AgEBAAo=',\n};\n","\n/**\n * Checks whether the current browser is a Chrome/Chromium browser\n * Code from https://stackoverflow.com/a/4565120/2317712\n * @param {string} [userAgent]\n * @param {string} [vendor]\n * @return {boolean}\n */\nexport function isChrome(userAgent = navigator.userAgent, vendor = navigator.vendor) {\n return /chrome/i.test(userAgent) && /google inc/i.test(vendor);\n}\n\n/**\n * Checks whether the current browser is firefox\n * @param {string} [userAgent]\n * @return {boolean}\n */\nexport function isFirefox(userAgent = navigator.userAgent) {\n return /firefox/i.test(userAgent);\n}\n\n/**\n * Checks whether the current browser is safari\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Browser_Name\n * @param {string} [userAgent]\n * @return {boolean}\n */\nexport function isSafari(userAgent = navigator.userAgent) {\n return /safari/i.test(userAgent) && !/chrome|chromium/i.test(userAgent);\n}\n","import langs from 'iso-language-codes/js/data.js';\n\n/**\n * Use regex to approximate word count in a string\n * @param {string} text\n * @return {number}\n */\nexport function approximateWordCount(text) {\n const m = text.match(/\\S+/g);\n return m ? m.length : 0;\n}\n\n/**\n * Checks whether the current browser is on android\n * @param {string} [userAgent]\n * @return {boolean}\n */\nexport function isAndroid(userAgent = navigator.userAgent) {\n return /android/i.test(userAgent);\n}\n\n/**\n * @typedef {string} ISO6391\n * Language code in ISO 639-1 format. e.g. en, fr, zh\n **/\n\n/** Each lang is an array, with each index mapping to a different property */\nconst COLUMN_TO_LANG_INDEX = {\n 'Name': 0,\n 'Endonym': 1,\n 'ISO 639-1': 2,\n 'ISO 639-2/T': 3,\n 'ISO 639-2/B': 4\n};\n\n/**\n * @param {string} language in some format\n * @return {ISO6391?}\n */\nexport function toISO6391(language) {\n if (!language) return null;\n language = language.toLowerCase();\n\n return searchForISO6391(language, ['ISO 639-1']) ||\n searchForISO6391(language, ['ISO 639-2/B']) ||\n searchForISO6391(language, ['ISO 639-2/T', 'Endonym', 'Name']);\n}\n\n/**\n * Searches for the given long in the given columns.\n * @param {string} language\n * @param {Array<keyof COLUMN_TO_LANG_INDEX>} columnsToSearch\n * @return {ISO6391?}\n */\nfunction searchForISO6391(language, columnsToSearch) {\n for (let i = 0; i < langs.length; i++) {\n for (let colI = 0; colI < columnsToSearch.length; colI++) {\n const column = columnsToSearch[colI];\n const columnValue = langs[i][COLUMN_TO_LANG_INDEX[column]];\n if (columnValue.split(', ').map(x => x.toLowerCase()).indexOf(language) != -1) {\n return langs[i][COLUMN_TO_LANG_INDEX['ISO 639-1']];\n }\n }\n }\n return null;\n}\n","/* global br */\nimport { isChrome, isFirefox } from '../../util/browserSniffing.js';\nimport { isAndroid } from './utils.js';\nimport { promisifyEvent, sleep } from '../../BookReader/utils.js';\nimport AbstractTTSEngine from './AbstractTTSEngine.js';\n/** @typedef {import(\"./AbstractTTSEngine.js\").PageChunk} PageChunk */\n/** @typedef {import(\"./AbstractTTSEngine.js\").AbstractTTSSound} AbstractTTSSound */\n/** @typedef {import(\"./AbstractTTSEngine.js\").TTSEngineOptions} TTSEngineOptions */\n\n/**\n * @extends AbstractTTSEngine\n * TTS using Web Speech APIs\n **/\nexport default class WebTTSEngine extends AbstractTTSEngine {\n static isSupported() {\n return typeof(window.speechSynthesis) !== 'undefined' && !/samsungbrowser/i.test(navigator.userAgent);\n }\n\n /** @param {TTSEngineOptions} options */\n constructor(options) {\n super(options);\n\n // SAFARI doesn't have addEventListener on speechSynthesis\n if (speechSynthesis.addEventListener) {\n speechSynthesis.addEventListener('voiceschanged', () => this.events.trigger('voiceschanged'));\n }\n }\n\n /** @override */\n start(leafIndex, numLeafs) {\n // Need to run in this function to capture user intent to start playing audio\n if ('mediaSession' in navigator) {\n const audio = new Audio(SILENCE_6S_MP3);\n audio.loop = true;\n\n this.events.on('pause', () => audio.pause());\n this.events.on('resume', () => audio.play());\n // apparently this is what you need to do to make the media session notification go away\n // See https://developers.google.com/web/updates/2017/02/media-session#implementation_notes\n this.events.on('stop', () => audio.src = '');\n audio.play().then(() => {\n navigator.mediaSession.metadata = new MediaMetadata({\n title: br.bookTitle,\n artist: br.options.metadata.filter(m => m.label == 'Author').map(m => m.value)[0],\n // album: 'The Ultimate Collection (Remastered)',\n artwork: [\n { src: br.options.thumbnail, type: 'image/jpg' },\n ]\n });\n\n navigator.mediaSession.setActionHandler('play', () => {\n audio.play();\n this.resume();\n });\n navigator.mediaSession.setActionHandler('pause', () => {\n audio.pause();\n this.pause();\n });\n\n // navigator.mediaSession.setActionHandler('seekbackward', () => this.jumpBackward());\n // navigator.mediaSession.setActionHandler('seekforward', () => this.jumpForward());\n // Some devices only support the previoustrack/nexttrack (e.g. Win10), so show those.\n // Android devices do support the seek actions, but we don't want to show both buttons\n // and have them do the same thing.\n navigator.mediaSession.setActionHandler('previoustrack', () => this.jumpBackward());\n navigator.mediaSession.setActionHandler('nexttrack', () => this.jumpForward());\n });\n }\n\n return super.start(leafIndex, numLeafs);\n }\n\n /** @override */\n getVoices() {\n const voices = speechSynthesis.getVoices();\n if (voices.filter(v => v.default).length != 1) {\n // iOS bug where the default system voice is sometimes\n // missing from the list\n voices.unshift({\n voiceURI: 'bookreader.SystemDefault',\n name: 'System Default',\n // Not necessarily true, but very likely\n lang: navigator.language,\n default: true,\n localService: true,\n });\n }\n return voices;\n }\n\n /** @override */\n createSound(chunk) {\n return new WebTTSSound(chunk.text);\n }\n}\n\n/** @extends AbstractTTSSound */\nexport class WebTTSSound {\n /** @param {string} text **/\n constructor(text) {\n this.text = text;\n this.loaded = false;\n this.paused = false;\n this.started = false;\n /** Whether the audio was stopped with a .stop() call */\n this.stopped = false;\n this.rate = 1;\n\n /** @type {SpeechSynthesisUtterance} */\n this.utterance = null;\n\n /** @type {SpeechSynthesisVoice} */\n this.voice = null;\n\n this._lastEvents = {\n /** @type {SpeechSynthesisEvent} */\n pause: null,\n /** @type {SpeechSynthesisEvent} */\n boundary: null,\n /** @type {SpeechSynthesisEvent} */\n start: null,\n };\n\n /** Store where we are in the text. Only works on some browsers. */\n this._charIndex = 0;\n\n /** @type {Function} resolve function called when playback finished */\n this._finishResolver = null;\n\n /** @type {Promise} promise resolved by _finishResolver */\n this._finishPromise = null;\n }\n\n /** @override **/\n load(onload) {\n this.loaded = false;\n this.started = false;\n\n this.utterance = new SpeechSynthesisUtterance(this.text.slice(this._charIndex));\n // iOS bug where the default system voice is sometimes\n // missing from the list\n if (this.voice?.voiceURI !== 'bookreader.SystemDefault') {\n this.utterance.voice = this.voice;\n }\n // Need to also set lang (for some reason); won't set voice on Chrome@Android otherwise\n if (this.voice) this.utterance.lang = this.voice.lang;\n this.utterance.rate = this.rate;\n\n // Useful for debugging things\n if (location.toString().indexOf('_debugReadAloud=true') != -1) {\n this.utterance.addEventListener('pause', () => console.log('pause'));\n this.utterance.addEventListener('resume', () => console.log('resume'));\n this.utterance.addEventListener('start', () => console.log('start'));\n this.utterance.addEventListener('end', () => console.log('end'));\n this.utterance.addEventListener('error', () => console.log('error'));\n this.utterance.addEventListener('boundary', () => console.log('boundary'));\n this.utterance.addEventListener('mark', () => console.log('mark'));\n this.utterance.addEventListener('finish', () => console.log('finish'));\n }\n\n // Keep track of the speech synthesis events that come in; they have useful info\n // about progress (like charIndex)\n this.utterance.addEventListener('start', ev => this._lastEvents.start = ev);\n this.utterance.addEventListener('boundary', ev => this._lastEvents.boundary = ev);\n this.utterance.addEventListener('pause', ev => this._lastEvents.pause = ev);\n\n // Update our state\n this.utterance.addEventListener('start', () => {\n this.started = true;\n this.stopped = false;\n this.paused = false;\n });\n this.utterance.addEventListener('pause', () => this.paused = true);\n this.utterance.addEventListener('resume', () => this.paused = false);\n this.utterance.addEventListener('end', ev => {\n if (!this.paused && !this.stopped) {\n // Trigger a new event, finish, which only fires when audio fully completed\n this.utterance.dispatchEvent(new CustomEvent('finish', ev));\n }\n });\n this.loaded = true;\n onload && onload();\n }\n\n /**\n * Run whenever properties have changed. Tries to restart in the same spot it\n * left off.\n * @return {Promise<void>}\n */\n async reload() {\n // We'll restore the pause state, so copy it here\n const wasPaused = this.paused;\n // Use recent event to determine where we'll restart from\n // Browser support for this is mixed, but it degrades to restarting the chunk\n // and that's ok\n const recentEvent = this._lastEvents.boundary || this._lastEvents.pause;\n if (recentEvent) {\n this._charIndex = this.text.indexOf(recentEvent.target.text) + recentEvent.charIndex;\n }\n\n // We can't modify the utterance object, so we have to make a new one\n await this.stop();\n this.load();\n // Instead of playing and immediately pausing, we don't start playing. Note\n // this is a requirement because pause doesn't work consistently across\n // browsers.\n if (!wasPaused) this.play();\n }\n\n play() {\n this._finishPromise = this._finishPromise || new Promise(res => this._finishResolver = res);\n this.utterance.addEventListener('finish', this._finishResolver);\n\n // clear the queue\n speechSynthesis.cancel();\n // reset pause state\n speechSynthesis.resume();\n // Speak\n speechSynthesis.speak(this.utterance);\n\n const isLocalVoice = this.utterance.voice && this.utterance.voice.localService;\n if (isChrome() && !isLocalVoice) this._chromePausingBugFix();\n\n return this._finishPromise;\n }\n\n /** @return {Promise} */\n stop() {\n // 'end' won't fire if already stopped\n let endPromise = Promise.resolve();\n if (!this.stopped) {\n endPromise = Promise.race([\n promisifyEvent(this.utterance, 'end'),\n // Safari triggers an error when you call cancel mid-sound\n promisifyEvent(this.utterance, 'error'),\n ]);\n }\n this.stopped = true;\n speechSynthesis.cancel();\n return endPromise;\n }\n\n async finish() {\n await this.stop();\n this.utterance.dispatchEvent(new Event('finish'));\n }\n\n /**\n * @override\n * Will fire a pause event unless already paused\n **/\n async pause() {\n if (this.paused) return;\n\n const pausePromise = promisifyEvent(this.utterance, 'pause');\n speechSynthesis.pause();\n\n // There are a few awful browser cases:\n // 1. Pause works and fires\n // 2. Pause doesn't work and doesn't fire\n // 3. Pause works but doesn't fire\n const pauseMightNotWork = (isFirefox() && isAndroid());\n const pauseMightNotFire = isChrome() || pauseMightNotWork;\n\n if (pauseMightNotFire) {\n // wait for it just in case\n const timeoutPromise = sleep(100).then(() => 'timeout');\n const result = await Promise.race([pausePromise, timeoutPromise]);\n // We got our pause event; nothing to do!\n if (result != 'timeout') return;\n\n this.utterance.dispatchEvent(new CustomEvent('pause', this._lastEvents.start));\n\n // if pause might not work, then we'll stop entirely and restart later\n if (pauseMightNotWork) this.stop();\n }\n }\n\n async resume() {\n if (!this.started) {\n this.play();\n return;\n }\n\n if (!this.paused) return;\n\n // Browser cases:\n // 1. Resume works + fires\n // 2. Resume works + doesn't fire (Chrome Desktop)\n // 3. Resume doesn't work + doesn't fire (Chrome/FF Android)\n const resumeMightNotWork = (isChrome() && isAndroid()) || (isFirefox() && isAndroid());\n const resumeMightNotFire = isChrome() || resumeMightNotWork;\n\n // Try resume\n const resumePromise = promisifyEvent(this.utterance, 'resume');\n speechSynthesis.resume();\n\n if (resumeMightNotFire) {\n const result = await Promise.race([resumePromise, sleep(100).then(() => 'timeout')]);\n\n if (result != 'timeout') return;\n\n this.utterance.dispatchEvent(new CustomEvent('resume', {}));\n if (resumeMightNotWork) {\n await this.reload();\n this.play();\n }\n }\n }\n\n setPlaybackRate(rate) {\n this.rate = rate;\n this.reload();\n }\n\n /** @param {SpeechSynthesisVoice} voice */\n setVoice(voice) {\n this.voice = voice;\n this.reload();\n }\n /**\n * @private\n * Chrome has a bug where it only plays 15 seconds of TTS and then\n * suddenly stops (see https://bugs.chromium.org/p/chromium/issues/detail?id=679437 )\n * We avoid this (as described here: https://bugs.chromium.org/p/chromium/issues/detail?id=679437#c15 )\n * by pausing after 14 seconds and ~instantly resuming.\n */\n async _chromePausingBugFix() {\n const timeoutPromise = sleep(14000).then(() => 'timeout');\n const pausePromise = promisifyEvent(this.utterance, 'pause').then(() => 'paused');\n const endPromise = promisifyEvent(this.utterance, 'end').then(() => 'ended');\n const result = await Promise.race([timeoutPromise, pausePromise, endPromise]);\n if (location.toString().indexOf('_debugReadAloud=true') != -1) {\n console.log(`CHROME-PAUSE-HACK: ${result}`);\n }\n switch (result) {\n case 'ended':\n // audio was stopped/finished; nothing to do\n break;\n case 'paused':\n // audio was paused; wait for resume\n // Chrome won't let you resume the audio if 14s have passed 🤷‍\n // We could do the same as before (but resume+pause instead of pause+resume),\n // but that means we'd _constantly_ be running in the background. So in that\n // case, let's just restart the chunk\n await Promise.race([\n promisifyEvent(this.utterance, 'resume'),\n sleep(14000).then(() => 'timeout'),\n ]);\n result == 'timeout' ? this.reload() : this._chromePausingBugFix();\n break;\n case 'timeout':\n // We hit Chrome's secret cut off time. Pause/resume\n // to be able to keep TTS-ing\n speechSynthesis.pause();\n await sleep(25);\n speechSynthesis.resume();\n this._chromePausingBugFix();\n break;\n }\n }\n}\n\n/**\n * According to https://developers.google.com/web/updates/2017/02/media-session#implementation_notes , it needs to be at least 5 seconds\n * long to allow usage of the media sessions api\n */\nconst SILENCE_6S_MP3 = 'data:audio/mp3;base64,/+MYxAAMEAISSAhElhIpJYzz1vz9mUdlHvJwTP/n3FJesPxB9/8mp0oGaz9+7+T//8oCDhJqOMqLh4o4uhUAUUDaf//3r+///+MYxAoKy2ImKAgEqbfr/t///27/+n3s32/////+b5qMsq7vnXCKh2By3ZcIqyrUYbbRH0fp+ljtf+n2Uo72PHX/03f0df///+MYxBkKUAYmQAhEAL+2l44oKFjZMwJAOJnhguMqokFAqBKl/5f1/+f+3/v////9GT//r+//v+//////b1VvucaRChqnMqsY/+MYxCoLo2IiSAgEpRrgIRVq//p////25nlpVFbQ9kuXtrpt+n//3ZUZNKHVTHdJk3Q6h961DAU8loFlsfTnTZYLLQ1xiIYC/+MYxDYLa2YYAACNFAKKv5swEnqSccBoi//xVP9R/q/370r02////7VpaiWWLrDaF//X8+Rf/6ys2irmURCrI/Lr7///+m1t/+MYxEMKqAI2SAhElh7vNPmHrKdmMPFMimBI5xYQEiIRxh1gk0pKvfo7nezMyH6P67uKW+z/7NusoS/4//STUtCUiwASccAQ/+MYxFMK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+gepL/1mP1mfb8ccMf6rJy7AZA9f8//z/1MupC79GSiKa17cElnuR7pw5MG48AV+ucZ/+MYxOwMgAYuSAhEAhglKMW9+py5S+PP+Rf/6MP/fXz/vlOfvzMv/LWRcWGz16///9fZMlpasVhhHOGxIRbHk8nkkYP+EQKl/+MYxPUPG2IdgAjNozJQByAMF/6//le/y////8/rVl/v5/d/5U98kU2tzl5SITKXk///7Pt5VWhZSMOQqIHZwB0LymkzFFnA/+MYxPMOw2oQAABNEL0pKo025GgSbCS9H7lzLlV58mRTv//3+W8WT//f/7zz5//l/9ki/6////WXFkRjlygC4US7JYQwCIg1/+MYxPMPk1YaQAjNof+3GgQj8XKu+pz/PNeX2//81+BMxLX//nz8/5vXovznf9GZ8kZy//J/t1dPqqsZWQIqK2lF4LBUIAJn/+MYxO8Pq2YdoAlNopA5QImv5P/i4cqmi/y///9DP/mplLdWL/8rZS/qX////m+pfVpWM5jBgJysYxQpTGMYUcygIwYU6qqq/+MYxOsPE14aQAiNoYAwNmLCuoX4szULsxZmoXZiwr/FhX//gIWFSJmtiVCwr3f7P/ioqLCwsLC4qK1MQU1FMy45OS4zVVVV/+MYxOkN614mSAhE31VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOwz4hqAiHo1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOG1oOIAgEqFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxO4L6AVtkAhEAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV';\n","/* global BookReader */\n/**\n * Plugin for Text to Speech in BookReader\n */\nimport FestivalTTSEngine from './FestivalTTSEngine.js';\nimport WebTTSEngine from './WebTTSEngine.js';\nimport { toISO6391, approximateWordCount } from './utils.js';\nimport { en as tooltips } from './tooltip_dict.js';\nimport { renderBoxesInPageContainerLayer } from '../../BookReader/PageContainer.js';\n/** @typedef {import('./PageChunk.js').default} PageChunk */\n/** @typedef {import(\"./AbstractTTSEngine.js\").default} AbstractTTSEngine */\n\n// Default options for TTS\njQuery.extend(BookReader.defaultOptions, {\n server: 'ia600609.us.archive.org',\n bookPath: '',\n enableTtsPlugin: true,\n});\n\n// Extend the constructor to add TTS properties\nBookReader.prototype.setup = (function (super_) {\n return function (options) {\n super_.call(this, options);\n\n if (this.options.enableTtsPlugin) {\n /** @type { {[pageIndex: number]: Array<{ l: number, r: number, t: number, b: number }>} } */\n this._ttsBoxesByIndex = {};\n\n let TTSEngine = WebTTSEngine.isSupported() ? WebTTSEngine :\n FestivalTTSEngine.isSupported() ? FestivalTTSEngine :\n null;\n\n if (/_forceTTSEngine=(festival|web)/.test(location.toString())) {\n const engineName = location.toString().match(/_forceTTSEngine=(festival|web)/)[1];\n TTSEngine = { festival: FestivalTTSEngine, web: WebTTSEngine }[engineName];\n }\n\n if (TTSEngine) {\n /** @type {AbstractTTSEngine} */\n this.ttsEngine = new TTSEngine({\n server: options.server,\n bookPath: options.bookPath,\n bookLanguage: toISO6391(options.bookLanguage),\n onLoadingStart: this.showProgressPopup.bind(this, 'Loading audio...'),\n onLoadingComplete: this.removeProgressPopup.bind(this),\n onDone: this.ttsStop.bind(this),\n beforeChunkPlay: this.ttsBeforeChunkPlay.bind(this),\n afterChunkPlay: this.ttsSendChunkFinishedAnalyticsEvent.bind(this),\n });\n }\n }\n };\n})(BookReader.prototype.setup);\n\nBookReader.prototype.init = (function(super_) {\n return function() {\n if (this.options.enableTtsPlugin) {\n // Bind to events\n\n this.bind(BookReader.eventNames.PostInit, () => {\n this.$('.BRicon.read').click(() => {\n this.ttsToggle();\n return false;\n });\n if (this.ttsEngine) {\n this.ttsEngine.init();\n if (/[?&]_autoReadAloud=show/.test(location.toString())) {\n this.ttsStart(false); // false flag is to initiate read aloud controls\n }\n }\n });\n\n // This is fired when the hash changes by one of the other plugins!\n // i.e. it will fire every time the page changes -_-\n // this.bind(BookReader.eventNames.stop, function(e, br) {\n // this.ttsStop();\n // }.bind(this));\n }\n super_.call(this);\n };\n})(BookReader.prototype.init);\n\n/** @override */\nBookReader.prototype._createPageContainer = (function (super_) {\n return function (index) {\n const pageContainer = super_.call(this, index);\n if (this.options.enableTtsPlugin && pageContainer.page && index in this._ttsBoxesByIndex) {\n const pageIndex = pageContainer.page.index;\n renderBoxesInPageContainerLayer('ttsHiliteLayer', this._ttsBoxesByIndex[pageIndex], pageContainer.page, pageContainer.$container[0]);\n }\n return pageContainer;\n };\n})(BookReader.prototype._createPageContainer);\n\n// Extend buildMobileDrawerElement\nBookReader.prototype.buildMobileDrawerElement = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.options.enableTtsPlugin && this.ttsEngine) {\n $el.find('.BRmobileMenu__moreInfoRow').after($(`\n <li>\n <span>\n <span class=\"DrawerIconWrapper\"><img class=\"DrawerIcon\" src=\"${this.imagesBaseURL}icon_speaker_open.svg\" alt=\"info-speaker\"/></span>\n Read Aloud\n </span>\n <div>\n <span class=\"larger\">Press to toggle read aloud</span>\n <br/>\n <button class=\"BRicon read\"></button>\n </div>\n </li>`));\n }\n return $el;\n };\n})(BookReader.prototype.buildMobileDrawerElement);\n\n// Extend initNavbar\nBookReader.prototype.initNavbar = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.options.enableTtsPlugin && this.ttsEngine) {\n this.refs.$BRReadAloudToolbar = $(`\n <ul class=\"read-aloud\">\n <li>\n <select class=\"playback-speed\" name=\"playback-speed\" title=\"${tooltips.playbackSpeed}\">\n <option value=\"0.25\">0.25x</option>\n <option value=\"0.5\">0.5x</option>\n <option value=\"0.75\">0.75x</option>\n <option value=\"1.0\" selected>1.0x</option>\n <option value=\"1.25\">1.25x</option>\n <option value=\"1.5\">1.5x</option>\n <option value=\"1.75\">1.75x</option>\n <option value=\"2\">2x</option>\n </select>\n </li>\n <li>\n <button type=\"button\" name=\"review\" title=\"${tooltips.review}\">\n <div class=\"icon icon-review\"></div>\n </button>\n </li>\n <li>\n <button type=\"button\" name=\"play\" title=\"${tooltips.play}\">\n <div class=\"icon icon-play\"></div>\n <div class=\"icon icon-pause\"></div>\n </button>\n </li>\n <li>\n <button type=\"button\" name=\"advance\" title=\"${tooltips.advance}\">\n <div class=\"icon icon-advance\"></div>\n </button>\n </li>\n <li>\n <select class=\"playback-voices\" name=\"playback-voice\" style=\"display: none\" title=\"Change read aloud voices\">\n </select>\n </li>\n </ul>\n `);\n\n $el.find('.BRcontrols').prepend(this.refs.$BRReadAloudToolbar);\n\n const renderVoiceOption = (voices) => {\n return voices.map(voice =>\n `<option value=\"${voice.voiceURI}\">${voice.lang} - ${voice.name}</option>`).join('');\n };\n\n const voiceSortOrder = (a,b) => `${a.lang} - ${a.name}`.localeCompare(`${b.lang} - ${b.name}`);\n\n const renderVoicesMenu = (voicesMenu) => {\n voicesMenu.empty();\n const bookLanguage = this.ttsEngine.opts.bookLanguage;\n const bookLanguages = this.ttsEngine.getVoices().filter(v => v.lang.startsWith(bookLanguage)).sort(voiceSortOrder);\n const otherLanguages = this.ttsEngine.getVoices().filter(v => !v.lang.startsWith(bookLanguage)).sort(voiceSortOrder);\n\n if (this.ttsEngine.getVoices().length > 1) {\n voicesMenu.append($(`<optgroup label=\"Book Language (${bookLanguage})\"> ${renderVoiceOption(bookLanguages)} </optgroup>`));\n voicesMenu.append($(`<optgroup label=\"Other Languages\"> ${renderVoiceOption(otherLanguages)} </optgroup>`));\n\n voicesMenu.val(this.ttsEngine.voice.voiceURI);\n voicesMenu.show();\n } else {\n voicesMenu.hide();\n }\n };\n\n const voicesMenu = this.refs.$BRReadAloudToolbar.find('[name=playback-voice]');\n renderVoicesMenu(voicesMenu);\n voicesMenu.on(\"change\", ev => this.ttsEngine.setVoice(voicesMenu.val()));\n this.ttsEngine.events.on('pause resume start', () => this.ttsUpdateState());\n this.ttsEngine.events.on('voiceschanged', () => renderVoicesMenu(voicesMenu));\n this.refs.$BRReadAloudToolbar.find('[name=play]').on(\"click\", this.ttsPlayPause.bind(this));\n this.refs.$BRReadAloudToolbar.find('[name=advance]').on(\"click\", this.ttsJumpForward.bind(this));\n this.refs.$BRReadAloudToolbar.find('[name=review]').on(\"click\", this.ttsJumpBackward.bind(this));\n const $rateSelector = this.refs.$BRReadAloudToolbar.find('select[name=\"playback-speed\"]');\n $rateSelector.on(\"change\", ev => this.ttsEngine.setPlaybackRate(parseFloat($rateSelector.val())));\n $(`<li>\n <button class=\"BRicon read js-tooltip\" title=\"${tooltips.readAloud}\">\n <div class=\"icon icon-read-aloud\"></div>\n <span class=\"tooltip\">${tooltips.readAloud}</span>\n </button>\n </li>`).insertBefore($el.find('.BRcontrols .BRicon.zoom_out').closest('li'));\n }\n return $el;\n };\n})(BookReader.prototype.initNavbar);\n\n// ttsToggle()\n//______________________________________________________________________________\nBookReader.prototype.ttsToggle = function () {\n if (this.autoStop) this.autoStop();\n if (this.ttsEngine.playing) {\n this.ttsStop();\n } else {\n this.ttsStart();\n }\n};\n\n// ttsStart(\n//______________________________________________________________________________\nBookReader.prototype.ttsStart = function (startTTSEngine = true) {\n if (this.constModeThumb == this.mode)\n this.switchMode(this.constMode1up);\n\n this.refs.$BRReadAloudToolbar.addClass('visible');\n this.$('.BRicon.read').addClass('unread active');\n this.ttsSendAnalyticsEvent('Start');\n if (startTTSEngine)\n this.ttsEngine.start(this.currentIndex(), this.book.getNumLeafs());\n};\n\nBookReader.prototype.ttsJumpForward = function () {\n if (this.ttsEngine.paused) {\n this.ttsEngine.resume();\n }\n this.ttsEngine.jumpForward();\n};\n\nBookReader.prototype.ttsJumpBackward = function () {\n if (this.ttsEngine.paused) {\n this.ttsEngine.resume();\n }\n this.ttsEngine.jumpBackward();\n};\n\nBookReader.prototype.ttsUpdateState = function() {\n const isPlaying = !(this.ttsEngine.paused || !this.ttsEngine.playing);\n this.$('.read-aloud [name=play]').toggleClass('playing', isPlaying);\n};\n\nBookReader.prototype.ttsPlayPause = function() {\n if (!this.ttsEngine.playing) {\n this.ttsToggle();\n } else {\n this.ttsEngine.togglePlayPause();\n this.ttsUpdateState(this.ttsEngine.paused);\n }\n};\n\n// ttsStop()\n//______________________________________________________________________________\nBookReader.prototype.ttsStop = function () {\n this.refs.$BRReadAloudToolbar.removeClass('visible');\n this.$('.BRicon.read').removeClass('unread active');\n this.ttsSendAnalyticsEvent('Stop');\n this.ttsEngine.stop();\n this.ttsRemoveHilites();\n this.removeProgressPopup();\n};\n\n/**\n * @param {PageChunk} chunk\n * @return {PromiseLike<void>} returns once the flip is done\n */\nBookReader.prototype.ttsBeforeChunkPlay = async function(chunk) {\n await this.ttsMaybeFlipToIndex(chunk.leafIndex);\n this.ttsHighlightChunk(chunk);\n this.ttsScrollToChunk(chunk);\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsSendChunkFinishedAnalyticsEvent = function(chunk) {\n this.ttsSendAnalyticsEvent('ChunkFinished-Words', approximateWordCount(chunk.text));\n};\n\n/**\n * Flip the page if the provided leaf index is not visible\n * @param {Number} leafIndex\n */\nBookReader.prototype.ttsMaybeFlipToIndex = async function (leafIndex) {\n if (this.constMode2up != this.mode) {\n this.jumpToIndex(leafIndex);\n } else {\n await this._modes.mode2Up.mode2UpLit.jumpToIndex(leafIndex);\n }\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsHighlightChunk = function(chunk) {\n // The poorly-named variable leafIndex\n const pageIndex = chunk.leafIndex;\n\n this.ttsRemoveHilites();\n\n // group by index; currently only possible to have chunks on one page :/\n this._ttsBoxesByIndex = {\n [pageIndex]: chunk.lineRects.map(([l, b, r, t]) => ({l, r, b, t}))\n };\n\n // update any already created pages\n for (const [pageIndexString, boxes] of Object.entries(this._ttsBoxesByIndex)) {\n const pageIndex = parseFloat(pageIndexString);\n const page = this.book.getPage(pageIndex);\n const pageContainers = this.getActivePageContainerElementsForIndex(pageIndex);\n pageContainers.forEach(container => renderBoxesInPageContainerLayer('ttsHiliteLayer', boxes, page, container));\n }\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsScrollToChunk = function(chunk) {\n // It behaves weird if used in thumb mode\n if (this.constModeThumb == this.mode) return;\n\n $(`.pagediv${chunk.leafIndex} .ttsHiliteLayer rect`).last()?.[0]?.scrollIntoView({\n // Only vertically center the highlight if we're in 1up or in full screen. In\n // 2up, if we're not fullscreen, the whole body gets scrolled around to try to\n // center the highlight 🙄 See:\n // https://stackoverflow.com/questions/11039885/scrollintoview-causing-the-whole-page-to-move/11041376\n // Note: nearest doesn't quite work great, because the ReadAloud toolbar is now\n // full-width, and covers up the last line of the highlight.\n block: this.constMode1up == this.mode || this.isFullscreenActive ? 'center' : 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n};\n\n// ttsRemoveHilites()\n//______________________________________________________________________________\nBookReader.prototype.ttsRemoveHilites = function () {\n $(this.getActivePageContainerElements()).find('.ttsHiliteLayer').remove();\n this._ttsBoxesByIndex = {};\n};\n\n/**\n * @private\n * Send an analytics event with an optional value. Also attaches the book's language.\n * @param {string} action\n * @param {number} [value]\n */\nBookReader.prototype.ttsSendAnalyticsEvent = function(action, value) {\n if (this.archiveAnalyticsSendEvent) {\n const extraValues = {};\n const mediaLanguage = this.ttsEngine.opts.bookLanguage;\n if (mediaLanguage) extraValues.mediaLanguage = mediaLanguage;\n this.archiveAnalyticsSendEvent('BRReadAloud', action, value, extraValues);\n }\n};\n","export const en = {\n advance: 'Advance 10 seconds',\n play: 'Play',\n playbackSpeed: 'Playback speed',\n readAloud: 'Read this book aloud',\n review: 'Review 10 seconds',\n};\n\nexport const es = {\n advance: 'Avance 10 segundos',\n play: 'Jugar',\n playbackSpeed: 'Velocidad de reproducción',\n readAloud: 'Lee este libro en voz alta',\n review: 'Revisar 10 segundos',\n};\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar trim = require('../internals/string-trim').trim;\nvar whitespaces = require('../internals/whitespaces');\n\nvar charAt = uncurryThis(''.charAt);\nvar $parseFloat = global.parseFloat;\nvar Symbol = global.Symbol;\nvar ITERATOR = Symbol && Symbol.iterator;\nvar FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity\n // MS Edge 18- broken with boxed symbols\n || (ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); }));\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\nmodule.exports = FORCED ? function parseFloat(string) {\n var trimmedString = trim(toString(string));\n var result = $parseFloat(trimmedString);\n return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;\n} : $parseFloat;\n","var $ = require('../internals/export');\nvar $entries = require('../internals/object-to-array').entries;\n\n// `Object.entries` method\n// https://tc39.es/ecma262/#sec-object.entries\n$({ target: 'Object', stat: true }, {\n entries: function entries(O) {\n return $entries(O);\n }\n});\n","var $ = require('../internals/export');\nvar $parseFloat = require('../internals/number-parse-float');\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\n$({ global: true, forced: parseFloat != $parseFloat }, {\n parseFloat: $parseFloat\n});\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _default = [['Serbian', 'српски језик', 'sr', 'srp', 'srp'], ['Romanian, Moldavian, Moldovan', 'Română', 'ro', 'ron', 'rum'], ['Sichuan Yi, Nuosu', 'ꆈꌠ꒿ Nuosuhxop', 'ii', 'iii', 'iii'], ['Tahitian', 'Reo Tahiti', 'ty', 'tah', 'tah'], ['Tagalog', 'Wikang Tagalog', 'tl', 'tgl', 'tgl'], ['Yiddish', 'ייִדיש', 'yi', 'yid', 'yid'], ['Akan', 'Akan', 'ak', 'aka', 'aka'], ['Malay', 'Bahasa Melayu, بهاس ملايو‎', 'ms', 'msa', 'may'], ['Arabic', 'العربية', 'ar', 'ara', 'ara'], ['Norwegian', 'Norsk', 'no', 'nor', 'nor'], ['Ojibwa', 'ᐊᓂᔑᓈᐯᒧᐎᓐ', 'oj', 'oji', 'oji'], ['Fulah', 'Fulfulde, Pulaar, Pular', 'ff', 'ful', 'ful'], ['Persian', 'فارسی', 'fa', 'fas', 'per'], ['Albanian', 'Shqip', 'sq', 'sqi', 'alb'], ['Aymara', 'aymar aru', 'ay', 'aym', 'aym'], ['Azerbaijani', 'azərbaycan dili', 'az', 'aze', 'aze'], ['Chinese', '中文 (Zhōngwén), 汉语, 漢語', 'zh', 'zho', 'chi'], ['Cree', 'ᓀᐦᐃᔭᐍᐏᐣ', 'cr', 'cre', 'cre'], ['Estonian', 'eesti, eesti keel', 'et', 'est', 'est'], ['Guaraní', 'Avañe\\'ẽ', 'gn', 'grn', 'grn'], ['Inupiaq', 'Iñupiaq, Iñupiatun', 'ik', 'ipk', 'ipk'], ['Inuktitut', 'ᐃᓄᒃᑎᑐᑦ', 'iu', 'iku', 'iku'], ['Kanuri', 'Kanuri', 'kr', 'kau', 'kau'], ['Komi', 'коми кыв', 'kv', 'kom', 'kom'], ['Kongo', 'Kikongo', 'kg', 'kon', 'kon'], ['Kurdish', 'Kurdî, کوردی‎', 'ku', 'kur', 'kur'], ['Latvian', 'latviešu valoda', 'lv', 'lav', 'lav'], ['Malagasy', 'fiteny malagasy', 'mg', 'mlg', 'mlg'], ['Mongolian', 'Монгол хэл', 'mn', 'mon', 'mon'], ['Oromo', 'Afaan Oromoo', 'om', 'orm', 'orm'], ['Pashto, Pushto', 'پښتو', 'ps', 'pus', 'pus'], ['Quechua', 'Runa Simi, Kichwa', 'qu', 'que', 'que'], ['Sardinian', 'sardu', 'sc', 'srd', 'srd'], ['Swahili', 'Kiswahili', 'sw', 'swa', 'swa'], ['Uzbek', 'Oʻzbek, Ўзбек, أۇزبېك‎', 'uz', 'uzb', 'uzb'], ['Zhuang, Chuang', 'Saɯ cueŋƅ, Saw cuengh', 'za', 'zha', 'zha'], ['Bislama', 'Bislama', 'bi', 'bis', 'bis'], ['Norwegian Bokmål', 'Norsk Bokmål', 'nb', 'nob', 'nob'], ['Norwegian Nynorsk', 'Norsk Nynorsk', 'nn', 'nno', 'nno'], ['Indonesian', 'Bahasa Indonesia', 'id', 'ind', 'ind'], ['Twi', 'Twi', 'tw', 'twi', 'twi'], ['Esperanto', 'Esperanto', 'eo', 'epo', 'epo'], ['Interlingua', 'Interlingua', 'ia', 'ina', 'ina'], ['Interlingue', 'Originally called Occidental; then Interlingue after WWII', 'ie', 'ile', 'ile'], ['Ido', 'Ido', 'io', 'ido', 'ido'], ['Volapük', 'Volapük', 'vo', 'vol', 'vol'], ['Bihari languages', 'भोजपुरी', 'bh', 'bih', 'bih'], ['Hebrew (modern)', 'עברית', 'he', 'heb', 'heb'], ['Sanskrit', 'संस्कृतम्', 'sa', 'san', 'san'], ['Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian', 'ѩзыкъ словѣньскъ', 'cu', 'chu', 'chu'], ['Pali', 'पाऴि', 'pi', 'pli', 'pli'], ['Avestan', 'avesta', 'ae', 'ave', 'ave'], ['Latin', 'latine, lingua latina', 'la', 'lat', 'lat'], ['Armenian', 'Հայերեն', 'hy', 'hye', 'arm'], ['Swati', 'SiSwati', 'ss', 'ssw', 'ssw'], ['Tibetan', 'བོད་ཡིག', 'bo', 'bod', 'tib'], ['South Ndebele', 'isiNdebele', 'nr', 'nbl', 'nbl'], ['Slovene', 'Slovenski Jezik, Slovenščina', 'sl', 'slv', 'slv'], ['Oriya', 'ଓଡ଼ିଆ', 'or', 'ori', 'ori'], ['North Ndebele', 'isiNdebele', 'nd', 'nde', 'nde'], ['Nauru', 'Dorerin Naoero', 'na', 'nau', 'nau'], ['Maori', 'te reo Māori', 'mi', 'mri', 'mao'], ['Marathi', 'मराठी', 'mr', 'mar', 'mar'], ['Luba-Katanga', 'Kiluba', 'lu', 'lub', 'lub'], ['Rundi', 'Ikirundi', 'rn', 'run', 'run'], ['Central Khmer', 'ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ', 'km', 'khm', 'khm'], ['Western Frisian', 'Frysk', 'fy', 'fry', 'fry'], ['Bengali', 'বাংলা', 'bn', 'ben', 'ben'], ['Avaric', 'авар мацӀ, магӀарул мацӀ', 'av', 'ava', 'ava'], ['Abkhazian', 'аҧсуа бызшәа, аҧсшәа', 'ab', 'abk', 'abk'], ['Afar', 'Afaraf', 'aa', 'aar', 'aar'], ['Afrikaans', 'Afrikaans', 'af', 'afr', 'afr'], ['Amharic', 'አማርኛ', 'am', 'amh', 'amh'], ['Aragonese', 'aragonés', 'an', 'arg', 'arg'], ['Assamese', 'অসমীয়া', 'as', 'asm', 'asm'], ['Bambara', 'bamanankan', 'bm', 'bam', 'bam'], ['Bashkir', 'башҡорт теле', 'ba', 'bak', 'bak'], ['Basque', 'euskara, euskera', 'eu', 'eus', 'baq'], ['Belarusian', 'беларуская мова', 'be', 'bel', 'bel'], ['Bosnian', 'bosanski jezik', 'bs', 'bos', 'bos'], ['Breton', 'brezhoneg', 'br', 'bre', 'bre'], ['Bulgarian', 'български език', 'bg', 'bul', 'bul'], ['Burmese', 'ဗမာစာ', 'my', 'mya', 'bur'], ['Catalan, Valencian', 'català, valencià', 'ca', 'cat', 'cat'], ['Chamorro', 'Chamoru', 'ch', 'cha', 'cha'], ['Chechen', 'нохчийн мотт', 'ce', 'che', 'che'], ['Chichewa, Chewa, Nyanja', 'chiCheŵa, chinyanja', 'ny', 'nya', 'nya'], ['Chuvash', 'чӑваш чӗлхи', 'cv', 'chv', 'chv'], ['Cornish', 'Kernewek', 'kw', 'cor', 'cor'], ['Corsican', 'corsu, lingua corsa', 'co', 'cos', 'cos'], ['Croatian', 'hrvatski jezik', 'hr', 'hrv', 'hrv'], ['Czech', 'čeština, český jazyk', 'cs', 'ces', 'cze'], ['Danish', 'dansk', 'da', 'dan', 'dan'], ['Divehi, Dhivehi, Maldivian', 'ދިވެހި', 'dv', 'div', 'div'], ['Dutch, Flemish', 'Nederlands, Vlaams', 'nl', 'nld', 'dut'], ['Dzongkha', 'རྫོང་ཁ', 'dz', 'dzo', 'dzo'], ['English', 'English', 'en', 'eng', 'eng'], ['Ewe', 'Eʋegbe', 'ee', 'ewe', 'ewe'], ['Faroese', 'føroyskt', 'fo', 'fao', 'fao'], ['Fijian', 'vosa Vakaviti', 'fj', 'fij', 'fij'], ['Finnish', 'suomi, suomen kieli', 'fi', 'fin', 'fin'], ['French', 'français, langue française', 'fr', 'fra', 'fre'], ['Galician', 'Galego', 'gl', 'glg', 'glg'], ['Georgian', 'ქართული', 'ka', 'kat', 'geo'], ['German', 'Deutsch', 'de', 'deu', 'ger'], ['Greek (modern)', 'ελληνικά', 'el', 'ell', 'gre'], ['Gujarati', 'ગુજરાતી', 'gu', 'guj', 'guj'], ['Haitian, Haitian Creole', 'Kreyòl ayisyen', 'ht', 'hat', 'hat'], ['Hausa', '(Hausa) هَوُسَ', 'ha', 'hau', 'hau'], ['Herero', 'Otjiherero', 'hz', 'her', 'her'], ['Hindi', 'हिन्दी, हिंदी', 'hi', 'hin', 'hin'], ['Hiri Motu', 'Hiri Motu', 'ho', 'hmo', 'hmo'], ['Hungarian', 'magyar', 'hu', 'hun', 'hun'], ['Irish', 'Gaeilge', 'ga', 'gle', 'gle'], ['Igbo', 'Asụsụ Igbo', 'ig', 'ibo', 'ibo'], ['Icelandic', 'Íslenska', 'is', 'isl', 'ice'], ['Italian', 'Italiano', 'it', 'ita', 'ita'], ['Japanese', '日本語 (にほんご)', 'ja', 'jpn', 'jpn'], ['Javanese', 'ꦧꦱꦗꦮ, Basa Jawa', 'jv', 'jav', 'jav'], ['Kalaallisut, Greenlandic', 'kalaallisut, kalaallit oqaasii', 'kl', 'kal', 'kal'], ['Kannada', 'ಕನ್ನಡ', 'kn', 'kan', 'kan'], ['Kashmiri', 'कश्मीरी, كشميري‎', 'ks', 'kas', 'kas'], ['Kazakh', 'қазақ тілі', 'kk', 'kaz', 'kaz'], ['Kikuyu, Gikuyu', 'Gĩkũyũ', 'ki', 'kik', 'kik'], ['Kinyarwanda', 'Ikinyarwanda', 'rw', 'kin', 'kin'], ['Kirghiz, Kyrgyz', 'Кыргызча, Кыргыз тили', 'ky', 'kir', 'kir'], ['Korean', '한국어', 'ko', 'kor', 'kor'], ['Kuanyama, Kwanyama', 'Kuanyama', 'kj', 'kua', 'kua'], ['Luxembourgish, Letzeburgesch', 'Lëtzebuergesch', 'lb', 'ltz', 'ltz'], ['Ganda', 'Luganda', 'lg', 'lug', 'lug'], ['Limburgan, Limburger, Limburgish', 'Limburgs', 'li', 'lim', 'lim'], ['Lingala', 'Lingála', 'ln', 'lin', 'lin'], ['Lao', 'ພາສາລາວ', 'lo', 'lao', 'lao'], ['Lithuanian', 'lietuvių kalba', 'lt', 'lit', 'lit'], ['Manx', 'Gaelg, Gailck', 'gv', 'glv', 'glv'], ['Macedonian', 'македонски јазик', 'mk', 'mkd', 'mac'], ['Malayalam', 'മലയാളം', 'ml', 'mal', 'mal'], ['Maltese', 'Malti', 'mt', 'mlt', 'mlt'], ['Marshallese', 'Kajin M̧ajeļ', 'mh', 'mah', 'mah'], ['Navajo, Navaho', 'Diné bizaad', 'nv', 'nav', 'nav'], ['Nepali', 'नेपाली', 'ne', 'nep', 'nep'], ['Ndonga', 'Owambo', 'ng', 'ndo', 'ndo'], ['Occitan', 'occitan, lenga d\\'òc', 'oc', 'oci', 'oci'], ['Ossetian, Ossetic', 'ирон æвзаг', 'os', 'oss', 'oss'], ['Panjabi, Punjabi', 'ਪੰਜਾਬੀ', 'pa', 'pan', 'pan'], ['Polish', 'język polski, polszczyzna', 'pl', 'pol', 'pol'], ['Portuguese', 'Português', 'pt', 'por', 'por'], ['Romansh', 'Rumantsch Grischun', 'rm', 'roh', 'roh'], ['Russian', 'русский', 'ru', 'rus', 'rus'], ['Sindhi', 'सिन्धी, سنڌي، سندھی‎', 'sd', 'snd', 'snd'], ['Northern Sami', 'Davvisámegiella', 'se', 'sme', 'sme'], ['Samoan', 'gagana fa\\'a Samoa', 'sm', 'smo', 'smo'], ['Sango', 'yângâ tî sängö', 'sg', 'sag', 'sag'], ['Gaelic, Scottish Gaelic', 'Gàidhlig', 'gd', 'gla', 'gla'], ['Shona', 'chiShona', 'sn', 'sna', 'sna'], ['Sinhala, Sinhalese', 'සිංහල', 'si', 'sin', 'sin'], ['Slovak', 'Slovenčina, Slovenský Jazyk', 'sk', 'slk', 'slo'], ['Somali', 'Soomaaliga, af Soomaali', 'so', 'som', 'som'], ['Southern Sotho', 'Sesotho', 'st', 'sot', 'sot'], ['Spanish, Castilian', 'Español', 'es', 'spa', 'spa'], ['Sundanese', 'Basa Sunda', 'su', 'sun', 'sun'], ['Swedish', 'Svenska', 'sv', 'swe', 'swe'], ['Tamil', 'தமிழ்', 'ta', 'tam', 'tam'], ['Telugu', 'తెలుగు', 'te', 'tel', 'tel'], ['Tajik', 'тоҷикӣ, toçikī, تاجیکی‎', 'tg', 'tgk', 'tgk'], ['Thai', 'ไทย', 'th', 'tha', 'tha'], ['Tigrinya', 'ትግርኛ', 'ti', 'tir', 'tir'], ['Turkmen', 'Türkmen, Түркмен', 'tk', 'tuk', 'tuk'], ['Tswana', 'Setswana', 'tn', 'tsn', 'tsn'], ['Tongan (Tonga Islands)', 'Faka Tonga', 'to', 'ton', 'ton'], ['Turkish', 'Türkçe', 'tr', 'tur', 'tur'], ['Tsonga', 'Xitsonga', 'ts', 'tso', 'tso'], ['Tatar', 'татар теле, tatar tele', 'tt', 'tat', 'tat'], ['Uighur, Uyghur', 'ئۇيغۇرچە‎, Uyghurche', 'ug', 'uig', 'uig'], ['Ukrainian', 'Українська', 'uk', 'ukr', 'ukr'], ['Urdu', 'اردو', 'ur', 'urd', 'urd'], ['Venda', 'Tshivenḓa', 've', 'ven', 'ven'], ['Vietnamese', 'Tiếng Việt', 'vi', 'vie', 'vie'], ['Walloon', 'Walon', 'wa', 'wln', 'wln'], ['Welsh', 'Cymraeg', 'cy', 'cym', 'wel'], ['Wolof', 'Wollof', 'wo', 'wol', 'wol'], ['Xhosa', 'isiXhosa', 'xh', 'xho', 'xho'], ['Yoruba', 'Yorùbá', 'yo', 'yor', 'yor'], ['Zulu', 'isiZulu', 'zu', 'zul', 'zul']];\nexports[\"default\"] = _default;","/*!\n * jQuery Browser Plugin 0.1.0\n * https://github.com/gabceb/jquery-browser-plugin\n *\n * Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors\n * http://jquery.org/license\n *\n * Modifications Copyright 2015 Gabriel Cebrian\n * https://github.com/gabceb\n *\n * Released under the MIT license\n *\n * Date: 05-07-2015\n */\n/*global window: false */\n\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['jquery'], function ($) {\n return factory($);\n });\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\n // Node-like environment\n module.exports = factory(require('jquery'));\n } else {\n // Browser globals\n factory(window.jQuery);\n }\n}(function(jQuery) {\n \"use strict\";\n\n function uaMatch( ua ) {\n // If an UA is not provided, default to the current browser UA.\n if ( ua === undefined ) {\n ua = window.navigator.userAgent;\n }\n ua = ua.toLowerCase();\n\n var match = /(edge)\\/([\\w.]+)/.exec( ua ) ||\n /(opr)[\\/]([\\w.]+)/.exec( ua ) ||\n /(chrome)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(iemobile)[\\/]([\\w.]+)/.exec( ua ) ||\n /(version)(applewebkit)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(webkit)[ \\/]([\\w.]+).*(version)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(webkit)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(msie) ([\\w.]+)/.exec( ua ) ||\n ua.indexOf(\"trident\") >= 0 && /(rv)(?::| )([\\w.]+)/.exec( ua ) ||\n ua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec( ua ) ||\n [];\n\n var platform_match = /(ipad)/.exec( ua ) ||\n /(ipod)/.exec( ua ) ||\n /(windows phone)/.exec( ua ) ||\n /(iphone)/.exec( ua ) ||\n /(kindle)/.exec( ua ) ||\n /(silk)/.exec( ua ) ||\n /(android)/.exec( ua ) ||\n /(win)/.exec( ua ) ||\n /(mac)/.exec( ua ) ||\n /(linux)/.exec( ua ) ||\n /(cros)/.exec( ua ) ||\n /(playbook)/.exec( ua ) ||\n /(bb)/.exec( ua ) ||\n /(blackberry)/.exec( ua ) ||\n [];\n\n var browser = {},\n matched = {\n browser: match[ 5 ] || match[ 3 ] || match[ 1 ] || \"\",\n version: match[ 2 ] || match[ 4 ] || \"0\",\n versionNumber: match[ 4 ] || match[ 2 ] || \"0\",\n platform: platform_match[ 0 ] || \"\"\n };\n\n if ( matched.browser ) {\n browser[ matched.browser ] = true;\n browser.version = matched.version;\n browser.versionNumber = parseInt(matched.versionNumber, 10);\n }\n\n if ( matched.platform ) {\n browser[ matched.platform ] = true;\n }\n\n // These are all considered mobile platforms, meaning they run a mobile browser\n if ( browser.android || browser.bb || browser.blackberry || browser.ipad || browser.iphone ||\n browser.ipod || browser.kindle || browser.playbook || browser.silk || browser[ \"windows phone\" ]) {\n browser.mobile = true;\n }\n\n // These are all considered desktop platforms, meaning they run a desktop browser\n if ( browser.cros || browser.mac || browser.linux || browser.win ) {\n browser.desktop = true;\n }\n\n // Chrome, Opera 15+ and Safari are webkit based browsers\n if ( browser.chrome || browser.opr || browser.safari ) {\n browser.webkit = true;\n }\n\n // IE11 has a new token so we will assign it msie to avoid breaking changes\n if ( browser.rv || browser.iemobile) {\n var ie = \"msie\";\n\n matched.browser = ie;\n browser[ie] = true;\n }\n\n // Edge is officially known as Microsoft Edge, so rewrite the key to match\n if ( browser.edge ) {\n delete browser.edge;\n var msedge = \"msedge\";\n\n matched.browser = msedge;\n browser[msedge] = true;\n }\n\n // Blackberry browsers are marked as Safari on BlackBerry\n if ( browser.safari && browser.blackberry ) {\n var blackberry = \"blackberry\";\n\n matched.browser = blackberry;\n browser[blackberry] = true;\n }\n\n // Playbook browsers are marked as Safari on Playbook\n if ( browser.safari && browser.playbook ) {\n var playbook = \"playbook\";\n\n matched.browser = playbook;\n browser[playbook] = true;\n }\n\n // BB10 is a newer OS version of BlackBerry\n if ( browser.bb ) {\n var bb = \"blackberry\";\n\n matched.browser = bb;\n browser[bb] = true;\n }\n\n // Opera 15+ are identified as opr\n if ( browser.opr ) {\n var opera = \"opera\";\n\n matched.browser = opera;\n browser[opera] = true;\n }\n\n // Stock Android browsers are marked as Safari on Android.\n if ( browser.safari && browser.android ) {\n var android = \"android\";\n\n matched.browser = android;\n browser[android] = true;\n }\n\n // Kindle browsers are marked as Safari on Kindle\n if ( browser.safari && browser.kindle ) {\n var kindle = \"kindle\";\n\n matched.browser = kindle;\n browser[kindle] = true;\n }\n\n // Kindle Silk browsers are marked as Safari on Kindle\n if ( browser.safari && browser.silk ) {\n var silk = \"silk\";\n\n matched.browser = silk;\n browser[silk] = true;\n }\n\n // Assign the name and platform variable\n browser.name = matched.browser;\n browser.platform = matched.platform;\n return browser;\n }\n\n // Run the matching process, also assign the function to the returned object\n // for manual, jQuery-free use if desired\n window.jQBrowser = uaMatch( window.navigator.userAgent );\n window.jQBrowser.uaMatch = uaMatch;\n\n // Only assign to jQuery.browser if jQuery is loaded\n if ( jQuery ) {\n jQuery.browser = window.jQBrowser;\n }\n\n return window.jQBrowser;\n}));\n","/** @license\r\n *\r\n * SoundManager 2: JavaScript Sound for the Web\r\n * ----------------------------------------------\r\n * http://schillmania.com/projects/soundmanager2/\r\n *\r\n * Copyright (c) 2007, Scott Schiller. All rights reserved.\r\n * Code provided under the BSD License:\r\n * http://schillmania.com/projects/soundmanager2/license.txt\r\n *\r\n * V2.97a.20170601\r\n */\r\n\r\n/**\r\n * About this file\r\n * -------------------------------------------------------------------------------------\r\n * This is the fully-commented source version of the SoundManager 2 API,\r\n * recommended for use during development and testing.\r\n *\r\n * See soundmanager2-nodebug-jsmin.js for an optimized build (~11KB with gzip.)\r\n * http://schillmania.com/projects/soundmanager2/doc/getstarted/#basic-inclusion\r\n * Alternately, serve this file with gzip for 75% compression savings (~30KB over HTTP.)\r\n *\r\n * You may notice <d> and </d> comments in this source; these are delimiters for\r\n * debug blocks which are removed in the -nodebug builds, further optimizing code size.\r\n *\r\n * Also, as you may note: Whoa, reliable cross-platform/device audio support is hard! ;)\r\n */\r\n\r\n(function SM2(window, _undefined) {\r\n\r\n/* global Audio, document, window, navigator, define, module, SM2_DEFER, opera, setTimeout, setInterval, clearTimeout, sm2Debugger */\r\n\r\n'use strict';\r\n\r\nif (!window || !window.document) {\r\n\r\n // Don't cross the [environment] streams. SM2 expects to be running in a browser, not under node.js etc.\r\n // Additionally, if a browser somehow manages to fail this test, as Egon said: \"It would be bad.\"\r\n\r\n throw new Error('SoundManager requires a browser with window and document objects.');\r\n\r\n}\r\n\r\nvar soundManager = null;\r\n\r\n/**\r\n * The SoundManager constructor.\r\n *\r\n * @constructor\r\n * @param {string} smURL Optional: Path to SWF files\r\n * @param {string} smID Optional: The ID to use for the SWF container element\r\n * @this {SoundManager}\r\n * @return {SoundManager} The new SoundManager instance\r\n */\r\n\r\nfunction SoundManager(smURL, smID) {\r\n\r\n /**\r\n * soundManager configuration options list\r\n * defines top-level configuration properties to be applied to the soundManager instance (eg. soundManager.flashVersion)\r\n * to set these properties, use the setup() method - eg., soundManager.setup({url: '/swf/', flashVersion: 9})\r\n */\r\n\r\n this.setupOptions = {\r\n\r\n url: (smURL || null), // path (directory) where SoundManager 2 SWFs exist, eg., /path/to/swfs/\r\n flashVersion: 8, // flash build to use (8 or 9.) Some API features require 9.\r\n debugMode: true, // enable debugging output (console.log() with HTML fallback)\r\n debugFlash: false, // enable debugging output inside SWF, troubleshoot Flash/browser issues\r\n useConsole: true, // use console.log() if available (otherwise, writes to #soundmanager-debug element)\r\n consoleOnly: true, // if console is being used, do not create/write to #soundmanager-debug\r\n waitForWindowLoad: false, // force SM2 to wait for window.onload() before trying to call soundManager.onload()\r\n bgColor: '#ffffff', // SWF background color. N/A when wmode = 'transparent'\r\n useHighPerformance: false, // position:fixed flash movie can help increase js/flash speed, minimize lag\r\n flashPollingInterval: null, // msec affecting whileplaying/loading callback frequency. If null, default of 50 msec is used.\r\n html5PollingInterval: null, // msec affecting whileplaying() for HTML5 audio, excluding mobile devices. If null, native HTML5 update events are used.\r\n flashLoadTimeout: 1000, // msec to wait for flash movie to load before failing (0 = infinity)\r\n wmode: null, // flash rendering mode - null, 'transparent', or 'opaque' (last two allow z-index to work)\r\n allowScriptAccess: 'always', // for scripting the SWF (object/embed property), 'always' or 'sameDomain'\r\n useFlashBlock: false, // *requires flashblock.css, see demos* - allow recovery from flash blockers. Wait indefinitely and apply timeout CSS to SWF, if applicable.\r\n useHTML5Audio: true, // use HTML5 Audio() where API is supported (most Safari, Chrome versions), Firefox (MP3/MP4 support varies.) Ideally, transparent vs. Flash API where possible.\r\n forceUseGlobalHTML5Audio: false, // if true, a single Audio() object is used for all sounds - and only one can play at a time.\r\n ignoreMobileRestrictions: false, // if true, SM2 will not apply global HTML5 audio rules to mobile UAs. iOS > 7 and WebViews may allow multiple Audio() instances.\r\n html5Test: /^(probably|maybe)$/i, // HTML5 Audio() format support test. Use /^probably$/i; if you want to be more conservative.\r\n preferFlash: false, // overrides useHTML5audio, will use Flash for MP3/MP4/AAC if present. Potential option if HTML5 playback with these formats is quirky.\r\n noSWFCache: false, // if true, appends ?ts={date} to break aggressive SWF caching.\r\n idPrefix: 'sound' // if an id is not provided to createSound(), this prefix is used for generated IDs - 'sound0', 'sound1' etc.\r\n\r\n };\r\n\r\n this.defaultOptions = {\r\n\r\n /**\r\n * the default configuration for sound objects made with createSound() and related methods\r\n * eg., volume, auto-load behaviour and so forth\r\n */\r\n\r\n autoLoad: false, // enable automatic loading (otherwise .load() will be called on demand with .play(), the latter being nicer on bandwidth - if you want to .load yourself, you also can)\r\n autoPlay: false, // enable playing of file as soon as possible (much faster if \"stream\" is true)\r\n from: null, // position to start playback within a sound (msec), default = beginning\r\n loops: 1, // how many times to repeat the sound (position will wrap around to 0, setPosition() will break out of loop when >0)\r\n onid3: null, // callback function for \"ID3 data is added/available\"\r\n onerror: null, // callback function for \"load failed\" (or, playback/network/decode error under HTML5.)\r\n onload: null, // callback function for \"load finished\"\r\n whileloading: null, // callback function for \"download progress update\" (X of Y bytes received)\r\n onplay: null, // callback for \"play\" start\r\n onpause: null, // callback for \"pause\"\r\n onresume: null, // callback for \"resume\" (pause toggle)\r\n whileplaying: null, // callback during play (position update)\r\n onposition: null, // object containing times and function callbacks for positions of interest\r\n onstop: null, // callback for \"user stop\"\r\n onfinish: null, // callback function for \"sound finished playing\"\r\n multiShot: true, // let sounds \"restart\" or layer on top of each other when played multiple times, rather than one-shot/one at a time\r\n multiShotEvents: false, // fire multiple sound events (currently onfinish() only) when multiShot is enabled\r\n position: null, // offset (milliseconds) to seek to within loaded sound data.\r\n pan: 0, // \"pan\" settings, left-to-right, -100 to 100\r\n playbackRate: 1, // rate at which to play the sound (HTML5-only)\r\n stream: true, // allows playing before entire file has loaded (recommended)\r\n to: null, // position to end playback within a sound (msec), default = end\r\n type: null, // MIME-like hint for file pattern / canPlay() tests, eg. audio/mp3\r\n usePolicyFile: false, // enable crossdomain.xml request for audio on remote domains (for ID3/waveform access)\r\n volume: 100 // self-explanatory. 0-100, the latter being the max.\r\n\r\n };\r\n\r\n this.flash9Options = {\r\n\r\n /**\r\n * flash 9-only options,\r\n * merged into defaultOptions if flash 9 is being used\r\n */\r\n\r\n onfailure: null, // callback function for when playing fails (Flash 9, MovieStar + RTMP-only)\r\n isMovieStar: null, // \"MovieStar\" MPEG4 audio mode. Null (default) = auto detect MP4, AAC etc. based on URL. true = force on, ignore URL\r\n usePeakData: false, // enable left/right channel peak (level) data\r\n useWaveformData: false, // enable sound spectrum (raw waveform data) - NOTE: May increase CPU load.\r\n useEQData: false, // enable sound EQ (frequency spectrum data) - NOTE: May increase CPU load.\r\n onbufferchange: null, // callback for \"isBuffering\" property change\r\n ondataerror: null // callback for waveform/eq data access error (flash playing audio in other tabs/domains)\r\n\r\n };\r\n\r\n this.movieStarOptions = {\r\n\r\n /**\r\n * flash 9.0r115+ MPEG4 audio options,\r\n * merged into defaultOptions if flash 9+movieStar mode is enabled\r\n */\r\n\r\n bufferTime: 3, // seconds of data to buffer before playback begins (null = flash default of 0.1 seconds - if AAC playback is gappy, try increasing.)\r\n serverURL: null, // rtmp: FMS or FMIS server to connect to, required when requesting media via RTMP or one of its variants\r\n onconnect: null, // rtmp: callback for connection to flash media server\r\n duration: null // rtmp: song duration (msec)\r\n\r\n };\r\n\r\n this.audioFormats = {\r\n\r\n /**\r\n * determines HTML5 support + flash requirements.\r\n * if no support (via flash and/or HTML5) for a \"required\" format, SM2 will fail to start.\r\n * flash fallback is used for MP3 or MP4 if HTML5 can't play it (or if preferFlash = true)\r\n */\r\n\r\n mp3: {\r\n type: ['audio/mpeg; codecs=\"mp3\"', 'audio/mpeg', 'audio/mp3', 'audio/MPA', 'audio/mpa-robust'],\r\n required: true\r\n },\r\n\r\n mp4: {\r\n related: ['aac', 'm4a', 'm4b'], // additional formats under the MP4 container\r\n type: ['audio/mp4; codecs=\"mp4a.40.2\"', 'audio/aac', 'audio/x-m4a', 'audio/MP4A-LATM', 'audio/mpeg4-generic'],\r\n required: false\r\n },\r\n\r\n ogg: {\r\n type: ['audio/ogg; codecs=vorbis'],\r\n required: false\r\n },\r\n\r\n opus: {\r\n type: ['audio/ogg; codecs=opus', 'audio/opus'],\r\n required: false\r\n },\r\n\r\n wav: {\r\n type: ['audio/wav; codecs=\"1\"', 'audio/wav', 'audio/wave', 'audio/x-wav'],\r\n required: false\r\n },\r\n\r\n flac: {\r\n type: ['audio/flac'],\r\n required: false\r\n }\r\n\r\n };\r\n\r\n // HTML attributes (id + class names) for the SWF container\r\n\r\n this.movieID = 'sm2-container';\r\n this.id = (smID || 'sm2movie');\r\n\r\n this.debugID = 'soundmanager-debug';\r\n this.debugURLParam = /([#?&])debug=1/i;\r\n\r\n // dynamic attributes\r\n\r\n this.versionNumber = 'V2.97a.20170601';\r\n this.version = null;\r\n this.movieURL = null;\r\n this.altURL = null;\r\n this.swfLoaded = false;\r\n this.enabled = false;\r\n this.oMC = null;\r\n this.sounds = {};\r\n this.soundIDs = [];\r\n this.muted = false;\r\n this.didFlashBlock = false;\r\n this.filePattern = null;\r\n\r\n this.filePatterns = {\r\n flash8: /\\.mp3(\\?.*)?$/i,\r\n flash9: /\\.mp3(\\?.*)?$/i\r\n };\r\n\r\n // support indicators, set at init\r\n\r\n this.features = {\r\n buffering: false,\r\n peakData: false,\r\n waveformData: false,\r\n eqData: false,\r\n movieStar: false\r\n };\r\n\r\n // flash sandbox info, used primarily in troubleshooting\r\n\r\n this.sandbox = {\r\n // <d>\r\n type: null,\r\n types: {\r\n remote: 'remote (domain-based) rules',\r\n localWithFile: 'local with file access (no internet access)',\r\n localWithNetwork: 'local with network (internet access only, no local access)',\r\n localTrusted: 'local, trusted (local+internet access)'\r\n },\r\n description: null,\r\n noRemote: null,\r\n noLocal: null\r\n // </d>\r\n };\r\n\r\n /**\r\n * format support (html5/flash)\r\n * stores canPlayType() results based on audioFormats.\r\n * eg. { mp3: boolean, mp4: boolean }\r\n * treat as read-only.\r\n */\r\n\r\n this.html5 = {\r\n usingFlash: null // set if/when flash fallback is needed\r\n };\r\n\r\n // file type support hash\r\n this.flash = {};\r\n\r\n // determined at init time\r\n this.html5Only = false;\r\n\r\n // used for special cases (eg. iPad/iPhone/palm OS?)\r\n this.ignoreFlash = false;\r\n\r\n /**\r\n * a few private internals (OK, a lot. :D)\r\n */\r\n\r\n var SMSound,\r\n sm2 = this, globalHTML5Audio = null, flash = null, sm = 'soundManager', smc = sm + ': ', h5 = 'HTML5::', id, ua = navigator.userAgent, wl = window.location.href.toString(), doc = document, doNothing, setProperties, init, fV, on_queue = [], debugOpen = true, debugTS, didAppend = false, appendSuccess = false, didInit = false, disabled = false, windowLoaded = false, _wDS, wdCount = 0, initComplete, mixin, assign, extraOptions, addOnEvent, processOnEvents, initUserOnload, delayWaitForEI, waitForEI, rebootIntoHTML5, setVersionInfo, handleFocus, strings, initMovie, domContentLoaded, winOnLoad, didDCLoaded, getDocument, createMovie, catchError, setPolling, initDebug, debugLevels = ['log', 'info', 'warn', 'error'], defaultFlashVersion = 8, disableObject, failSafely, normalizeMovieURL, oRemoved = null, oRemovedHTML = null, str, flashBlockHandler, getSWFCSS, swfCSS, toggleDebug, loopFix, policyFix, complain, idCheck, waitingForEI = false, initPending = false, startTimer, stopTimer, timerExecute, h5TimerCount = 0, h5IntervalTimer = null, parseURL, messages = [],\r\n canIgnoreFlash, needsFlash = null, featureCheck, html5OK, html5CanPlay, html5ErrorCodes, html5Ext, html5Unload, domContentLoadedIE, testHTML5, event, slice = Array.prototype.slice, useGlobalHTML5Audio = false, lastGlobalHTML5URL, hasFlash, detectFlash, badSafariFix, html5_events, showSupport, flushMessages, wrapCallback, idCounter = 0, didSetup, msecScale = 1000,\r\n is_iDevice = ua.match(/(ipad|iphone|ipod)/i), isAndroid = ua.match(/android/i), isIE = ua.match(/msie|trident/i),\r\n isWebkit = ua.match(/webkit/i),\r\n isSafari = (ua.match(/safari/i) && !ua.match(/chrome/i)),\r\n isOpera = (ua.match(/opera/i)),\r\n mobileHTML5 = (ua.match(/(mobile|pre\\/|xoom)/i) || is_iDevice || isAndroid),\r\n isBadSafari = (!wl.match(/usehtml5audio/i) && !wl.match(/sm2-ignorebadua/i) && isSafari && !ua.match(/silk/i) && ua.match(/OS\\sX\\s10_6_([3-7])/i)), // Safari 4 and 5 (excluding Kindle Fire, \"Silk\") occasionally fail to load/play HTML5 audio on Snow Leopard 10.6.3 through 10.6.7 due to bug(s) in QuickTime X and/or other underlying frameworks. :/ Confirmed bug. https://bugs.webkit.org/show_bug.cgi?id=32159\r\n hasConsole = (window.console !== _undefined && console.log !== _undefined),\r\n isFocused = (doc.hasFocus !== _undefined ? doc.hasFocus() : null),\r\n tryInitOnFocus = (isSafari && (doc.hasFocus === _undefined || !doc.hasFocus())),\r\n okToDisable = !tryInitOnFocus,\r\n flashMIME = /(mp3|mp4|mpa|m4a|m4b)/i,\r\n emptyURL = 'about:blank', // safe URL to unload, or load nothing from (flash 8 + most HTML5 UAs)\r\n emptyWAV = 'data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==', // tiny WAV for HTML5 unloading\r\n overHTTP = (doc.location ? doc.location.protocol.match(/http/i) : null),\r\n http = (!overHTTP ? '//' : ''),\r\n // mp3, mp4, aac etc.\r\n netStreamMimeTypes = /^\\s*audio\\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\\s*(?:$|;)/i,\r\n // Flash v9.0r115+ \"moviestar\" formats\r\n netStreamTypes = ['mpeg4', 'aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'm4b', 'mp4v', '3gp', '3g2'],\r\n netStreamPattern = new RegExp('\\\\.(' + netStreamTypes.join('|') + ')(\\\\?.*)?$', 'i');\r\n\r\n this.mimePattern = /^\\s*audio\\/(?:x-)?(?:mp(?:eg|3))\\s*(?:$|;)/i; // default mp3 set\r\n\r\n // use altURL if not \"online\"\r\n this.useAltURL = !overHTTP;\r\n\r\n swfCSS = {\r\n swfBox: 'sm2-object-box',\r\n swfDefault: 'movieContainer',\r\n swfError: 'swf_error', // SWF loaded, but SM2 couldn't start (other error)\r\n swfTimedout: 'swf_timedout',\r\n swfLoaded: 'swf_loaded',\r\n swfUnblocked: 'swf_unblocked', // or loaded OK\r\n sm2Debug: 'sm2_debug',\r\n highPerf: 'high_performance',\r\n flashDebug: 'flash_debug'\r\n };\r\n\r\n /**\r\n * HTML5 error codes, per W3C\r\n * Error code 1, MEDIA_ERR_ABORTED: Client aborted download at user's request.\r\n * Error code 2, MEDIA_ERR_NETWORK: A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable.\r\n * Error code 3, MEDIA_ERR_DECODE: An error of some description occurred while decoding the media resource, after the resource was established to be usable.\r\n * Error code 4, MEDIA_ERR_SRC_NOT_SUPPORTED: Media (audio file) not supported (\"not usable.\")\r\n * Reference: https://html.spec.whatwg.org/multipage/embedded-content.html#error-codes\r\n */\r\n html5ErrorCodes = [\r\n null,\r\n 'MEDIA_ERR_ABORTED',\r\n 'MEDIA_ERR_NETWORK',\r\n 'MEDIA_ERR_DECODE',\r\n 'MEDIA_ERR_SRC_NOT_SUPPORTED'\r\n ];\r\n\r\n /**\r\n * basic HTML5 Audio() support test\r\n * try...catch because of IE 9 \"not implemented\" nonsense\r\n * https://github.com/Modernizr/Modernizr/issues/224\r\n */\r\n\r\n this.hasHTML5 = (function() {\r\n try {\r\n // new Audio(null) for stupid Opera 9.64 case, which throws not_enough_arguments exception otherwise.\r\n return (Audio !== _undefined && (isOpera && opera !== _undefined && opera.version() < 10 ? new Audio(null) : new Audio()).canPlayType !== _undefined);\r\n } catch(e) {\r\n return false;\r\n }\r\n }());\r\n\r\n /**\r\n * Public SoundManager API\r\n * -----------------------\r\n */\r\n\r\n /**\r\n * Configures top-level soundManager properties.\r\n *\r\n * @param {object} options Option parameters, eg. { flashVersion: 9, url: '/path/to/swfs/' }\r\n * onready and ontimeout are also accepted parameters. call soundManager.setup() to see the full list.\r\n */\r\n\r\n this.setup = function(options) {\r\n\r\n var noURL = (!sm2.url);\r\n\r\n // warn if flash options have already been applied\r\n\r\n if (options !== _undefined && didInit && needsFlash && sm2.ok() && (options.flashVersion !== _undefined || options.url !== _undefined || options.html5Test !== _undefined)) {\r\n complain(str('setupLate'));\r\n }\r\n\r\n // TODO: defer: true?\r\n\r\n assign(options);\r\n\r\n if (!useGlobalHTML5Audio) {\r\n\r\n if (mobileHTML5) {\r\n\r\n // force the singleton HTML5 pattern on mobile, by default.\r\n if (!sm2.setupOptions.ignoreMobileRestrictions || sm2.setupOptions.forceUseGlobalHTML5Audio) {\r\n messages.push(strings.globalHTML5);\r\n useGlobalHTML5Audio = true;\r\n }\r\n\r\n } else if (sm2.setupOptions.forceUseGlobalHTML5Audio) {\r\n\r\n // only apply singleton HTML5 on desktop if forced.\r\n messages.push(strings.globalHTML5);\r\n useGlobalHTML5Audio = true;\r\n\r\n }\r\n\r\n }\r\n\r\n if (!didSetup && mobileHTML5) {\r\n\r\n if (sm2.setupOptions.ignoreMobileRestrictions) {\r\n\r\n messages.push(strings.ignoreMobile);\r\n\r\n } else {\r\n\r\n // prefer HTML5 for mobile + tablet-like devices, probably more reliable vs. flash at this point.\r\n\r\n // <d>\r\n if (!sm2.setupOptions.useHTML5Audio || sm2.setupOptions.preferFlash) {\r\n // notify that defaults are being changed.\r\n sm2._wD(strings.mobileUA);\r\n }\r\n // </d>\r\n\r\n sm2.setupOptions.useHTML5Audio = true;\r\n sm2.setupOptions.preferFlash = false;\r\n\r\n if (is_iDevice) {\r\n\r\n // no flash here.\r\n sm2.ignoreFlash = true;\r\n\r\n } else if ((isAndroid && !ua.match(/android\\s2\\.3/i)) || !isAndroid) {\r\n\r\n /**\r\n * Android devices tend to work better with a single audio instance, specifically for chained playback of sounds in sequence.\r\n * Common use case: exiting sound onfinish() -> createSound() -> play()\r\n * Presuming similar restrictions for other mobile, non-Android, non-iOS devices.\r\n */\r\n\r\n // <d>\r\n sm2._wD(strings.globalHTML5);\r\n // </d>\r\n\r\n useGlobalHTML5Audio = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // special case 1: \"Late setup\". SM2 loaded normally, but user didn't assign flash URL eg., setup({url:...}) before SM2 init. Treat as delayed init.\r\n\r\n if (options) {\r\n\r\n if (noURL && didDCLoaded && options.url !== _undefined) {\r\n sm2.beginDelayedInit();\r\n }\r\n\r\n // special case 2: If lazy-loading SM2 (DOMContentLoaded has already happened) and user calls setup() with url: parameter, try to init ASAP.\r\n\r\n if (!didDCLoaded && options.url !== _undefined && doc.readyState === 'complete') {\r\n setTimeout(domContentLoaded, 1);\r\n }\r\n\r\n }\r\n\r\n didSetup = true;\r\n\r\n return sm2;\r\n\r\n };\r\n\r\n this.ok = function() {\r\n\r\n return (needsFlash ? (didInit && !disabled) : (sm2.useHTML5Audio && sm2.hasHTML5));\r\n\r\n };\r\n\r\n this.supported = this.ok; // legacy\r\n\r\n this.getMovie = function(movie_id) {\r\n\r\n // safety net: some old browsers differ on SWF references, possibly related to ExternalInterface / flash version\r\n return id(movie_id) || doc[movie_id] || window[movie_id];\r\n\r\n };\r\n\r\n /**\r\n * Creates a SMSound sound object instance. Can also be overloaded, e.g., createSound('mySound', '/some.mp3');\r\n *\r\n * @param {object} oOptions Sound options (at minimum, url parameter is required.)\r\n * @return {object} SMSound The new SMSound object.\r\n */\r\n\r\n this.createSound = function(oOptions, _url) {\r\n\r\n var cs, cs_string, options, oSound = null;\r\n\r\n // <d>\r\n cs = sm + '.createSound(): ';\r\n cs_string = cs + str(!didInit ? 'notReady' : 'notOK');\r\n // </d>\r\n\r\n if (!didInit || !sm2.ok()) {\r\n complain(cs_string);\r\n return false;\r\n }\r\n\r\n if (_url !== _undefined) {\r\n // function overloading in JS! :) ... assume simple createSound(id, url) use case.\r\n oOptions = {\r\n id: oOptions,\r\n url: _url\r\n };\r\n }\r\n\r\n // inherit from defaultOptions\r\n options = mixin(oOptions);\r\n\r\n options.url = parseURL(options.url);\r\n\r\n // generate an id, if needed.\r\n if (options.id === _undefined) {\r\n options.id = sm2.setupOptions.idPrefix + (idCounter++);\r\n }\r\n\r\n // <d>\r\n if (options.id.toString().charAt(0).match(/^[0-9]$/)) {\r\n sm2._wD(cs + str('badID', options.id), 2);\r\n }\r\n\r\n sm2._wD(cs + options.id + (options.url ? ' (' + options.url + ')' : ''), 1);\r\n // </d>\r\n\r\n if (idCheck(options.id, true)) {\r\n sm2._wD(cs + options.id + ' exists', 1);\r\n return sm2.sounds[options.id];\r\n }\r\n\r\n function make() {\r\n\r\n options = loopFix(options);\r\n sm2.sounds[options.id] = new SMSound(options);\r\n sm2.soundIDs.push(options.id);\r\n return sm2.sounds[options.id];\r\n\r\n }\r\n\r\n if (html5OK(options)) {\r\n\r\n oSound = make();\r\n // <d>\r\n if (!sm2.html5Only) {\r\n sm2._wD(options.id + ': Using HTML5');\r\n }\r\n // </d>\r\n oSound._setup_html5(options);\r\n\r\n } else {\r\n\r\n if (sm2.html5Only) {\r\n sm2._wD(options.id + ': No HTML5 support for this sound, and no Flash. Exiting.');\r\n return make();\r\n }\r\n\r\n // TODO: Move HTML5/flash checks into generic URL parsing/handling function.\r\n\r\n if (sm2.html5.usingFlash && options.url && options.url.match(/data:/i)) {\r\n // data: URIs not supported by Flash, either.\r\n sm2._wD(options.id + ': data: URIs not supported via Flash. Exiting.');\r\n return make();\r\n }\r\n\r\n if (fV > 8) {\r\n if (options.isMovieStar === null) {\r\n // attempt to detect MPEG-4 formats\r\n options.isMovieStar = !!(options.serverURL || (options.type ? options.type.match(netStreamMimeTypes) : false) || (options.url && options.url.match(netStreamPattern)));\r\n }\r\n // <d>\r\n if (options.isMovieStar) {\r\n sm2._wD(cs + 'using MovieStar handling');\r\n if (options.loops > 1) {\r\n _wDS('noNSLoop');\r\n }\r\n }\r\n // </d>\r\n }\r\n\r\n options = policyFix(options, cs);\r\n oSound = make();\r\n\r\n if (fV === 8) {\r\n flash._createSound(options.id, options.loops || 1, options.usePolicyFile);\r\n } else {\r\n flash._createSound(options.id, options.url, options.usePeakData, options.useWaveformData, options.useEQData, options.isMovieStar, (options.isMovieStar ? options.bufferTime : false), options.loops || 1, options.serverURL, options.duration || null, options.autoPlay, true, options.autoLoad, options.usePolicyFile);\r\n if (!options.serverURL) {\r\n // We are connected immediately\r\n oSound.connected = true;\r\n if (options.onconnect) {\r\n options.onconnect.apply(oSound);\r\n }\r\n }\r\n }\r\n\r\n if (!options.serverURL && (options.autoLoad || options.autoPlay)) {\r\n // call load for non-rtmp streams\r\n oSound.load(options);\r\n }\r\n\r\n }\r\n\r\n // rtmp will play in onconnect\r\n if (!options.serverURL && options.autoPlay) {\r\n oSound.play();\r\n }\r\n\r\n return oSound;\r\n\r\n };\r\n\r\n /**\r\n * Destroys a SMSound sound object instance.\r\n *\r\n * @param {string} sID The ID of the sound to destroy\r\n */\r\n\r\n this.destroySound = function(sID, _bFromSound) {\r\n\r\n // explicitly destroy a sound before normal page unload, etc.\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n var oS = sm2.sounds[sID], i;\r\n\r\n oS.stop();\r\n\r\n // Disable all callbacks after stop(), when the sound is being destroyed\r\n oS._iO = {};\r\n\r\n oS.unload();\r\n\r\n for (i = 0; i < sm2.soundIDs.length; i++) {\r\n if (sm2.soundIDs[i] === sID) {\r\n sm2.soundIDs.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n if (!_bFromSound) {\r\n // ignore if being called from SMSound instance\r\n oS.destruct(true);\r\n }\r\n\r\n oS = null;\r\n delete sm2.sounds[sID];\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Calls the load() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {object} oOptions Optional: Sound options\r\n */\r\n\r\n this.load = function(sID, oOptions) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].load(oOptions);\r\n\r\n };\r\n\r\n /**\r\n * Calls the unload() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n */\r\n\r\n this.unload = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].unload();\r\n\r\n };\r\n\r\n /**\r\n * Calls the onPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod The relevant callback to fire\r\n * @param {object} oScope Optional: The scope to apply the callback to\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.onPosition = function(sID, nPosition, oMethod, oScope) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].onposition(nPosition, oMethod, oScope);\r\n\r\n };\r\n\r\n // legacy/backwards-compability: lower-case method name\r\n this.onposition = this.onPosition;\r\n\r\n /**\r\n * Calls the clearOnPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod Optional: The relevant callback to fire\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.clearOnPosition = function(sID, nPosition, oMethod) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].clearOnPosition(nPosition, oMethod);\r\n\r\n };\r\n\r\n /**\r\n * Calls the play() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {object} oOptions Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.play = function(sID, oOptions) {\r\n\r\n var result = null,\r\n // legacy function-overloading use case: play('mySound', '/path/to/some.mp3');\r\n overloaded = (oOptions && !(oOptions instanceof Object));\r\n\r\n if (!didInit || !sm2.ok()) {\r\n complain(sm + '.play(): ' + str(!didInit ? 'notReady' : 'notOK'));\r\n return false;\r\n }\r\n\r\n if (!idCheck(sID, overloaded)) {\r\n\r\n // no sound found for the given ID. Bail.\r\n if (!overloaded) return false;\r\n\r\n if (overloaded) {\r\n oOptions = {\r\n url: oOptions\r\n };\r\n }\r\n\r\n if (oOptions && oOptions.url) {\r\n // overloading use case, create+play: .play('someID', {url:'/path/to.mp3'});\r\n sm2._wD(sm + '.play(): Attempting to create \"' + sID + '\"', 1);\r\n oOptions.id = sID;\r\n result = sm2.createSound(oOptions).play();\r\n }\r\n\r\n } else if (overloaded) {\r\n\r\n // existing sound object case\r\n oOptions = {\r\n url: oOptions\r\n };\r\n\r\n }\r\n\r\n if (result === null) {\r\n // default case\r\n result = sm2.sounds[sID].play(oOptions);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n // just for convenience\r\n this.start = this.play;\r\n\r\n /**\r\n * Calls the setPlaybackRate() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPlaybackRate = function(sID, rate, allowOverride) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPlaybackRate(rate, allowOverride);\r\n\r\n };\r\n\r\n /**\r\n * Calls the setPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nMsecOffset Position (milliseconds)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPosition = function(sID, nMsecOffset) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPosition(nMsecOffset);\r\n\r\n };\r\n\r\n /**\r\n * Calls the stop() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.stop = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.stop(' + sID + ')', 1);\r\n\r\n return sm2.sounds[sID].stop();\r\n\r\n };\r\n\r\n /**\r\n * Stops all currently-playing sounds.\r\n */\r\n\r\n this.stopAll = function() {\r\n\r\n var oSound;\r\n sm2._wD(sm + '.stopAll()', 1);\r\n\r\n for (oSound in sm2.sounds) {\r\n if (sm2.sounds.hasOwnProperty(oSound)) {\r\n // apply only to sound objects\r\n sm2.sounds[oSound].stop();\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the pause() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.pause = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].pause();\r\n\r\n };\r\n\r\n /**\r\n * Pauses all currently-playing sounds.\r\n */\r\n\r\n this.pauseAll = function() {\r\n\r\n var i;\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].pause();\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the resume() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.resume = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].resume();\r\n\r\n };\r\n\r\n /**\r\n * Resumes all currently-paused sounds.\r\n */\r\n\r\n this.resumeAll = function() {\r\n\r\n var i;\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].resume();\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the togglePause() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.togglePause = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].togglePause();\r\n\r\n };\r\n\r\n /**\r\n * Calls the setPan() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPan The pan value (-100 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPan = function(sID, nPan) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPan(nPan);\r\n\r\n };\r\n\r\n /**\r\n * Calls the setVolume() method of a SMSound object by ID\r\n * Overloaded case: pass only volume argument eg., setVolume(50) to apply to all sounds.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nVol The volume value (0 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setVolume = function(sID, nVol) {\r\n\r\n // setVolume(50) function overloading case - apply to all sounds\r\n\r\n var i, j;\r\n\r\n if (sID !== _undefined && !isNaN(sID) && nVol === _undefined) {\r\n for (i = 0, j = sm2.soundIDs.length; i < j; i++) {\r\n sm2.sounds[sm2.soundIDs[i]].setVolume(sID);\r\n }\r\n return false;\r\n }\r\n\r\n // setVolume('mySound', 50) case\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setVolume(nVol);\r\n\r\n };\r\n\r\n /**\r\n * Calls the mute() method of either a single SMSound object by ID, or all sound objects.\r\n *\r\n * @param {string} sID Optional: The ID of the sound (if omitted, all sounds will be used.)\r\n */\r\n\r\n this.mute = function(sID) {\r\n\r\n var i = 0;\r\n\r\n if (sID instanceof String) {\r\n sID = null;\r\n }\r\n\r\n if (!sID) {\r\n\r\n sm2._wD(sm + '.mute(): Muting all sounds');\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].mute();\r\n }\r\n sm2.muted = true;\r\n\r\n } else {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.mute(): Muting \"' + sID + '\"');\r\n return sm2.sounds[sID].mute();\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Mutes all sounds.\r\n */\r\n\r\n this.muteAll = function() {\r\n\r\n sm2.mute();\r\n\r\n };\r\n\r\n /**\r\n * Calls the unmute() method of either a single SMSound object by ID, or all sound objects.\r\n *\r\n * @param {string} sID Optional: The ID of the sound (if omitted, all sounds will be used.)\r\n */\r\n\r\n this.unmute = function(sID) {\r\n\r\n var i;\r\n\r\n if (sID instanceof String) {\r\n sID = null;\r\n }\r\n\r\n if (!sID) {\r\n\r\n sm2._wD(sm + '.unmute(): Unmuting all sounds');\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].unmute();\r\n }\r\n sm2.muted = false;\r\n\r\n } else {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.unmute(): Unmuting \"' + sID + '\"');\r\n\r\n return sm2.sounds[sID].unmute();\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Unmutes all sounds.\r\n */\r\n\r\n this.unmuteAll = function() {\r\n\r\n sm2.unmute();\r\n\r\n };\r\n\r\n /**\r\n * Calls the toggleMute() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.toggleMute = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].toggleMute();\r\n\r\n };\r\n\r\n /**\r\n * Retrieves the memory used by the flash plugin.\r\n *\r\n * @return {number} The amount of memory in use\r\n */\r\n\r\n this.getMemoryUse = function() {\r\n\r\n // flash-only\r\n var ram = 0;\r\n\r\n if (flash && fV !== 8) {\r\n ram = parseInt(flash._getMemoryUse(), 10);\r\n }\r\n\r\n return ram;\r\n\r\n };\r\n\r\n /**\r\n * Undocumented: NOPs soundManager and all SMSound objects.\r\n */\r\n\r\n this.disable = function(bNoDisable) {\r\n\r\n // destroy all functions\r\n var i;\r\n\r\n if (bNoDisable === _undefined) {\r\n bNoDisable = false;\r\n }\r\n\r\n // already disabled?\r\n if (disabled) return false;\r\n\r\n disabled = true;\r\n\r\n _wDS('shutdown', 1);\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n disableObject(sm2.sounds[sm2.soundIDs[i]]);\r\n }\r\n\r\n disableObject(sm2);\r\n\r\n // fire \"complete\", despite fail\r\n initComplete(bNoDisable);\r\n\r\n event.remove(window, 'load', initUserOnload);\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of a MIME type, eg. 'audio/mp3'.\r\n */\r\n\r\n this.canPlayMIME = function(sMIME) {\r\n\r\n var result;\r\n\r\n if (sm2.hasHTML5) {\r\n result = html5CanPlay({\r\n type: sMIME\r\n });\r\n }\r\n\r\n if (!result && needsFlash) {\r\n // if flash 9, test netStream (movieStar) types as well.\r\n result = (sMIME && sm2.ok() ? !!((fV > 8 ? sMIME.match(netStreamMimeTypes) : null) || sMIME.match(sm2.mimePattern)) : null); // TODO: make less \"weird\" (per JSLint)\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of a URL based on audio support.\r\n *\r\n * @param {string} sURL The URL to test\r\n * @return {boolean} URL playability\r\n */\r\n\r\n this.canPlayURL = function(sURL) {\r\n\r\n var result;\r\n\r\n if (sm2.hasHTML5) {\r\n result = html5CanPlay({\r\n url: sURL\r\n });\r\n }\r\n\r\n if (!result && needsFlash) {\r\n result = (sURL && sm2.ok() ? !!(sURL.match(sm2.filePattern)) : null);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of an HTML DOM &lt;a&gt; object (or similar object literal) based on audio support.\r\n *\r\n * @param {object} oLink an HTML DOM &lt;a&gt; object or object literal including href and/or type attributes\r\n * @return {boolean} URL playability\r\n */\r\n\r\n this.canPlayLink = function(oLink) {\r\n\r\n if (oLink.type !== _undefined && oLink.type && sm2.canPlayMIME(oLink.type)) return true;\r\n\r\n return sm2.canPlayURL(oLink.href);\r\n\r\n };\r\n\r\n /**\r\n * Retrieves a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.getSoundById = function(sID, _suppressDebug) {\r\n\r\n if (!sID) return null;\r\n\r\n var result = sm2.sounds[sID];\r\n\r\n // <d>\r\n if (!result && !_suppressDebug) {\r\n sm2._wD(sm + '.getSoundById(): Sound \"' + sID + '\" not found.', 2);\r\n }\r\n // </d>\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Queues a callback for execution when SoundManager has successfully initialized.\r\n *\r\n * @param {function} oMethod The callback method to fire\r\n * @param {object} oScope Optional: The scope to apply to the callback\r\n */\r\n\r\n this.onready = function(oMethod, oScope) {\r\n\r\n var sType = 'onready',\r\n result = false;\r\n\r\n if (typeof oMethod === 'function') {\r\n\r\n // <d>\r\n if (didInit) {\r\n sm2._wD(str('queue', sType));\r\n }\r\n // </d>\r\n\r\n if (!oScope) {\r\n oScope = window;\r\n }\r\n\r\n addOnEvent(sType, oMethod, oScope);\r\n processOnEvents();\r\n\r\n result = true;\r\n\r\n } else {\r\n\r\n throw str('needFunction', sType);\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Queues a callback for execution when SoundManager has failed to initialize.\r\n *\r\n * @param {function} oMethod The callback method to fire\r\n * @param {object} oScope Optional: The scope to apply to the callback\r\n */\r\n\r\n this.ontimeout = function(oMethod, oScope) {\r\n\r\n var sType = 'ontimeout',\r\n result = false;\r\n\r\n if (typeof oMethod === 'function') {\r\n\r\n // <d>\r\n if (didInit) {\r\n sm2._wD(str('queue', sType));\r\n }\r\n // </d>\r\n\r\n if (!oScope) {\r\n oScope = window;\r\n }\r\n\r\n addOnEvent(sType, oMethod, oScope);\r\n processOnEvents({ type: sType });\r\n\r\n result = true;\r\n\r\n } else {\r\n\r\n throw str('needFunction', sType);\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Writes console.log()-style debug output to a console or in-browser element.\r\n * Applies when debugMode = true\r\n *\r\n * @param {string} sText The console message\r\n * @param {object} nType Optional log level (number), or object. Number case: Log type/style where 0 = 'info', 1 = 'warn', 2 = 'error'. Object case: Object to be dumped.\r\n */\r\n\r\n this._writeDebug = function(sText, sTypeOrObject) {\r\n\r\n // pseudo-private console.log()-style output\r\n // <d>\r\n\r\n var sDID = 'soundmanager-debug', o, oItem;\r\n\r\n if (!sm2.setupOptions.debugMode) return false;\r\n\r\n if (hasConsole && sm2.useConsole) {\r\n if (sTypeOrObject && typeof sTypeOrObject === 'object') {\r\n // object passed; dump to console.\r\n console.log(sText, sTypeOrObject);\r\n } else if (debugLevels[sTypeOrObject] !== _undefined) {\r\n console[debugLevels[sTypeOrObject]](sText);\r\n } else {\r\n console.log(sText);\r\n }\r\n if (sm2.consoleOnly) return true;\r\n }\r\n\r\n o = id(sDID);\r\n\r\n if (!o) return false;\r\n\r\n oItem = doc.createElement('div');\r\n\r\n if (++wdCount % 2 === 0) {\r\n oItem.className = 'sm2-alt';\r\n }\r\n\r\n if (sTypeOrObject === _undefined) {\r\n sTypeOrObject = 0;\r\n } else {\r\n sTypeOrObject = parseInt(sTypeOrObject, 10);\r\n }\r\n\r\n oItem.appendChild(doc.createTextNode(sText));\r\n\r\n if (sTypeOrObject) {\r\n if (sTypeOrObject >= 2) {\r\n oItem.style.fontWeight = 'bold';\r\n }\r\n if (sTypeOrObject === 3) {\r\n oItem.style.color = '#ff3333';\r\n }\r\n }\r\n\r\n // top-to-bottom\r\n // o.appendChild(oItem);\r\n\r\n // bottom-to-top\r\n o.insertBefore(oItem, o.firstChild);\r\n\r\n o = null;\r\n // </d>\r\n\r\n return true;\r\n\r\n };\r\n\r\n // <d>\r\n // last-resort debugging option\r\n if (wl.indexOf('sm2-debug=alert') !== -1) {\r\n this._writeDebug = function(sText) {\r\n window.alert(sText);\r\n };\r\n }\r\n // </d>\r\n\r\n // alias\r\n this._wD = this._writeDebug;\r\n\r\n /**\r\n * Provides debug / state information on all SMSound objects.\r\n */\r\n\r\n this._debug = function() {\r\n\r\n // <d>\r\n var i, j;\r\n _wDS('currentObj', 1);\r\n\r\n for (i = 0, j = sm2.soundIDs.length; i < j; i++) {\r\n sm2.sounds[sm2.soundIDs[i]]._debug();\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n /**\r\n * Restarts and re-initializes the SoundManager instance.\r\n *\r\n * @param {boolean} resetEvents Optional: When true, removes all registered onready and ontimeout event callbacks.\r\n * @param {boolean} excludeInit Options: When true, does not call beginDelayedInit() (which would restart SM2).\r\n * @return {object} soundManager The soundManager instance.\r\n */\r\n\r\n this.reboot = function(resetEvents, excludeInit) {\r\n\r\n // reset some (or all) state, and re-init unless otherwise specified.\r\n\r\n // <d>\r\n if (sm2.soundIDs.length) {\r\n sm2._wD('Destroying ' + sm2.soundIDs.length + ' SMSound object' + (sm2.soundIDs.length !== 1 ? 's' : '') + '...');\r\n }\r\n // </d>\r\n\r\n var i, j, k;\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].destruct();\r\n }\r\n\r\n // trash ze flash (remove from the DOM)\r\n\r\n if (flash) {\r\n\r\n try {\r\n\r\n if (isIE) {\r\n oRemovedHTML = flash.innerHTML;\r\n }\r\n\r\n oRemoved = flash.parentNode.removeChild(flash);\r\n\r\n } catch(e) {\r\n\r\n // Remove failed? May be due to flash blockers silently removing the SWF object/embed node from the DOM. Warn and continue.\r\n\r\n _wDS('badRemove', 2);\r\n\r\n }\r\n\r\n }\r\n\r\n // actually, force recreate of movie.\r\n\r\n oRemovedHTML = oRemoved = needsFlash = flash = null;\r\n\r\n sm2.enabled = didDCLoaded = didInit = waitingForEI = initPending = didAppend = appendSuccess = disabled = useGlobalHTML5Audio = sm2.swfLoaded = false;\r\n\r\n sm2.soundIDs = [];\r\n sm2.sounds = {};\r\n\r\n idCounter = 0;\r\n didSetup = false;\r\n\r\n if (!resetEvents) {\r\n // reset callbacks for onready, ontimeout etc. so that they will fire again on re-init\r\n for (i in on_queue) {\r\n if (on_queue.hasOwnProperty(i)) {\r\n for (j = 0, k = on_queue[i].length; j < k; j++) {\r\n on_queue[i][j].fired = false;\r\n }\r\n }\r\n }\r\n } else {\r\n // remove all callbacks entirely\r\n on_queue = [];\r\n }\r\n\r\n // <d>\r\n if (!excludeInit) {\r\n sm2._wD(sm + ': Rebooting...');\r\n }\r\n // </d>\r\n\r\n // reset HTML5 and flash canPlay test results\r\n\r\n sm2.html5 = {\r\n usingFlash: null\r\n };\r\n\r\n sm2.flash = {};\r\n\r\n // reset device-specific HTML/flash mode switches\r\n\r\n sm2.html5Only = false;\r\n sm2.ignoreFlash = false;\r\n\r\n window.setTimeout(function() {\r\n\r\n // by default, re-init\r\n\r\n if (!excludeInit) {\r\n sm2.beginDelayedInit();\r\n }\r\n\r\n }, 20);\r\n\r\n return sm2;\r\n\r\n };\r\n\r\n this.reset = function() {\r\n\r\n /**\r\n * Shuts down and restores the SoundManager instance to its original loaded state, without an explicit reboot. All onready/ontimeout handlers are removed.\r\n * After this call, SM2 may be re-initialized via soundManager.beginDelayedInit().\r\n * @return {object} soundManager The soundManager instance.\r\n */\r\n\r\n _wDS('reset');\r\n\r\n return sm2.reboot(true, true);\r\n\r\n };\r\n\r\n /**\r\n * Undocumented: Determines the SM2 flash movie's load progress.\r\n *\r\n * @return {number or null} Percent loaded, or if invalid/unsupported, null.\r\n */\r\n\r\n this.getMoviePercent = function() {\r\n\r\n /**\r\n * Interesting syntax notes...\r\n * Flash/ExternalInterface (ActiveX/NPAPI) bridge methods are not typeof \"function\" nor instanceof Function, but are still valid.\r\n * Furthermore, using (flash && flash.PercentLoaded) causes IE to throw \"object doesn't support this property or method\".\r\n * Thus, 'in' syntax must be used.\r\n */\r\n\r\n return (flash && 'PercentLoaded' in flash ? flash.PercentLoaded() : null);\r\n\r\n };\r\n\r\n /**\r\n * Additional helper for manually invoking SM2's init process after DOM Ready / window.onload().\r\n */\r\n\r\n this.beginDelayedInit = function() {\r\n\r\n windowLoaded = true;\r\n domContentLoaded();\r\n\r\n setTimeout(function() {\r\n\r\n if (initPending) return false;\r\n\r\n createMovie();\r\n initMovie();\r\n initPending = true;\r\n\r\n return true;\r\n\r\n }, 20);\r\n\r\n delayWaitForEI();\r\n\r\n };\r\n\r\n /**\r\n * Destroys the SoundManager instance and all SMSound instances.\r\n */\r\n\r\n this.destruct = function() {\r\n\r\n sm2._wD(sm + '.destruct()');\r\n sm2.disable(true);\r\n\r\n };\r\n\r\n /**\r\n * SMSound() (sound object) constructor\r\n * ------------------------------------\r\n *\r\n * @param {object} oOptions Sound options (id and url are required attributes)\r\n * @return {SMSound} The new SMSound object\r\n */\r\n\r\n SMSound = function(oOptions) {\r\n\r\n var s = this, resetProperties, add_html5_events, remove_html5_events, stop_html5_timer, start_html5_timer, attachOnPosition, onplay_called = false, onPositionItems = [], onPositionFired = 0, detachOnPosition, applyFromTo, lastURL = null, lastHTML5State, urlOmitted;\r\n\r\n lastHTML5State = {\r\n // tracks duration + position (time)\r\n duration: null,\r\n time: null\r\n };\r\n\r\n this.id = oOptions.id;\r\n\r\n // legacy\r\n this.sID = this.id;\r\n\r\n this.url = oOptions.url;\r\n this.options = mixin(oOptions);\r\n\r\n // per-play-instance-specific options\r\n this.instanceOptions = this.options;\r\n\r\n // short alias\r\n this._iO = this.instanceOptions;\r\n\r\n // assign property defaults\r\n this.pan = this.options.pan;\r\n this.volume = this.options.volume;\r\n\r\n // whether or not this object is using HTML5\r\n this.isHTML5 = false;\r\n\r\n // internal HTML5 Audio() object reference\r\n this._a = null;\r\n\r\n // for flash 8 special-case createSound() without url, followed by load/play with url case\r\n urlOmitted = (!this.url);\r\n\r\n /**\r\n * SMSound() public methods\r\n * ------------------------\r\n */\r\n\r\n this.id3 = {};\r\n\r\n /**\r\n * Writes SMSound object parameters to debug console\r\n */\r\n\r\n this._debug = function() {\r\n\r\n // <d>\r\n sm2._wD(s.id + ': Merged options:', s.options);\r\n // </d>\r\n\r\n };\r\n\r\n /**\r\n * Begins loading a sound per its *url*.\r\n *\r\n * @param {object} options Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.load = function(options) {\r\n\r\n var oSound = null, instanceOptions;\r\n\r\n if (options !== _undefined) {\r\n s._iO = mixin(options, s.options);\r\n } else {\r\n options = s.options;\r\n s._iO = options;\r\n if (lastURL && lastURL !== s.url) {\r\n _wDS('manURL');\r\n s._iO.url = s.url;\r\n s.url = null;\r\n }\r\n }\r\n\r\n if (!s._iO.url) {\r\n s._iO.url = s.url;\r\n }\r\n\r\n s._iO.url = parseURL(s._iO.url);\r\n\r\n // ensure we're in sync\r\n s.instanceOptions = s._iO;\r\n\r\n // local shortcut\r\n instanceOptions = s._iO;\r\n\r\n sm2._wD(s.id + ': load (' + instanceOptions.url + ')');\r\n\r\n if (!instanceOptions.url && !s.url) {\r\n sm2._wD(s.id + ': load(): url is unassigned. Exiting.', 2);\r\n return s;\r\n }\r\n\r\n // <d>\r\n if (!s.isHTML5 && fV === 8 && !s.url && !instanceOptions.autoPlay) {\r\n // flash 8 load() -> play() won't work before onload has fired.\r\n sm2._wD(s.id + ': Flash 8 load() limitation: Wait for onload() before calling play().', 1);\r\n }\r\n // </d>\r\n\r\n if (instanceOptions.url === s.url && s.readyState !== 0 && s.readyState !== 2) {\r\n _wDS('onURL', 1);\r\n // if loaded and an onload() exists, fire immediately.\r\n if (s.readyState === 3 && instanceOptions.onload) {\r\n // assume success based on truthy duration.\r\n wrapCallback(s, function() {\r\n instanceOptions.onload.apply(s, [(!!s.duration)]);\r\n });\r\n }\r\n return s;\r\n }\r\n\r\n // reset a few state properties\r\n\r\n s.loaded = false;\r\n s.readyState = 1;\r\n s.playState = 0;\r\n s.id3 = {};\r\n\r\n // TODO: If switching from HTML5 -> flash (or vice versa), stop currently-playing audio.\r\n\r\n if (html5OK(instanceOptions)) {\r\n\r\n oSound = s._setup_html5(instanceOptions);\r\n\r\n if (!oSound._called_load) {\r\n\r\n s._html5_canplay = false;\r\n\r\n // TODO: review called_load / html5_canplay logic\r\n\r\n // if url provided directly to load(), assign it here.\r\n\r\n if (s.url !== instanceOptions.url) {\r\n\r\n sm2._wD(_wDS('manURL') + ': ' + instanceOptions.url);\r\n\r\n s._a.src = instanceOptions.url;\r\n\r\n // TODO: review / re-apply all relevant options (volume, loop, onposition etc.)\r\n\r\n // reset position for new URL\r\n s.setPosition(0);\r\n\r\n }\r\n\r\n // given explicit load call, try to preload.\r\n\r\n // early HTML5 implementation (non-standard)\r\n s._a.autobuffer = 'auto';\r\n\r\n // standard property, values: none / metadata / auto\r\n // reference: http://msdn.microsoft.com/en-us/library/ie/ff974759%28v=vs.85%29.aspx\r\n s._a.preload = 'auto';\r\n\r\n s._a._called_load = true;\r\n\r\n } else {\r\n\r\n sm2._wD(s.id + ': Ignoring request to load again');\r\n\r\n }\r\n\r\n } else {\r\n\r\n if (sm2.html5Only) {\r\n sm2._wD(s.id + ': No flash support. Exiting.');\r\n return s;\r\n }\r\n\r\n if (s._iO.url && s._iO.url.match(/data:/i)) {\r\n // data: URIs not supported by Flash, either.\r\n sm2._wD(s.id + ': data: URIs not supported via Flash. Exiting.');\r\n return s;\r\n }\r\n\r\n try {\r\n s.isHTML5 = false;\r\n s._iO = policyFix(loopFix(instanceOptions));\r\n // if we have \"position\", disable auto-play as we'll be seeking to that position at onload().\r\n if (s._iO.autoPlay && (s._iO.position || s._iO.from)) {\r\n sm2._wD(s.id + ': Disabling autoPlay because of non-zero offset case');\r\n s._iO.autoPlay = false;\r\n }\r\n // re-assign local shortcut\r\n instanceOptions = s._iO;\r\n if (fV === 8) {\r\n flash._load(s.id, instanceOptions.url, instanceOptions.stream, instanceOptions.autoPlay, instanceOptions.usePolicyFile);\r\n } else {\r\n flash._load(s.id, instanceOptions.url, !!(instanceOptions.stream), !!(instanceOptions.autoPlay), instanceOptions.loops || 1, !!(instanceOptions.autoLoad), instanceOptions.usePolicyFile);\r\n }\r\n } catch(e) {\r\n _wDS('smError', 2);\r\n debugTS('onload', false);\r\n catchError({\r\n type: 'SMSOUND_LOAD_JS_EXCEPTION',\r\n fatal: true\r\n });\r\n }\r\n\r\n }\r\n\r\n // after all of this, ensure sound url is up to date.\r\n s.url = instanceOptions.url;\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unloads a sound, canceling any open HTTP requests.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.unload = function() {\r\n\r\n // Flash 8/AS2 can't \"close\" a stream - fake it by loading an empty URL\r\n // Flash 9/AS3: Close stream, preventing further load\r\n // HTML5: Most UAs will use empty URL\r\n\r\n if (s.readyState !== 0) {\r\n\r\n sm2._wD(s.id + ': unload()');\r\n\r\n if (!s.isHTML5) {\r\n\r\n if (fV === 8) {\r\n flash._unload(s.id, emptyURL);\r\n } else {\r\n flash._unload(s.id);\r\n }\r\n\r\n } else {\r\n\r\n stop_html5_timer();\r\n\r\n if (s._a) {\r\n\r\n s._a.pause();\r\n\r\n // update empty URL, too\r\n lastURL = html5Unload(s._a);\r\n\r\n }\r\n\r\n }\r\n\r\n // reset load/status flags\r\n resetProperties();\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unloads and destroys a sound.\r\n */\r\n\r\n this.destruct = function(_bFromSM) {\r\n\r\n sm2._wD(s.id + ': Destruct');\r\n\r\n if (!s.isHTML5) {\r\n\r\n // kill sound within Flash\r\n // Disable the onfailure handler\r\n s._iO.onfailure = null;\r\n flash._destroySound(s.id);\r\n\r\n } else {\r\n\r\n stop_html5_timer();\r\n\r\n if (s._a) {\r\n s._a.pause();\r\n html5Unload(s._a);\r\n if (!useGlobalHTML5Audio) {\r\n remove_html5_events();\r\n }\r\n // break obvious circular reference\r\n s._a._s = null;\r\n s._a = null;\r\n }\r\n\r\n }\r\n\r\n if (!_bFromSM) {\r\n // ensure deletion from controller\r\n sm2.destroySound(s.id, true);\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Begins playing a sound.\r\n *\r\n * @param {object} options Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.play = function(options, _updatePlayState) {\r\n\r\n var fN, allowMulti, a, onready,\r\n audioClone, onended, oncanplay,\r\n startOK = true;\r\n\r\n // <d>\r\n fN = s.id + ': play(): ';\r\n // </d>\r\n\r\n // default to true\r\n _updatePlayState = (_updatePlayState === _undefined ? true : _updatePlayState);\r\n\r\n if (!options) {\r\n options = {};\r\n }\r\n\r\n // first, use local URL (if specified)\r\n if (s.url) {\r\n s._iO.url = s.url;\r\n }\r\n\r\n // mix in any options defined at createSound()\r\n s._iO = mixin(s._iO, s.options);\r\n\r\n // mix in any options specific to this method\r\n s._iO = mixin(options, s._iO);\r\n\r\n s._iO.url = parseURL(s._iO.url);\r\n\r\n s.instanceOptions = s._iO;\r\n\r\n // RTMP-only\r\n if (!s.isHTML5 && s._iO.serverURL && !s.connected) {\r\n if (!s.getAutoPlay()) {\r\n sm2._wD(fN + ' Netstream not connected yet - setting autoPlay');\r\n s.setAutoPlay(true);\r\n }\r\n // play will be called in onconnect()\r\n return s;\r\n }\r\n\r\n if (html5OK(s._iO)) {\r\n s._setup_html5(s._iO);\r\n start_html5_timer();\r\n }\r\n\r\n if (s.playState === 1 && !s.paused) {\r\n\r\n allowMulti = s._iO.multiShot;\r\n\r\n if (!allowMulti) {\r\n\r\n sm2._wD(fN + 'Already playing (one-shot)', 1);\r\n\r\n if (s.isHTML5) {\r\n // go back to original position.\r\n s.setPosition(s._iO.position);\r\n }\r\n\r\n return s;\r\n\r\n }\r\n\r\n sm2._wD(fN + 'Already playing (multi-shot)', 1);\r\n\r\n }\r\n\r\n // edge case: play() with explicit URL parameter\r\n if (options.url && options.url !== s.url) {\r\n\r\n // special case for createSound() followed by load() / play() with url; avoid double-load case.\r\n if (!s.readyState && !s.isHTML5 && fV === 8 && urlOmitted) {\r\n\r\n urlOmitted = false;\r\n\r\n } else {\r\n\r\n // load using merged options\r\n s.load(s._iO);\r\n\r\n }\r\n\r\n }\r\n\r\n if (!s.loaded) {\r\n\r\n if (s.readyState === 0) {\r\n\r\n sm2._wD(fN + 'Attempting to load');\r\n\r\n // try to get this sound playing ASAP\r\n if (!s.isHTML5 && !sm2.html5Only) {\r\n\r\n // flash: assign directly because setAutoPlay() increments the instanceCount\r\n s._iO.autoPlay = true;\r\n s.load(s._iO);\r\n\r\n } else if (s.isHTML5) {\r\n\r\n // iOS needs this when recycling sounds, loading a new URL on an existing object.\r\n s.load(s._iO);\r\n\r\n } else {\r\n\r\n sm2._wD(fN + 'Unsupported type. Exiting.');\r\n\r\n return s;\r\n\r\n }\r\n\r\n // HTML5 hack - re-set instanceOptions?\r\n s.instanceOptions = s._iO;\r\n\r\n } else if (s.readyState === 2) {\r\n\r\n sm2._wD(fN + 'Could not load - exiting', 2);\r\n\r\n return s;\r\n\r\n } else {\r\n\r\n sm2._wD(fN + 'Loading - attempting to play...');\r\n\r\n }\r\n\r\n } else {\r\n\r\n // \"play()\"\r\n sm2._wD(fN.substr(0, fN.lastIndexOf(':')));\r\n\r\n }\r\n\r\n if (!s.isHTML5 && fV === 9 && s.position > 0 && s.position === s.duration) {\r\n // flash 9 needs a position reset if play() is called while at the end of a sound.\r\n sm2._wD(fN + 'Sound at end, resetting to position: 0');\r\n options.position = 0;\r\n }\r\n\r\n /**\r\n * Streams will pause when their buffer is full if they are being loaded.\r\n * In this case paused is true, but the song hasn't started playing yet.\r\n * If we just call resume() the onplay() callback will never be called.\r\n * So only call resume() if the position is > 0.\r\n * Another reason is because options like volume won't have been applied yet.\r\n * For normal sounds, just resume.\r\n */\r\n\r\n if (s.paused && s.position >= 0 && (!s._iO.serverURL || s.position > 0)) {\r\n\r\n // https://gist.github.com/37b17df75cc4d7a90bf6\r\n sm2._wD(fN + 'Resuming from paused state', 1);\r\n s.resume();\r\n\r\n } else {\r\n\r\n s._iO = mixin(options, s._iO);\r\n\r\n /**\r\n * Preload in the event of play() with position under Flash,\r\n * or from/to parameters and non-RTMP case\r\n */\r\n if (((!s.isHTML5 && s._iO.position !== null && s._iO.position > 0) || (s._iO.from !== null && s._iO.from > 0) || s._iO.to !== null) && s.instanceCount === 0 && s.playState === 0 && !s._iO.serverURL) {\r\n\r\n onready = function() {\r\n // sound \"canplay\" or onload()\r\n // re-apply position/from/to to instance options, and start playback\r\n s._iO = mixin(options, s._iO);\r\n s.play(s._iO);\r\n };\r\n\r\n // HTML5 needs to at least have \"canplay\" fired before seeking.\r\n if (s.isHTML5 && !s._html5_canplay) {\r\n\r\n // this hasn't been loaded yet. load it first, and then do this again.\r\n sm2._wD(fN + 'Beginning load for non-zero offset case');\r\n\r\n s.load({\r\n // note: custom HTML5-only event added for from/to implementation.\r\n _oncanplay: onready\r\n });\r\n\r\n } else if (!s.isHTML5 && !s.loaded && (!s.readyState || s.readyState !== 2)) {\r\n\r\n // to be safe, preload the whole thing in Flash.\r\n\r\n sm2._wD(fN + 'Preloading for non-zero offset case');\r\n\r\n s.load({\r\n onload: onready\r\n });\r\n\r\n }\r\n\r\n // otherwise, we're ready to go. re-apply local options, and continue\r\n\r\n s._iO = applyFromTo();\r\n\r\n }\r\n\r\n // sm2._wD(fN + 'Starting to play');\r\n\r\n // increment instance counter, where enabled + supported\r\n if (!s.instanceCount || s._iO.multiShotEvents || (s.isHTML5 && s._iO.multiShot && !useGlobalHTML5Audio) || (!s.isHTML5 && fV > 8 && !s.getAutoPlay())) {\r\n s.instanceCount++;\r\n }\r\n\r\n // if first play and onposition parameters exist, apply them now\r\n if (s._iO.onposition && s.playState === 0) {\r\n attachOnPosition(s);\r\n }\r\n\r\n s.playState = 1;\r\n s.paused = false;\r\n\r\n s.position = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position : 0);\r\n\r\n if (!s.isHTML5) {\r\n s._iO = policyFix(loopFix(s._iO));\r\n }\r\n\r\n if (s._iO.onplay && _updatePlayState) {\r\n s._iO.onplay.apply(s);\r\n onplay_called = true;\r\n }\r\n\r\n s.setVolume(s._iO.volume, true);\r\n s.setPan(s._iO.pan, true);\r\n\r\n if (s._iO.playbackRate !== 1) {\r\n s.setPlaybackRate(s._iO.playbackRate);\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n startOK = flash._start(s.id, s._iO.loops || 1, (fV === 9 ? s.position : s.position / msecScale), s._iO.multiShot || false);\r\n\r\n if (fV === 9 && !startOK) {\r\n // edge case: no sound hardware, or 32-channel flash ceiling hit.\r\n // applies only to Flash 9, non-NetStream/MovieStar sounds.\r\n // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#play%28%29\r\n sm2._wD(fN + 'No sound hardware, or 32-sound ceiling hit', 2);\r\n if (s._iO.onplayerror) {\r\n s._iO.onplayerror.apply(s);\r\n }\r\n\r\n }\r\n\r\n } else if (s.instanceCount < 2) {\r\n\r\n // HTML5 single-instance case\r\n\r\n start_html5_timer();\r\n\r\n a = s._setup_html5();\r\n\r\n s.setPosition(s._iO.position);\r\n\r\n a.play();\r\n\r\n } else {\r\n\r\n // HTML5 multi-shot case\r\n\r\n sm2._wD(s.id + ': Cloning Audio() for instance #' + s.instanceCount + '...');\r\n\r\n audioClone = new Audio(s._iO.url);\r\n\r\n onended = function() {\r\n event.remove(audioClone, 'ended', onended);\r\n s._onfinish(s);\r\n // cleanup\r\n html5Unload(audioClone);\r\n audioClone = null;\r\n };\r\n\r\n oncanplay = function() {\r\n event.remove(audioClone, 'canplay', oncanplay);\r\n try {\r\n audioClone.currentTime = s._iO.position / msecScale;\r\n } catch(err) {\r\n complain(s.id + ': multiShot play() failed to apply position of ' + (s._iO.position / msecScale));\r\n }\r\n audioClone.play();\r\n };\r\n\r\n event.add(audioClone, 'ended', onended);\r\n\r\n // apply volume to clones, too\r\n if (s._iO.volume !== _undefined) {\r\n audioClone.volume = Math.max(0, Math.min(1, s._iO.volume / 100));\r\n }\r\n\r\n // playing multiple muted sounds? if you do this, you're weird ;) - but let's cover it.\r\n if (s.muted) {\r\n audioClone.muted = true;\r\n }\r\n\r\n if (s._iO.position) {\r\n // HTML5 audio can't seek before onplay() event has fired.\r\n // wait for canplay, then seek to position and start playback.\r\n event.add(audioClone, 'canplay', oncanplay);\r\n } else {\r\n // begin playback at currentTime: 0\r\n audioClone.play();\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n // just for convenience\r\n this.start = this.play;\r\n\r\n /**\r\n * Stops playing a sound (and optionally, all sounds)\r\n *\r\n * @param {boolean} bAll Optional: Whether to stop all sounds\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.stop = function(bAll) {\r\n\r\n var instanceOptions = s._iO,\r\n originalPosition;\r\n\r\n if (s.playState === 1) {\r\n\r\n sm2._wD(s.id + ': stop()');\r\n\r\n s._onbufferchange(0);\r\n s._resetOnPosition(0);\r\n s.paused = false;\r\n\r\n if (!s.isHTML5) {\r\n s.playState = 0;\r\n }\r\n\r\n // remove onPosition listeners, if any\r\n detachOnPosition();\r\n\r\n // and \"to\" position, if set\r\n if (instanceOptions.to) {\r\n s.clearOnPosition(instanceOptions.to);\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n flash._stop(s.id, bAll);\r\n\r\n // hack for netStream: just unload\r\n if (instanceOptions.serverURL) {\r\n s.unload();\r\n }\r\n\r\n } else if (s._a) {\r\n\r\n originalPosition = s.position;\r\n\r\n // act like Flash, though\r\n s.setPosition(0);\r\n\r\n // hack: reflect old position for onstop() (also like Flash)\r\n s.position = originalPosition;\r\n\r\n // html5 has no stop()\r\n // NOTE: pausing means iOS requires interaction to resume.\r\n s._a.pause();\r\n\r\n s.playState = 0;\r\n\r\n // and update UI\r\n s._onTimer();\r\n\r\n stop_html5_timer();\r\n\r\n }\r\n\r\n s.instanceCount = 0;\r\n s._iO = {};\r\n\r\n if (instanceOptions.onstop) {\r\n instanceOptions.onstop.apply(s);\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Undocumented/internal: Sets autoPlay for RTMP.\r\n *\r\n * @param {boolean} autoPlay state\r\n */\r\n\r\n this.setAutoPlay = function(autoPlay) {\r\n\r\n sm2._wD(s.id + ': Autoplay turned ' + (autoPlay ? 'on' : 'off'));\r\n s._iO.autoPlay = autoPlay;\r\n\r\n if (!s.isHTML5) {\r\n flash._setAutoPlay(s.id, autoPlay);\r\n if (autoPlay) {\r\n // only increment the instanceCount if the sound isn't loaded (TODO: verify RTMP)\r\n if (!s.instanceCount && s.readyState === 1) {\r\n s.instanceCount++;\r\n sm2._wD(s.id + ': Incremented instance count to ' + s.instanceCount);\r\n }\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Undocumented/internal: Returns the autoPlay boolean.\r\n *\r\n * @return {boolean} The current autoPlay value\r\n */\r\n\r\n this.getAutoPlay = function() {\r\n\r\n return s._iO.autoPlay;\r\n\r\n };\r\n\r\n /**\r\n * Sets the playback rate of a sound (HTML5-only.)\r\n *\r\n * @param {number} playbackRate (+/-)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPlaybackRate = function(playbackRate) {\r\n\r\n // Per Mozilla, limit acceptable values to prevent playback from stopping (unless allowOverride is truthy.)\r\n // https://developer.mozilla.org/en-US/Apps/Build/Audio_and_video_delivery/WebAudio_playbackRate_explained\r\n var normalizedRate = Math.max(0.5, Math.min(4, playbackRate));\r\n\r\n // <d>\r\n if (normalizedRate !== playbackRate) {\r\n sm2._wD(s.id + ': setPlaybackRate(' + playbackRate + '): limiting rate to ' + normalizedRate, 2);\r\n }\r\n // </d>\r\n\r\n if (s.isHTML5) {\r\n try {\r\n s._iO.playbackRate = normalizedRate;\r\n s._a.playbackRate = normalizedRate;\r\n } catch(e) {\r\n sm2._wD(s.id + ': setPlaybackRate(' + normalizedRate + ') failed: ' + e.message, 2);\r\n }\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the position of a sound.\r\n *\r\n * @param {number} nMsecOffset Position (milliseconds)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPosition = function(nMsecOffset) {\r\n\r\n if (nMsecOffset === _undefined) {\r\n nMsecOffset = 0;\r\n }\r\n\r\n var position, position1K,\r\n // Use the duration from the instance options, if we don't have a track duration yet.\r\n // position >= 0 and <= current available (loaded) duration\r\n offset = (s.isHTML5 ? Math.max(nMsecOffset, 0) : Math.min(s.duration || s._iO.duration, Math.max(nMsecOffset, 0)));\r\n\r\n s.position = offset;\r\n position1K = s.position / msecScale;\r\n s._resetOnPosition(s.position);\r\n s._iO.position = offset;\r\n\r\n if (!s.isHTML5) {\r\n\r\n position = (fV === 9 ? s.position : position1K);\r\n\r\n if (s.readyState && s.readyState !== 2) {\r\n // if paused or not playing, will not resume (by playing)\r\n flash._setPosition(s.id, position, (s.paused || !s.playState), s._iO.multiShot);\r\n }\r\n\r\n } else if (s._a) {\r\n\r\n // Set the position in the canplay handler if the sound is not ready yet\r\n if (s._html5_canplay) {\r\n\r\n if (s._a.currentTime.toFixed(3) !== position1K.toFixed(3)) {\r\n\r\n /**\r\n * DOM/JS errors/exceptions to watch out for:\r\n * if seek is beyond (loaded?) position, \"DOM exception 11\"\r\n * \"INDEX_SIZE_ERR\": DOM exception 1\r\n */\r\n sm2._wD(s.id + ': setPosition(' + position1K + ')');\r\n\r\n try {\r\n s._a.currentTime = position1K;\r\n if (s.playState === 0 || s.paused) {\r\n // allow seek without auto-play/resume\r\n s._a.pause();\r\n }\r\n } catch(e) {\r\n sm2._wD(s.id + ': setPosition(' + position1K + ') failed: ' + e.message, 2);\r\n }\r\n\r\n }\r\n\r\n } else if (position1K) {\r\n\r\n // warn on non-zero seek attempts\r\n sm2._wD(s.id + ': setPosition(' + position1K + '): Cannot seek yet, sound not ready', 2);\r\n return s;\r\n\r\n }\r\n\r\n if (s.paused) {\r\n\r\n // if paused, refresh UI right away by forcing update\r\n s._onTimer(true);\r\n\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Pauses sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.pause = function(_bCallFlash) {\r\n\r\n if (s.paused || (s.playState === 0 && s.readyState !== 1)) return s;\r\n\r\n sm2._wD(s.id + ': pause()');\r\n s.paused = true;\r\n\r\n if (!s.isHTML5) {\r\n if (_bCallFlash || _bCallFlash === _undefined) {\r\n flash._pause(s.id, s._iO.multiShot);\r\n }\r\n } else {\r\n s._setup_html5().pause();\r\n stop_html5_timer();\r\n }\r\n\r\n if (s._iO.onpause) {\r\n s._iO.onpause.apply(s);\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Resumes sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n /**\r\n * When auto-loaded streams pause on buffer full they have a playState of 0.\r\n * We need to make sure that the playState is set to 1 when these streams \"resume\".\r\n * When a paused stream is resumed, we need to trigger the onplay() callback if it\r\n * hasn't been called already. In this case since the sound is being played for the\r\n * first time, I think it's more appropriate to call onplay() rather than onresume().\r\n */\r\n\r\n this.resume = function() {\r\n\r\n var instanceOptions = s._iO;\r\n\r\n if (!s.paused) return s;\r\n\r\n sm2._wD(s.id + ': resume()');\r\n s.paused = false;\r\n s.playState = 1;\r\n\r\n if (!s.isHTML5) {\r\n\r\n if (instanceOptions.isMovieStar && !instanceOptions.serverURL) {\r\n // Bizarre Webkit bug (Chrome reported via 8tracks.com dudes): AAC content paused for 30+ seconds(?) will not resume without a reposition.\r\n s.setPosition(s.position);\r\n }\r\n\r\n // flash method is toggle-based (pause/resume)\r\n flash._pause(s.id, instanceOptions.multiShot);\r\n\r\n } else {\r\n\r\n s._setup_html5().play();\r\n start_html5_timer();\r\n\r\n }\r\n\r\n if (!onplay_called && instanceOptions.onplay) {\r\n\r\n instanceOptions.onplay.apply(s);\r\n onplay_called = true;\r\n\r\n } else if (instanceOptions.onresume) {\r\n\r\n instanceOptions.onresume.apply(s);\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Toggles sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.togglePause = function() {\r\n\r\n sm2._wD(s.id + ': togglePause()');\r\n\r\n if (s.playState === 0) {\r\n s.play({\r\n position: (fV === 9 && !s.isHTML5 ? s.position : s.position / msecScale)\r\n });\r\n return s;\r\n }\r\n\r\n if (s.paused) {\r\n s.resume();\r\n } else {\r\n s.pause();\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the panning (L-R) effect.\r\n *\r\n * @param {number} nPan The pan value (-100 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPan = function(nPan, bInstanceOnly) {\r\n\r\n if (nPan === _undefined) {\r\n nPan = 0;\r\n }\r\n\r\n if (bInstanceOnly === _undefined) {\r\n bInstanceOnly = false;\r\n }\r\n\r\n if (!s.isHTML5) {\r\n flash._setPan(s.id, nPan);\r\n } // else { no HTML5 pan? }\r\n\r\n s._iO.pan = nPan;\r\n\r\n if (!bInstanceOnly) {\r\n s.pan = nPan;\r\n s.options.pan = nPan;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the volume.\r\n *\r\n * @param {number} nVol The volume value (0 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setVolume = function(nVol, _bInstanceOnly) {\r\n\r\n /**\r\n * Note: Setting volume has no effect on iOS \"special snowflake\" devices.\r\n * Hardware volume control overrides software, and volume\r\n * will always return 1 per Apple docs. (iOS 4 + 5.)\r\n * http://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/HTML-canvas-guide/AddingSoundtoCanvasAnimations/AddingSoundtoCanvasAnimations.html\r\n */\r\n\r\n if (nVol === _undefined) {\r\n nVol = 100;\r\n }\r\n\r\n if (_bInstanceOnly === _undefined) {\r\n _bInstanceOnly = false;\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n flash._setVolume(s.id, (sm2.muted && !s.muted) || s.muted ? 0 : nVol);\r\n\r\n } else if (s._a) {\r\n\r\n if (sm2.muted && !s.muted) {\r\n s.muted = true;\r\n s._a.muted = true;\r\n }\r\n\r\n // valid range for native HTML5 Audio(): 0-1\r\n s._a.volume = Math.max(0, Math.min(1, nVol / 100));\r\n\r\n }\r\n\r\n s._iO.volume = nVol;\r\n\r\n if (!_bInstanceOnly) {\r\n s.volume = nVol;\r\n s.options.volume = nVol;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Mutes the sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.mute = function() {\r\n\r\n s.muted = true;\r\n\r\n if (!s.isHTML5) {\r\n flash._setVolume(s.id, 0);\r\n } else if (s._a) {\r\n s._a.muted = true;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unmutes the sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.unmute = function() {\r\n\r\n s.muted = false;\r\n var hasIO = (s._iO.volume !== _undefined);\r\n\r\n if (!s.isHTML5) {\r\n flash._setVolume(s.id, hasIO ? s._iO.volume : s.options.volume);\r\n } else if (s._a) {\r\n s._a.muted = false;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Toggles the muted state of a sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.toggleMute = function() {\r\n\r\n return (s.muted ? s.unmute() : s.mute());\r\n\r\n };\r\n\r\n /**\r\n * Registers a callback to be fired when a sound reaches a given position during playback.\r\n *\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod The relevant callback to fire\r\n * @param {object} oScope Optional: The scope to apply the callback to\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.onPosition = function(nPosition, oMethod, oScope) {\r\n\r\n // TODO: basic dupe checking?\r\n\r\n onPositionItems.push({\r\n position: parseInt(nPosition, 10),\r\n method: oMethod,\r\n scope: (oScope !== _undefined ? oScope : s),\r\n fired: false\r\n });\r\n\r\n return s;\r\n\r\n };\r\n\r\n // legacy/backwards-compability: lower-case method name\r\n this.onposition = this.onPosition;\r\n\r\n /**\r\n * Removes registered callback(s) from a sound, by position and/or callback.\r\n *\r\n * @param {number} nPosition The position to clear callback(s) for\r\n * @param {function} oMethod Optional: Identify one callback to be removed when multiple listeners exist for one position\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.clearOnPosition = function(nPosition, oMethod) {\r\n\r\n var i;\r\n\r\n nPosition = parseInt(nPosition, 10);\r\n\r\n if (isNaN(nPosition)) {\r\n // safety check\r\n return;\r\n }\r\n\r\n for (i = 0; i < onPositionItems.length; i++) {\r\n\r\n if (nPosition === onPositionItems[i].position) {\r\n // remove this item if no method was specified, or, if the method matches\r\n\r\n if (!oMethod || (oMethod === onPositionItems[i].method)) {\r\n\r\n if (onPositionItems[i].fired) {\r\n // decrement \"fired\" counter, too\r\n onPositionFired--;\r\n }\r\n\r\n onPositionItems.splice(i, 1);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._processOnPosition = function() {\r\n\r\n var i, item, j = onPositionItems.length;\r\n\r\n if (!j || !s.playState || onPositionFired >= j) return false;\r\n\r\n for (i = j - 1; i >= 0; i--) {\r\n\r\n item = onPositionItems[i];\r\n\r\n if (!item.fired && s.position >= item.position) {\r\n\r\n item.fired = true;\r\n onPositionFired++;\r\n item.method.apply(item.scope, [item.position]);\r\n\r\n // reset j -- onPositionItems.length can be changed in the item callback above... occasionally breaking the loop.\r\n j = onPositionItems.length;\r\n\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._resetOnPosition = function(nPosition) {\r\n\r\n // reset \"fired\" for items interested in this position\r\n var i, item, j = onPositionItems.length;\r\n\r\n if (!j) return false;\r\n\r\n for (i = j - 1; i >= 0; i--) {\r\n\r\n item = onPositionItems[i];\r\n\r\n if (item.fired && nPosition <= item.position) {\r\n item.fired = false;\r\n onPositionFired--;\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * SMSound() private internals\r\n * --------------------------------\r\n */\r\n\r\n applyFromTo = function() {\r\n\r\n var instanceOptions = s._iO,\r\n f = instanceOptions.from,\r\n t = instanceOptions.to,\r\n start, end;\r\n\r\n end = function() {\r\n\r\n // end has been reached.\r\n sm2._wD(s.id + ': \"To\" time of ' + t + ' reached.');\r\n\r\n // detach listener\r\n s.clearOnPosition(t, end);\r\n\r\n // stop should clear this, too\r\n s.stop();\r\n\r\n };\r\n\r\n start = function() {\r\n\r\n sm2._wD(s.id + ': Playing \"from\" ' + f);\r\n\r\n // add listener for end\r\n if (t !== null && !isNaN(t)) {\r\n s.onPosition(t, end);\r\n }\r\n\r\n };\r\n\r\n if (f !== null && !isNaN(f)) {\r\n\r\n // apply to instance options, guaranteeing correct start position.\r\n instanceOptions.position = f;\r\n\r\n // multiShot timing can't be tracked, so prevent that.\r\n instanceOptions.multiShot = false;\r\n\r\n start();\r\n\r\n }\r\n\r\n // return updated instanceOptions including starting position\r\n return instanceOptions;\r\n\r\n };\r\n\r\n attachOnPosition = function() {\r\n\r\n var item,\r\n op = s._iO.onposition;\r\n\r\n // attach onposition things, if any, now.\r\n\r\n if (op) {\r\n\r\n for (item in op) {\r\n if (op.hasOwnProperty(item)) {\r\n s.onPosition(parseInt(item, 10), op[item]);\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n detachOnPosition = function() {\r\n\r\n var item,\r\n op = s._iO.onposition;\r\n\r\n // detach any onposition()-style listeners.\r\n\r\n if (op) {\r\n\r\n for (item in op) {\r\n if (op.hasOwnProperty(item)) {\r\n s.clearOnPosition(parseInt(item, 10));\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n start_html5_timer = function() {\r\n\r\n if (s.isHTML5) {\r\n startTimer(s);\r\n }\r\n\r\n };\r\n\r\n stop_html5_timer = function() {\r\n\r\n if (s.isHTML5) {\r\n stopTimer(s);\r\n }\r\n\r\n };\r\n\r\n resetProperties = function(retainPosition) {\r\n\r\n if (!retainPosition) {\r\n onPositionItems = [];\r\n onPositionFired = 0;\r\n }\r\n\r\n onplay_called = false;\r\n\r\n s._hasTimer = null;\r\n s._a = null;\r\n s._html5_canplay = false;\r\n s.bytesLoaded = null;\r\n s.bytesTotal = null;\r\n s.duration = (s._iO && s._iO.duration ? s._iO.duration : null);\r\n s.durationEstimate = null;\r\n s.buffered = [];\r\n\r\n // legacy: 1D array\r\n s.eqData = [];\r\n\r\n s.eqData.left = [];\r\n s.eqData.right = [];\r\n\r\n s.failures = 0;\r\n s.isBuffering = false;\r\n s.instanceOptions = {};\r\n s.instanceCount = 0;\r\n s.loaded = false;\r\n s.metadata = {};\r\n\r\n // 0 = uninitialised, 1 = loading, 2 = failed/error, 3 = loaded/success\r\n s.readyState = 0;\r\n\r\n s.muted = false;\r\n s.paused = false;\r\n\r\n s.peakData = {\r\n left: 0,\r\n right: 0\r\n };\r\n\r\n s.waveformData = {\r\n left: [],\r\n right: []\r\n };\r\n\r\n s.playState = 0;\r\n s.position = null;\r\n\r\n s.id3 = {};\r\n\r\n };\r\n\r\n resetProperties();\r\n\r\n /**\r\n * Pseudo-private SMSound internals\r\n * --------------------------------\r\n */\r\n\r\n this._onTimer = function(bForce) {\r\n\r\n /**\r\n * HTML5-only _whileplaying() etc.\r\n * called from both HTML5 native events, and polling/interval-based timers\r\n * mimics flash and fires only when time/duration change, so as to be polling-friendly\r\n */\r\n\r\n var duration, isNew = false, time, x = {};\r\n\r\n if (s._hasTimer || bForce) {\r\n\r\n // TODO: May not need to track readyState (1 = loading)\r\n\r\n if (s._a && (bForce || ((s.playState > 0 || s.readyState === 1) && !s.paused))) {\r\n\r\n duration = s._get_html5_duration();\r\n\r\n if (duration !== lastHTML5State.duration) {\r\n\r\n lastHTML5State.duration = duration;\r\n s.duration = duration;\r\n isNew = true;\r\n\r\n }\r\n\r\n // TODO: investigate why this goes wack if not set/re-set each time.\r\n s.durationEstimate = s.duration;\r\n\r\n time = (s._a.currentTime * msecScale || 0);\r\n\r\n if (time !== lastHTML5State.time) {\r\n\r\n lastHTML5State.time = time;\r\n isNew = true;\r\n\r\n }\r\n\r\n if (isNew || bForce) {\r\n\r\n s._whileplaying(time, x, x, x, x);\r\n\r\n }\r\n\r\n }/* else {\r\n\r\n // sm2._wD('_onTimer: Warn for \"'+s.id+'\": '+(!s._a?'Could not find element. ':'')+(s.playState === 0?'playState bad, 0?':'playState = '+s.playState+', OK'));\r\n\r\n return false;\r\n\r\n }*/\r\n\r\n }\r\n\r\n return isNew;\r\n\r\n };\r\n\r\n this._get_html5_duration = function() {\r\n\r\n var instanceOptions = s._iO,\r\n // if audio object exists, use its duration - else, instance option duration (if provided - it's a hack, really, and should be retired) OR null\r\n d = (s._a && s._a.duration ? s._a.duration * msecScale : (instanceOptions && instanceOptions.duration ? instanceOptions.duration : null)),\r\n result = (d && !isNaN(d) && d !== Infinity ? d : null);\r\n\r\n return result;\r\n\r\n };\r\n\r\n this._apply_loop = function(a, nLoops) {\r\n\r\n /**\r\n * boolean instead of \"loop\", for webkit? - spec says string. http://www.w3.org/TR/html-markup/audio.html#audio.attrs.loop\r\n * note that loop is either off or infinite under HTML5, unlike Flash which allows arbitrary loop counts to be specified.\r\n */\r\n\r\n // <d>\r\n if (!a.loop && nLoops > 1) {\r\n sm2._wD('Note: Native HTML5 looping is infinite.', 1);\r\n }\r\n // </d>\r\n\r\n a.loop = (nLoops > 1 ? 'loop' : '');\r\n\r\n };\r\n\r\n this._setup_html5 = function(options) {\r\n\r\n var instanceOptions = mixin(s._iO, options),\r\n a = useGlobalHTML5Audio ? globalHTML5Audio : s._a,\r\n dURL = decodeURI(instanceOptions.url),\r\n sameURL;\r\n\r\n /**\r\n * \"First things first, I, Poppa...\" (reset the previous state of the old sound, if playing)\r\n * Fixes case with devices that can only play one sound at a time\r\n * Otherwise, other sounds in mid-play will be terminated without warning and in a stuck state\r\n */\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n if (dURL === decodeURI(lastGlobalHTML5URL)) {\r\n // global HTML5 audio: re-use of URL\r\n sameURL = true;\r\n }\r\n\r\n } else if (dURL === decodeURI(lastURL)) {\r\n\r\n // options URL is the same as the \"last\" URL, and we used (loaded) it\r\n sameURL = true;\r\n\r\n }\r\n\r\n if (a) {\r\n\r\n if (a._s) {\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n if (a._s && a._s.playState && !sameURL) {\r\n\r\n // global HTML5 audio case, and loading a new URL. stop the currently-playing one.\r\n a._s.stop();\r\n\r\n }\r\n\r\n } else if (!useGlobalHTML5Audio && dURL === decodeURI(lastURL)) {\r\n\r\n // non-global HTML5 reuse case: same url, ignore request\r\n s._apply_loop(a, instanceOptions.loops);\r\n\r\n return a;\r\n\r\n }\r\n\r\n }\r\n\r\n if (!sameURL) {\r\n\r\n // don't retain onPosition() stuff with new URLs.\r\n\r\n if (lastURL) {\r\n resetProperties(false);\r\n }\r\n\r\n // assign new HTML5 URL\r\n\r\n a.src = instanceOptions.url;\r\n\r\n s.url = instanceOptions.url;\r\n\r\n lastURL = instanceOptions.url;\r\n\r\n lastGlobalHTML5URL = instanceOptions.url;\r\n\r\n a._called_load = false;\r\n\r\n }\r\n\r\n } else {\r\n\r\n if (instanceOptions.autoLoad || instanceOptions.autoPlay) {\r\n\r\n s._a = new Audio(instanceOptions.url);\r\n s._a.load();\r\n\r\n } else {\r\n\r\n // null for stupid Opera 9.64 case\r\n s._a = (isOpera && opera.version() < 10 ? new Audio(null) : new Audio());\r\n\r\n }\r\n\r\n // assign local reference\r\n a = s._a;\r\n\r\n a._called_load = false;\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n globalHTML5Audio = a;\r\n\r\n }\r\n\r\n }\r\n\r\n s.isHTML5 = true;\r\n\r\n // store a ref on the track\r\n s._a = a;\r\n\r\n // store a ref on the audio\r\n a._s = s;\r\n\r\n add_html5_events();\r\n\r\n s._apply_loop(a, instanceOptions.loops);\r\n\r\n if (instanceOptions.autoLoad || instanceOptions.autoPlay) {\r\n\r\n s.load();\r\n\r\n } else {\r\n\r\n // early HTML5 implementation (non-standard)\r\n a.autobuffer = false;\r\n\r\n // standard ('none' is also an option.)\r\n a.preload = 'auto';\r\n\r\n }\r\n\r\n return a;\r\n\r\n };\r\n\r\n add_html5_events = function() {\r\n\r\n if (s._a._added_events) return false;\r\n\r\n var f;\r\n\r\n function add(oEvt, oFn, bCapture) {\r\n return s._a ? s._a.addEventListener(oEvt, oFn, bCapture || false) : null;\r\n }\r\n\r\n s._a._added_events = true;\r\n\r\n for (f in html5_events) {\r\n if (html5_events.hasOwnProperty(f)) {\r\n add(f, html5_events[f]);\r\n }\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n remove_html5_events = function() {\r\n\r\n // Remove event listeners\r\n\r\n var f;\r\n\r\n function remove(oEvt, oFn, bCapture) {\r\n return (s._a ? s._a.removeEventListener(oEvt, oFn, bCapture || false) : null);\r\n }\r\n\r\n sm2._wD(s.id + ': Removing event listeners');\r\n s._a._added_events = false;\r\n\r\n for (f in html5_events) {\r\n if (html5_events.hasOwnProperty(f)) {\r\n remove(f, html5_events[f]);\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Pseudo-private event internals\r\n * ------------------------------\r\n */\r\n\r\n this._onload = function(nSuccess) {\r\n\r\n var fN,\r\n // check for duration to prevent false positives from flash 8 when loading from cache.\r\n loadOK = !!nSuccess || (!s.isHTML5 && fV === 8 && s.duration);\r\n\r\n // <d>\r\n fN = s.id + ': ';\r\n sm2._wD(fN + (loadOK ? 'onload()' : 'Failed to load / invalid sound?' + (!s.duration ? ' Zero-length duration reported.' : ' -') + ' (' + s.url + ')'), (loadOK ? 1 : 2));\r\n\r\n if (!loadOK && !s.isHTML5) {\r\n if (sm2.sandbox.noRemote === true) {\r\n sm2._wD(fN + str('noNet'), 1);\r\n }\r\n if (sm2.sandbox.noLocal === true) {\r\n sm2._wD(fN + str('noLocal'), 1);\r\n }\r\n }\r\n // </d>\r\n\r\n s.loaded = loadOK;\r\n s.readyState = (loadOK ? 3 : 2);\r\n s._onbufferchange(0);\r\n\r\n if (!loadOK && !s.isHTML5) {\r\n // note: no error code from Flash.\r\n s._onerror();\r\n }\r\n\r\n if (s._iO.onload) {\r\n wrapCallback(s, function() {\r\n s._iO.onload.apply(s, [loadOK]);\r\n });\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._onerror = function(errorCode, description) {\r\n\r\n // https://html.spec.whatwg.org/multipage/embedded-content.html#error-codes\r\n if (s._iO.onerror) {\r\n wrapCallback(s, function() {\r\n s._iO.onerror.apply(s, [errorCode, description]);\r\n });\r\n }\r\n\r\n };\r\n\r\n this._onbufferchange = function(nIsBuffering) {\r\n\r\n // ignore if not playing\r\n if (s.playState === 0) return false;\r\n\r\n if ((nIsBuffering && s.isBuffering) || (!nIsBuffering && !s.isBuffering)) return false;\r\n\r\n s.isBuffering = (nIsBuffering === 1);\r\n\r\n if (s._iO.onbufferchange) {\r\n sm2._wD(s.id + ': Buffer state change: ' + nIsBuffering);\r\n s._iO.onbufferchange.apply(s, [nIsBuffering]);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Playback may have stopped due to buffering, or related reason.\r\n * This state can be encountered on iOS < 6 when auto-play is blocked.\r\n */\r\n\r\n this._onsuspend = function() {\r\n\r\n if (s._iO.onsuspend) {\r\n sm2._wD(s.id + ': Playback suspended');\r\n s._iO.onsuspend.apply(s);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * flash 9/movieStar + RTMP-only method, should fire only once at most\r\n * at this point we just recreate failed sounds rather than trying to reconnect\r\n */\r\n\r\n this._onfailure = function(msg, level, code) {\r\n\r\n s.failures++;\r\n sm2._wD(s.id + ': Failure (' + s.failures + '): ' + msg);\r\n\r\n if (s._iO.onfailure && s.failures === 1) {\r\n s._iO.onfailure(msg, level, code);\r\n } else {\r\n sm2._wD(s.id + ': Ignoring failure');\r\n }\r\n\r\n };\r\n\r\n /**\r\n * flash 9/movieStar + RTMP-only method for unhandled warnings/exceptions from Flash\r\n * e.g., RTMP \"method missing\" warning (non-fatal) for getStreamLength on server\r\n */\r\n\r\n this._onwarning = function(msg, level, code) {\r\n\r\n if (s._iO.onwarning) {\r\n s._iO.onwarning(msg, level, code);\r\n }\r\n\r\n };\r\n\r\n this._onfinish = function() {\r\n\r\n // store local copy before it gets trashed...\r\n var io_onfinish = s._iO.onfinish;\r\n\r\n s._onbufferchange(0);\r\n s._resetOnPosition(0);\r\n\r\n // reset some state items\r\n if (s.instanceCount) {\r\n\r\n s.instanceCount--;\r\n\r\n if (!s.instanceCount) {\r\n\r\n // remove onPosition listeners, if any\r\n detachOnPosition();\r\n\r\n // reset instance options\r\n s.playState = 0;\r\n s.paused = false;\r\n s.instanceCount = 0;\r\n s.instanceOptions = {};\r\n s._iO = {};\r\n stop_html5_timer();\r\n\r\n // reset position, too\r\n if (s.isHTML5) {\r\n s.position = 0;\r\n }\r\n\r\n }\r\n\r\n if (!s.instanceCount || s._iO.multiShotEvents) {\r\n // fire onfinish for last, or every instance\r\n if (io_onfinish) {\r\n sm2._wD(s.id + ': onfinish()');\r\n wrapCallback(s, function() {\r\n io_onfinish.apply(s);\r\n });\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) {\r\n\r\n var instanceOptions = s._iO;\r\n\r\n s.bytesLoaded = nBytesLoaded;\r\n s.bytesTotal = nBytesTotal;\r\n s.duration = Math.floor(nDuration);\r\n s.bufferLength = nBufferLength;\r\n\r\n if (!s.isHTML5 && !instanceOptions.isMovieStar) {\r\n\r\n if (instanceOptions.duration) {\r\n // use duration from options, if specified and larger. nobody should be specifying duration in options, actually, and it should be retired.\r\n s.durationEstimate = (s.duration > instanceOptions.duration) ? s.duration : instanceOptions.duration;\r\n } else {\r\n s.durationEstimate = parseInt((s.bytesTotal / s.bytesLoaded) * s.duration, 10);\r\n }\r\n\r\n } else {\r\n\r\n s.durationEstimate = s.duration;\r\n\r\n }\r\n\r\n // for flash, reflect sequential-load-style buffering\r\n if (!s.isHTML5) {\r\n s.buffered = [{\r\n start: 0,\r\n end: s.duration\r\n }];\r\n }\r\n\r\n // allow whileloading to fire even if \"load\" fired under HTML5, due to HTTP range/partials\r\n if ((s.readyState !== 3 || s.isHTML5) && instanceOptions.whileloading) {\r\n instanceOptions.whileloading.apply(s);\r\n }\r\n\r\n };\r\n\r\n this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) {\r\n\r\n var instanceOptions = s._iO,\r\n eqLeft;\r\n\r\n // flash safety net\r\n if (isNaN(nPosition) || nPosition === null) return false;\r\n\r\n // Safari HTML5 play() may return small -ve values when starting from position: 0, eg. -50.120396875. Unexpected/invalid per W3, I think. Normalize to 0.\r\n s.position = Math.max(0, nPosition);\r\n\r\n s._processOnPosition();\r\n\r\n if (!s.isHTML5 && fV > 8) {\r\n\r\n if (instanceOptions.usePeakData && oPeakData !== _undefined && oPeakData) {\r\n s.peakData = {\r\n left: oPeakData.leftPeak,\r\n right: oPeakData.rightPeak\r\n };\r\n }\r\n\r\n if (instanceOptions.useWaveformData && oWaveformDataLeft !== _undefined && oWaveformDataLeft) {\r\n s.waveformData = {\r\n left: oWaveformDataLeft.split(','),\r\n right: oWaveformDataRight.split(',')\r\n };\r\n }\r\n\r\n if (instanceOptions.useEQData) {\r\n if (oEQData !== _undefined && oEQData && oEQData.leftEQ) {\r\n eqLeft = oEQData.leftEQ.split(',');\r\n s.eqData = eqLeft;\r\n s.eqData.left = eqLeft;\r\n if (oEQData.rightEQ !== _undefined && oEQData.rightEQ) {\r\n s.eqData.right = oEQData.rightEQ.split(',');\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n if (s.playState === 1) {\r\n\r\n // special case/hack: ensure buffering is false if loading from cache (and not yet started)\r\n if (!s.isHTML5 && fV === 8 && !s.position && s.isBuffering) {\r\n s._onbufferchange(0);\r\n }\r\n\r\n if (instanceOptions.whileplaying) {\r\n // flash may call after actual finish\r\n instanceOptions.whileplaying.apply(s);\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._oncaptiondata = function(oData) {\r\n\r\n /**\r\n * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature\r\n *\r\n * @param {object} oData\r\n */\r\n\r\n sm2._wD(s.id + ': Caption data received.');\r\n\r\n s.captiondata = oData;\r\n\r\n if (s._iO.oncaptiondata) {\r\n s._iO.oncaptiondata.apply(s, [oData]);\r\n }\r\n\r\n };\r\n\r\n this._onmetadata = function(oMDProps, oMDData) {\r\n\r\n /**\r\n * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature\r\n * RTMP may include song title, MovieStar content may include encoding info\r\n *\r\n * @param {array} oMDProps (names)\r\n * @param {array} oMDData (values)\r\n */\r\n\r\n sm2._wD(s.id + ': Metadata received.');\r\n\r\n var oData = {}, i, j;\r\n\r\n for (i = 0, j = oMDProps.length; i < j; i++) {\r\n oData[oMDProps[i]] = oMDData[i];\r\n }\r\n\r\n s.metadata = oData;\r\n\r\n if (s._iO.onmetadata) {\r\n s._iO.onmetadata.call(s, s.metadata);\r\n }\r\n\r\n };\r\n\r\n this._onid3 = function(oID3Props, oID3Data) {\r\n\r\n /**\r\n * internal: flash 8 + flash 9 ID3 feature\r\n * may include artist, song title etc.\r\n *\r\n * @param {array} oID3Props (names)\r\n * @param {array} oID3Data (values)\r\n */\r\n\r\n sm2._wD(s.id + ': ID3 data received.');\r\n\r\n var oData = [], i, j;\r\n\r\n for (i = 0, j = oID3Props.length; i < j; i++) {\r\n oData[oID3Props[i]] = oID3Data[i];\r\n }\r\n\r\n s.id3 = mixin(s.id3, oData);\r\n\r\n if (s._iO.onid3) {\r\n s._iO.onid3.apply(s);\r\n }\r\n\r\n };\r\n\r\n // flash/RTMP-only\r\n\r\n this._onconnect = function(bSuccess) {\r\n\r\n bSuccess = (bSuccess === 1);\r\n sm2._wD(s.id + ': ' + (bSuccess ? 'Connected.' : 'Failed to connect? - ' + s.url), (bSuccess ? 1 : 2));\r\n s.connected = bSuccess;\r\n\r\n if (bSuccess) {\r\n\r\n s.failures = 0;\r\n\r\n if (idCheck(s.id)) {\r\n if (s.getAutoPlay()) {\r\n // only update the play state if auto playing\r\n s.play(_undefined, s.getAutoPlay());\r\n } else if (s._iO.autoLoad) {\r\n s.load();\r\n }\r\n }\r\n\r\n if (s._iO.onconnect) {\r\n s._iO.onconnect.apply(s, [bSuccess]);\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._ondataerror = function(sError) {\r\n\r\n // flash 9 wave/eq data handler\r\n // hack: called at start, and end from flash at/after onfinish()\r\n if (s.playState > 0) {\r\n sm2._wD(s.id + ': Data error: ' + sError);\r\n if (s._iO.ondataerror) {\r\n s._iO.ondataerror.apply(s);\r\n }\r\n }\r\n\r\n };\r\n\r\n // <d>\r\n this._debug();\r\n // </d>\r\n\r\n }; // SMSound()\r\n\r\n /**\r\n * Private SoundManager internals\r\n * ------------------------------\r\n */\r\n\r\n getDocument = function() {\r\n\r\n return (doc.body || doc.getElementsByTagName('div')[0]);\r\n\r\n };\r\n\r\n id = function(sID) {\r\n\r\n return doc.getElementById(sID);\r\n\r\n };\r\n\r\n mixin = function(oMain, oAdd) {\r\n\r\n // non-destructive merge\r\n var o1 = (oMain || {}), o2, o;\r\n\r\n // if unspecified, o2 is the default options object\r\n o2 = (oAdd === _undefined ? sm2.defaultOptions : oAdd);\r\n\r\n for (o in o2) {\r\n\r\n if (o2.hasOwnProperty(o) && o1[o] === _undefined) {\r\n\r\n if (typeof o2[o] !== 'object' || o2[o] === null) {\r\n\r\n // assign directly\r\n o1[o] = o2[o];\r\n\r\n } else {\r\n\r\n // recurse through o2\r\n o1[o] = mixin(o1[o], o2[o]);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return o1;\r\n\r\n };\r\n\r\n wrapCallback = function(oSound, callback) {\r\n\r\n /**\r\n * 03/03/2013: Fix for Flash Player 11.6.602.171 + Flash 8 (flashVersion = 8) SWF issue\r\n * setTimeout() fix for certain SMSound callbacks like onload() and onfinish(), where subsequent calls like play() and load() fail when Flash Player 11.6.602.171 is installed, and using soundManager with flashVersion = 8 (which is the default).\r\n * Not sure of exact cause. Suspect race condition and/or invalid (NaN-style) position argument trickling down to the next JS -> Flash _start() call, in the play() case.\r\n * Fix: setTimeout() to yield, plus safer null / NaN checking on position argument provided to Flash.\r\n * https://getsatisfaction.com/schillmania/topics/recent_chrome_update_seems_to_have_broken_my_sm2_audio_player\r\n */\r\n if (!oSound.isHTML5 && fV === 8) {\r\n window.setTimeout(callback, 0);\r\n } else {\r\n callback();\r\n }\r\n\r\n };\r\n\r\n // additional soundManager properties that soundManager.setup() will accept\r\n\r\n extraOptions = {\r\n onready: 1,\r\n ontimeout: 1,\r\n defaultOptions: 1,\r\n flash9Options: 1,\r\n movieStarOptions: 1\r\n };\r\n\r\n assign = function(o, oParent) {\r\n\r\n /**\r\n * recursive assignment of properties, soundManager.setup() helper\r\n * allows property assignment based on whitelist\r\n */\r\n\r\n var i,\r\n result = true,\r\n hasParent = (oParent !== _undefined),\r\n setupOptions = sm2.setupOptions,\r\n bonusOptions = extraOptions;\r\n\r\n // <d>\r\n\r\n // if soundManager.setup() called, show accepted parameters.\r\n\r\n if (o === _undefined) {\r\n\r\n result = [];\r\n\r\n for (i in setupOptions) {\r\n\r\n if (setupOptions.hasOwnProperty(i)) {\r\n result.push(i);\r\n }\r\n\r\n }\r\n\r\n for (i in bonusOptions) {\r\n\r\n if (bonusOptions.hasOwnProperty(i)) {\r\n\r\n if (typeof sm2[i] === 'object') {\r\n result.push(i + ': {...}');\r\n } else if (sm2[i] instanceof Function) {\r\n result.push(i + ': function() {...}');\r\n } else {\r\n result.push(i);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n sm2._wD(str('setup', result.join(', ')));\r\n\r\n return false;\r\n\r\n }\r\n\r\n // </d>\r\n\r\n for (i in o) {\r\n\r\n if (o.hasOwnProperty(i)) {\r\n\r\n // if not an {object} we want to recurse through...\r\n\r\n if (typeof o[i] !== 'object' || o[i] === null || o[i] instanceof Array || o[i] instanceof RegExp) {\r\n\r\n // check \"allowed\" options\r\n\r\n if (hasParent && bonusOptions[oParent] !== _undefined) {\r\n\r\n // valid recursive / nested object option, eg., { defaultOptions: { volume: 50 } }\r\n sm2[oParent][i] = o[i];\r\n\r\n } else if (setupOptions[i] !== _undefined) {\r\n\r\n // special case: assign to setupOptions object, which soundManager property references\r\n sm2.setupOptions[i] = o[i];\r\n\r\n // assign directly to soundManager, too\r\n sm2[i] = o[i];\r\n\r\n } else if (bonusOptions[i] === _undefined) {\r\n\r\n // invalid or disallowed parameter. complain.\r\n complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);\r\n\r\n result = false;\r\n\r\n } else if (sm2[i] instanceof Function) {\r\n\r\n /**\r\n * valid extraOptions (bonusOptions) parameter.\r\n * is it a method, like onready/ontimeout? call it.\r\n * multiple parameters should be in an array, eg. soundManager.setup({onready: [myHandler, myScope]});\r\n */\r\n sm2[i].apply(sm2, (o[i] instanceof Array ? o[i] : [o[i]]));\r\n\r\n } else {\r\n\r\n // good old-fashioned direct assignment\r\n sm2[i] = o[i];\r\n\r\n }\r\n\r\n } else if (bonusOptions[i] === _undefined) {\r\n\r\n // recursion case, eg., { defaultOptions: { ... } }\r\n\r\n // invalid or disallowed parameter. complain.\r\n complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n // recurse through object\r\n return assign(o[i], i);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n function preferFlashCheck(kind) {\r\n\r\n // whether flash should play a given type\r\n return (sm2.preferFlash && hasFlash && !sm2.ignoreFlash && (sm2.flash[kind] !== _undefined && sm2.flash[kind]));\r\n\r\n }\r\n\r\n /**\r\n * Internal DOM2-level event helpers\r\n * ---------------------------------\r\n */\r\n\r\n event = (function() {\r\n\r\n // normalize event methods\r\n var old = (window.attachEvent),\r\n evt = {\r\n add: (old ? 'attachEvent' : 'addEventListener'),\r\n remove: (old ? 'detachEvent' : 'removeEventListener')\r\n };\r\n\r\n // normalize \"on\" event prefix, optional capture argument\r\n function getArgs(oArgs) {\r\n\r\n var args = slice.call(oArgs),\r\n len = args.length;\r\n\r\n if (old) {\r\n // prefix\r\n args[1] = 'on' + args[1];\r\n if (len > 3) {\r\n // no capture\r\n args.pop();\r\n }\r\n } else if (len === 3) {\r\n args.push(false);\r\n }\r\n\r\n return args;\r\n\r\n }\r\n\r\n function apply(args, sType) {\r\n\r\n // normalize and call the event method, with the proper arguments\r\n var element = args.shift(),\r\n method = [evt[sType]];\r\n\r\n if (old) {\r\n // old IE can't do apply().\r\n element[method](args[0], args[1]);\r\n } else {\r\n element[method].apply(element, args);\r\n }\r\n\r\n }\r\n\r\n function add() {\r\n apply(getArgs(arguments), 'add');\r\n }\r\n\r\n function remove() {\r\n apply(getArgs(arguments), 'remove');\r\n }\r\n\r\n return {\r\n add: add,\r\n remove: remove\r\n };\r\n\r\n }());\r\n\r\n /**\r\n * Internal HTML5 event handling\r\n * -----------------------------\r\n */\r\n\r\n function html5_event(oFn) {\r\n\r\n // wrap html5 event handlers so we don't call them on destroyed and/or unloaded sounds\r\n\r\n return function(e) {\r\n\r\n var s = this._s,\r\n result;\r\n\r\n if (!s || !s._a) {\r\n // <d>\r\n if (s && s.id) {\r\n sm2._wD(s.id + ': Ignoring ' + e.type);\r\n } else {\r\n sm2._wD(h5 + 'Ignoring ' + e.type);\r\n }\r\n // </d>\r\n result = null;\r\n } else {\r\n result = oFn.call(this, e);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n }\r\n\r\n html5_events = {\r\n\r\n // HTML5 event-name-to-handler map\r\n\r\n abort: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': abort');\r\n\r\n }),\r\n\r\n // enough has loaded to play\r\n\r\n canplay: html5_event(function() {\r\n\r\n var s = this._s,\r\n position1K;\r\n\r\n if (s._html5_canplay) {\r\n // this event has already fired. ignore.\r\n return;\r\n }\r\n\r\n s._html5_canplay = true;\r\n sm2._wD(s.id + ': canplay');\r\n s._onbufferchange(0);\r\n\r\n // position according to instance options\r\n position1K = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position / msecScale : null);\r\n\r\n // set the position if position was provided before the sound loaded\r\n if (this.currentTime !== position1K) {\r\n sm2._wD(s.id + ': canplay: Setting position to ' + position1K);\r\n try {\r\n this.currentTime = position1K;\r\n } catch(ee) {\r\n sm2._wD(s.id + ': canplay: Setting position of ' + position1K + ' failed: ' + ee.message, 2);\r\n }\r\n }\r\n\r\n // hack for HTML5 from/to case\r\n if (s._iO._oncanplay) {\r\n s._iO._oncanplay();\r\n }\r\n\r\n }),\r\n\r\n canplaythrough: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n if (!s.loaded) {\r\n s._onbufferchange(0);\r\n s._whileloading(s.bytesLoaded, s.bytesTotal, s._get_html5_duration());\r\n s._onload(true);\r\n }\r\n\r\n }),\r\n\r\n durationchange: html5_event(function() {\r\n\r\n // durationchange may fire at various times, probably the safest way to capture accurate/final duration.\r\n\r\n var s = this._s,\r\n duration;\r\n\r\n duration = s._get_html5_duration();\r\n\r\n if (!isNaN(duration) && duration !== s.duration) {\r\n\r\n sm2._wD(this._s.id + ': durationchange (' + duration + ')' + (s.duration ? ', previously ' + s.duration : ''));\r\n\r\n s.durationEstimate = s.duration = duration;\r\n\r\n }\r\n\r\n }),\r\n\r\n // TODO: Reserved for potential use\r\n /*\r\n emptied: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': emptied');\r\n\r\n }),\r\n */\r\n\r\n ended: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n sm2._wD(s.id + ': ended');\r\n\r\n s._onfinish();\r\n\r\n }),\r\n\r\n error: html5_event(function() {\r\n\r\n var description = (html5ErrorCodes[this.error.code] || null);\r\n sm2._wD(this._s.id + ': HTML5 error, code ' + this.error.code + (description ? ' (' + description + ')' : ''));\r\n this._s._onload(false);\r\n this._s._onerror(this.error.code, description);\r\n\r\n }),\r\n\r\n loadeddata: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n sm2._wD(s.id + ': loadeddata');\r\n\r\n // safari seems to nicely report progress events, eventually totalling 100%\r\n if (!s._loaded && !isSafari) {\r\n s.duration = s._get_html5_duration();\r\n }\r\n\r\n }),\r\n\r\n loadedmetadata: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': loadedmetadata');\r\n\r\n }),\r\n\r\n loadstart: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': loadstart');\r\n // assume buffering at first\r\n this._s._onbufferchange(1);\r\n\r\n }),\r\n\r\n play: html5_event(function() {\r\n\r\n // sm2._wD(this._s.id + ': play()');\r\n // once play starts, no buffering\r\n this._s._onbufferchange(0);\r\n\r\n }),\r\n\r\n playing: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': playing ' + String.fromCharCode(9835));\r\n // once play starts, no buffering\r\n this._s._onbufferchange(0);\r\n\r\n }),\r\n\r\n progress: html5_event(function(e) {\r\n\r\n // note: can fire repeatedly after \"loaded\" event, due to use of HTTP range/partials\r\n\r\n var s = this._s,\r\n i, j, progStr, buffered = 0,\r\n isProgress = (e.type === 'progress'),\r\n ranges = e.target.buffered,\r\n // firefox 3.6 implements e.loaded/total (bytes)\r\n loaded = (e.loaded || 0),\r\n total = (e.total || 1);\r\n\r\n // reset the \"buffered\" (loaded byte ranges) array\r\n s.buffered = [];\r\n\r\n if (ranges && ranges.length) {\r\n\r\n // if loaded is 0, try TimeRanges implementation as % of load\r\n // https://developer.mozilla.org/en/DOM/TimeRanges\r\n\r\n // re-build \"buffered\" array\r\n // HTML5 returns seconds. SM2 API uses msec for setPosition() etc., whether Flash or HTML5.\r\n for (i = 0, j = ranges.length; i < j; i++) {\r\n s.buffered.push({\r\n start: ranges.start(i) * msecScale,\r\n end: ranges.end(i) * msecScale\r\n });\r\n }\r\n\r\n // use the last value locally\r\n buffered = (ranges.end(0) - ranges.start(0)) * msecScale;\r\n\r\n // linear case, buffer sum; does not account for seeking and HTTP partials / byte ranges\r\n loaded = Math.min(1, buffered / (e.target.duration * msecScale));\r\n\r\n // <d>\r\n if (isProgress && ranges.length > 1) {\r\n progStr = [];\r\n j = ranges.length;\r\n for (i = 0; i < j; i++) {\r\n progStr.push((e.target.buffered.start(i) * msecScale) + '-' + (e.target.buffered.end(i) * msecScale));\r\n }\r\n sm2._wD(this._s.id + ': progress, timeRanges: ' + progStr.join(', '));\r\n }\r\n\r\n if (isProgress && !isNaN(loaded)) {\r\n sm2._wD(this._s.id + ': progress, ' + Math.floor(loaded * 100) + '% loaded');\r\n }\r\n // </d>\r\n\r\n }\r\n\r\n if (!isNaN(loaded)) {\r\n\r\n // TODO: prevent calls with duplicate values.\r\n s._whileloading(loaded, total, s._get_html5_duration());\r\n if (loaded && total && loaded === total) {\r\n // in case \"onload\" doesn't fire (eg. gecko 1.9.2)\r\n html5_events.canplaythrough.call(this, e);\r\n }\r\n\r\n }\r\n\r\n }),\r\n\r\n ratechange: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': ratechange');\r\n\r\n }),\r\n\r\n suspend: html5_event(function(e) {\r\n\r\n // download paused/stopped, may have finished (eg. onload)\r\n var s = this._s;\r\n\r\n sm2._wD(this._s.id + ': suspend');\r\n html5_events.progress.call(this, e);\r\n s._onsuspend();\r\n\r\n }),\r\n\r\n stalled: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': stalled');\r\n\r\n }),\r\n\r\n timeupdate: html5_event(function() {\r\n\r\n this._s._onTimer();\r\n\r\n }),\r\n\r\n waiting: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n // see also: seeking\r\n sm2._wD(this._s.id + ': waiting');\r\n\r\n // playback faster than download rate, etc.\r\n s._onbufferchange(1);\r\n\r\n })\r\n\r\n };\r\n\r\n html5OK = function(iO) {\r\n\r\n // playability test based on URL or MIME type\r\n\r\n var result;\r\n\r\n if (!iO || (!iO.type && !iO.url && !iO.serverURL)) {\r\n\r\n // nothing to check\r\n result = false;\r\n\r\n } else if (iO.serverURL || (iO.type && preferFlashCheck(iO.type))) {\r\n\r\n // RTMP, or preferring flash\r\n result = false;\r\n\r\n } else {\r\n\r\n // Use type, if specified. Pass data: URIs to HTML5. If HTML5-only mode, no other options, so just give 'er\r\n result = ((iO.type ? html5CanPlay({ type: iO.type }) : html5CanPlay({ url: iO.url }) || sm2.html5Only || iO.url.match(/data:/i)));\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n html5Unload = function(oAudio) {\r\n\r\n /**\r\n * Internal method: Unload media, and cancel any current/pending network requests.\r\n * Firefox can load an empty URL, which allegedly destroys the decoder and stops the download.\r\n * https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox#Stopping_the_download_of_media\r\n * However, Firefox has been seen loading a relative URL from '' and thus requesting the hosting page on unload.\r\n * Other UA behaviour is unclear, so everyone else gets an about:blank-style URL.\r\n */\r\n\r\n var url;\r\n\r\n if (oAudio) {\r\n\r\n // Firefox and Chrome accept short WAVe data: URIs. Chome dislikes audio/wav, but accepts audio/wav for data: MIME.\r\n // Desktop Safari complains / fails on data: URI, so it gets about:blank.\r\n url = (isSafari ? emptyURL : (sm2.html5.canPlayType('audio/wav') ? emptyWAV : emptyURL));\r\n\r\n oAudio.src = url;\r\n\r\n // reset some state, too\r\n if (oAudio._called_unload !== _undefined) {\r\n oAudio._called_load = false;\r\n }\r\n\r\n }\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n // ensure URL state is trashed, also\r\n lastGlobalHTML5URL = null;\r\n\r\n }\r\n\r\n return url;\r\n\r\n };\r\n\r\n html5CanPlay = function(o) {\r\n\r\n /**\r\n * Try to find MIME, test and return truthiness\r\n * o = {\r\n * url: '/path/to/an.mp3',\r\n * type: 'audio/mp3'\r\n * }\r\n */\r\n\r\n if (!sm2.useHTML5Audio || !sm2.hasHTML5) return false;\r\n\r\n var url = (o.url || null),\r\n mime = (o.type || null),\r\n aF = sm2.audioFormats,\r\n result,\r\n offset,\r\n fileExt,\r\n item;\r\n\r\n // account for known cases like audio/mp3\r\n\r\n if (mime && sm2.html5[mime] !== _undefined) return (sm2.html5[mime] && !preferFlashCheck(mime));\r\n\r\n if (!html5Ext) {\r\n\r\n html5Ext = [];\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n html5Ext.push(item);\r\n\r\n if (aF[item].related) {\r\n html5Ext = html5Ext.concat(aF[item].related);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n html5Ext = new RegExp('\\\\.(' + html5Ext.join('|') + ')(\\\\?.*)?$', 'i');\r\n\r\n }\r\n\r\n // TODO: Strip URL queries, etc.\r\n fileExt = (url ? url.toLowerCase().match(html5Ext) : null);\r\n\r\n if (!fileExt || !fileExt.length) {\r\n\r\n if (!mime) {\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n // audio/mp3 -> mp3, result should be known\r\n offset = mime.indexOf(';');\r\n\r\n // strip \"audio/X; codecs...\"\r\n fileExt = (offset !== -1 ? mime.substr(0, offset) : mime).substr(6);\r\n\r\n }\r\n\r\n } else {\r\n\r\n // match the raw extension name - \"mp3\", for example\r\n fileExt = fileExt[1];\r\n\r\n }\r\n\r\n if (fileExt && sm2.html5[fileExt] !== _undefined) {\r\n\r\n // result known\r\n result = (sm2.html5[fileExt] && !preferFlashCheck(fileExt));\r\n\r\n } else {\r\n\r\n mime = 'audio/' + fileExt;\r\n result = sm2.html5.canPlayType({ type: mime });\r\n\r\n sm2.html5[fileExt] = result;\r\n\r\n // sm2._wD('canPlayType, found result: ' + result);\r\n result = (result && sm2.html5[mime] && !preferFlashCheck(mime));\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n testHTML5 = function() {\r\n\r\n /**\r\n * Internal: Iterates over audioFormats, determining support eg. audio/mp3, audio/mpeg and so on\r\n * assigns results to html5[] and flash[].\r\n */\r\n\r\n if (!sm2.useHTML5Audio || !sm2.hasHTML5) {\r\n\r\n // without HTML5, we need Flash.\r\n sm2.html5.usingFlash = true;\r\n needsFlash = true;\r\n\r\n return false;\r\n\r\n }\r\n\r\n // double-whammy: Opera 9.64 throws WRONG_ARGUMENTS_ERR if no parameter passed to Audio(), and Webkit + iOS happily tries to load \"null\" as a URL. :/\r\n var a = (Audio !== _undefined ? (isOpera && opera.version() < 10 ? new Audio(null) : new Audio()) : null),\r\n item, lookup, support = {}, aF, i;\r\n\r\n function cp(m) {\r\n\r\n var canPlay, j,\r\n result = false,\r\n isOK = false;\r\n\r\n if (!a || typeof a.canPlayType !== 'function') return result;\r\n\r\n if (m instanceof Array) {\r\n\r\n // iterate through all mime types, return any successes\r\n\r\n for (i = 0, j = m.length; i < j; i++) {\r\n\r\n if (sm2.html5[m[i]] || a.canPlayType(m[i]).match(sm2.html5Test)) {\r\n\r\n isOK = true;\r\n sm2.html5[m[i]] = true;\r\n\r\n // note flash support, too\r\n sm2.flash[m[i]] = !!(m[i].match(flashMIME));\r\n\r\n }\r\n\r\n }\r\n\r\n result = isOK;\r\n\r\n } else {\r\n\r\n canPlay = (a && typeof a.canPlayType === 'function' ? a.canPlayType(m) : false);\r\n result = !!(canPlay && (canPlay.match(sm2.html5Test)));\r\n\r\n }\r\n\r\n return result;\r\n\r\n }\r\n\r\n // test all registered formats + codecs\r\n\r\n aF = sm2.audioFormats;\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n lookup = 'audio/' + item;\r\n\r\n support[item] = cp(aF[item].type);\r\n\r\n // write back generic type too, eg. audio/mp3\r\n support[lookup] = support[item];\r\n\r\n // assign flash\r\n if (item.match(flashMIME)) {\r\n\r\n sm2.flash[item] = true;\r\n sm2.flash[lookup] = true;\r\n\r\n } else {\r\n\r\n sm2.flash[item] = false;\r\n sm2.flash[lookup] = false;\r\n\r\n }\r\n\r\n // assign result to related formats, too\r\n\r\n if (aF[item] && aF[item].related) {\r\n\r\n for (i = aF[item].related.length - 1; i >= 0; i--) {\r\n\r\n // eg. audio/m4a\r\n support['audio/' + aF[item].related[i]] = support[item];\r\n sm2.html5[aF[item].related[i]] = support[item];\r\n sm2.flash[aF[item].related[i]] = support[item];\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n support.canPlayType = (a ? cp : null);\r\n sm2.html5 = mixin(sm2.html5, support);\r\n\r\n sm2.html5.usingFlash = featureCheck();\r\n needsFlash = sm2.html5.usingFlash;\r\n\r\n return true;\r\n\r\n };\r\n\r\n strings = {\r\n\r\n // <d>\r\n notReady: 'Unavailable - wait until onready() has fired.',\r\n notOK: 'Audio support is not available.',\r\n domError: sm + 'exception caught while appending SWF to DOM.',\r\n spcWmode: 'Removing wmode, preventing known SWF loading issue(s)',\r\n swf404: smc + 'Verify that %s is a valid path.',\r\n tryDebug: 'Try ' + sm + '.debugFlash = true for more security details (output goes to SWF.)',\r\n checkSWF: 'See SWF output for more debug info.',\r\n localFail: smc + 'Non-HTTP page (' + doc.location.protocol + ' URL?) Review Flash player security settings for this special case:\\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/',\r\n waitFocus: smc + 'Special case: Waiting for SWF to load with window focus...',\r\n waitForever: smc + 'Waiting indefinitely for Flash (will recover if unblocked)...',\r\n waitSWF: smc + 'Waiting for 100% SWF load...',\r\n needFunction: smc + 'Function object expected for %s',\r\n badID: 'Sound ID \"%s\" should be a string, starting with a non-numeric character',\r\n currentObj: smc + '_debug(): Current sound objects',\r\n waitOnload: smc + 'Waiting for window.onload()',\r\n docLoaded: smc + 'Document already loaded',\r\n onload: smc + 'initComplete(): calling soundManager.onload()',\r\n onloadOK: sm + '.onload() complete',\r\n didInit: smc + 'init(): Already called?',\r\n secNote: 'Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html',\r\n badRemove: smc + 'Failed to remove Flash node.',\r\n shutdown: sm + '.disable(): Shutting down',\r\n queue: smc + 'Queueing %s handler',\r\n smError: 'SMSound.load(): Exception: JS-Flash communication failed, or JS error.',\r\n fbTimeout: 'No flash response, applying .' + swfCSS.swfTimedout + ' CSS...',\r\n fbLoaded: 'Flash loaded',\r\n fbHandler: smc + 'flashBlockHandler()',\r\n manURL: 'SMSound.load(): Using manually-assigned URL',\r\n onURL: sm + '.load(): current URL already assigned.',\r\n badFV: sm + '.flashVersion must be 8 or 9. \"%s\" is invalid. Reverting to %s.',\r\n as2loop: 'Note: Setting stream:false so looping can work (flash 8 limitation)',\r\n noNSLoop: 'Note: Looping not implemented for MovieStar formats',\r\n needfl9: 'Note: Switching to flash 9, required for MP4 formats.',\r\n mfTimeout: 'Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case',\r\n needFlash: smc + 'Fatal error: Flash is needed to play some required formats, but is not available.',\r\n gotFocus: smc + 'Got window focus.',\r\n policy: 'Enabling usePolicyFile for data access',\r\n setup: sm + '.setup(): allowed parameters: %s',\r\n setupError: sm + '.setup(): \"%s\" cannot be assigned with this method.',\r\n setupUndef: sm + '.setup(): Could not find option \"%s\"',\r\n setupLate: sm + '.setup(): url, flashVersion and html5Test property changes will not take effect until reboot().',\r\n noURL: smc + 'Flash URL required. Call soundManager.setup({url:...}) to get started.',\r\n sm2Loaded: 'SoundManager 2: Ready. ' + String.fromCharCode(10003),\r\n reset: sm + '.reset(): Removing event callbacks',\r\n mobileUA: 'Mobile UA detected, preferring HTML5 by default.',\r\n globalHTML5: 'Using singleton HTML5 Audio() pattern for this device.',\r\n ignoreMobile: 'Ignoring mobile restrictions for this device.'\r\n // </d>\r\n\r\n };\r\n\r\n str = function() {\r\n\r\n // internal string replace helper.\r\n // arguments: o [,items to replace]\r\n // <d>\r\n\r\n var args,\r\n i, j, o,\r\n sstr;\r\n\r\n // real array, please\r\n args = slice.call(arguments);\r\n\r\n // first argument\r\n o = args.shift();\r\n\r\n sstr = (strings && strings[o] ? strings[o] : '');\r\n\r\n if (sstr && args && args.length) {\r\n for (i = 0, j = args.length; i < j; i++) {\r\n sstr = sstr.replace('%s', args[i]);\r\n }\r\n }\r\n\r\n return sstr;\r\n // </d>\r\n\r\n };\r\n\r\n loopFix = function(sOpt) {\r\n\r\n // flash 8 requires stream = false for looping to work\r\n if (fV === 8 && sOpt.loops > 1 && sOpt.stream) {\r\n _wDS('as2loop');\r\n sOpt.stream = false;\r\n }\r\n\r\n return sOpt;\r\n\r\n };\r\n\r\n policyFix = function(sOpt, sPre) {\r\n\r\n if (sOpt && !sOpt.usePolicyFile && (sOpt.onid3 || sOpt.usePeakData || sOpt.useWaveformData || sOpt.useEQData)) {\r\n sm2._wD((sPre || '') + str('policy'));\r\n sOpt.usePolicyFile = true;\r\n }\r\n\r\n return sOpt;\r\n\r\n };\r\n\r\n complain = function(sMsg) {\r\n\r\n // <d>\r\n if (hasConsole && console.warn !== _undefined) {\r\n console.warn(sMsg);\r\n } else {\r\n sm2._wD(sMsg);\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n doNothing = function() {\r\n\r\n return false;\r\n\r\n };\r\n\r\n disableObject = function(o) {\r\n\r\n var oProp;\r\n\r\n for (oProp in o) {\r\n if (o.hasOwnProperty(oProp) && typeof o[oProp] === 'function') {\r\n o[oProp] = doNothing;\r\n }\r\n }\r\n\r\n oProp = null;\r\n\r\n };\r\n\r\n failSafely = function(bNoDisable) {\r\n\r\n // general failure exception handler\r\n\r\n if (bNoDisable === _undefined) {\r\n bNoDisable = false;\r\n }\r\n\r\n if (disabled || bNoDisable) {\r\n sm2.disable(bNoDisable);\r\n }\r\n\r\n };\r\n\r\n normalizeMovieURL = function(movieURL) {\r\n\r\n var urlParams = null, url;\r\n\r\n if (movieURL) {\r\n\r\n if (movieURL.match(/\\.swf(\\?.*)?$/i)) {\r\n\r\n urlParams = movieURL.substr(movieURL.toLowerCase().lastIndexOf('.swf?') + 4);\r\n\r\n // assume user knows what they're doing\r\n if (urlParams) return movieURL;\r\n\r\n } else if (movieURL.lastIndexOf('/') !== movieURL.length - 1) {\r\n\r\n // append trailing slash, if needed\r\n movieURL += '/';\r\n\r\n }\r\n\r\n }\r\n\r\n url = (movieURL && movieURL.lastIndexOf('/') !== -1 ? movieURL.substr(0, movieURL.lastIndexOf('/') + 1) : './') + sm2.movieURL;\r\n\r\n if (sm2.noSWFCache) {\r\n url += ('?ts=' + new Date().getTime());\r\n }\r\n\r\n return url;\r\n\r\n };\r\n\r\n setVersionInfo = function() {\r\n\r\n // short-hand for internal use\r\n\r\n fV = parseInt(sm2.flashVersion, 10);\r\n\r\n if (fV !== 8 && fV !== 9) {\r\n sm2._wD(str('badFV', fV, defaultFlashVersion));\r\n sm2.flashVersion = fV = defaultFlashVersion;\r\n }\r\n\r\n // debug flash movie, if applicable\r\n\r\n var isDebug = (sm2.debugMode || sm2.debugFlash ? '_debug.swf' : '.swf');\r\n\r\n if (sm2.useHTML5Audio && !sm2.html5Only && sm2.audioFormats.mp4.required && fV < 9) {\r\n sm2._wD(str('needfl9'));\r\n sm2.flashVersion = fV = 9;\r\n }\r\n\r\n sm2.version = sm2.versionNumber + (sm2.html5Only ? ' (HTML5-only mode)' : (fV === 9 ? ' (AS3/Flash 9)' : ' (AS2/Flash 8)'));\r\n\r\n // set up default options\r\n if (fV > 8) {\r\n\r\n // +flash 9 base options\r\n sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.flash9Options);\r\n sm2.features.buffering = true;\r\n\r\n // +moviestar support\r\n sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.movieStarOptions);\r\n sm2.filePatterns.flash9 = new RegExp('\\\\.(mp3|' + netStreamTypes.join('|') + ')(\\\\?.*)?$', 'i');\r\n sm2.features.movieStar = true;\r\n\r\n } else {\r\n\r\n sm2.features.movieStar = false;\r\n\r\n }\r\n\r\n // regExp for flash canPlay(), etc.\r\n sm2.filePattern = sm2.filePatterns[(fV !== 8 ? 'flash9' : 'flash8')];\r\n\r\n // if applicable, use _debug versions of SWFs\r\n sm2.movieURL = (fV === 8 ? 'soundmanager2.swf' : 'soundmanager2_flash9.swf').replace('.swf', isDebug);\r\n\r\n sm2.features.peakData = sm2.features.waveformData = sm2.features.eqData = (fV > 8);\r\n\r\n };\r\n\r\n setPolling = function(bPolling, bHighPerformance) {\r\n\r\n if (!flash) {\r\n return;\r\n }\r\n\r\n flash._setPolling(bPolling, bHighPerformance);\r\n\r\n };\r\n\r\n initDebug = function() {\r\n\r\n // starts debug mode, creating output <div> for UAs without console object\r\n\r\n // allow force of debug mode via URL\r\n // <d>\r\n if (sm2.debugURLParam.test(wl)) {\r\n sm2.setupOptions.debugMode = sm2.debugMode = true;\r\n }\r\n\r\n if (id(sm2.debugID)) {\r\n return;\r\n }\r\n\r\n var oD, oDebug, oTarget, oToggle, tmp;\r\n\r\n if (sm2.debugMode && !id(sm2.debugID) && (!hasConsole || !sm2.useConsole || !sm2.consoleOnly)) {\r\n\r\n oD = doc.createElement('div');\r\n oD.id = sm2.debugID + '-toggle';\r\n\r\n oToggle = {\r\n position: 'fixed',\r\n bottom: '0px',\r\n right: '0px',\r\n width: '1.2em',\r\n height: '1.2em',\r\n lineHeight: '1.2em',\r\n margin: '2px',\r\n textAlign: 'center',\r\n border: '1px solid #999',\r\n cursor: 'pointer',\r\n background: '#fff',\r\n color: '#333',\r\n zIndex: 10001\r\n };\r\n\r\n oD.appendChild(doc.createTextNode('-'));\r\n oD.onclick = toggleDebug;\r\n oD.title = 'Toggle SM2 debug console';\r\n\r\n if (ua.match(/msie 6/i)) {\r\n oD.style.position = 'absolute';\r\n oD.style.cursor = 'hand';\r\n }\r\n\r\n for (tmp in oToggle) {\r\n if (oToggle.hasOwnProperty(tmp)) {\r\n oD.style[tmp] = oToggle[tmp];\r\n }\r\n }\r\n\r\n oDebug = doc.createElement('div');\r\n oDebug.id = sm2.debugID;\r\n oDebug.style.display = (sm2.debugMode ? 'block' : 'none');\r\n\r\n if (sm2.debugMode && !id(oD.id)) {\r\n try {\r\n oTarget = getDocument();\r\n oTarget.appendChild(oD);\r\n } catch(e2) {\r\n throw new Error(str('domError') + ' \\n' + e2.toString());\r\n }\r\n oTarget.appendChild(oDebug);\r\n }\r\n\r\n }\r\n\r\n oTarget = null;\r\n // </d>\r\n\r\n };\r\n\r\n idCheck = this.getSoundById;\r\n\r\n // <d>\r\n _wDS = function(o, errorLevel) {\r\n\r\n return (!o ? '' : sm2._wD(str(o), errorLevel));\r\n\r\n };\r\n\r\n toggleDebug = function() {\r\n\r\n var o = id(sm2.debugID),\r\n oT = id(sm2.debugID + '-toggle');\r\n\r\n if (!o) {\r\n return;\r\n }\r\n\r\n if (debugOpen) {\r\n // minimize\r\n oT.innerHTML = '+';\r\n o.style.display = 'none';\r\n } else {\r\n oT.innerHTML = '-';\r\n o.style.display = 'block';\r\n }\r\n\r\n debugOpen = !debugOpen;\r\n\r\n };\r\n\r\n debugTS = function(sEventType, bSuccess, sMessage) {\r\n\r\n // troubleshooter debug hooks\r\n\r\n if (window.sm2Debugger !== _undefined) {\r\n try {\r\n sm2Debugger.handleEvent(sEventType, bSuccess, sMessage);\r\n } catch(e) {\r\n // oh well\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n\r\n };\r\n // </d>\r\n\r\n getSWFCSS = function() {\r\n\r\n var css = [];\r\n\r\n if (sm2.debugMode) {\r\n css.push(swfCSS.sm2Debug);\r\n }\r\n\r\n if (sm2.debugFlash) {\r\n css.push(swfCSS.flashDebug);\r\n }\r\n\r\n if (sm2.useHighPerformance) {\r\n css.push(swfCSS.highPerf);\r\n }\r\n\r\n return css.join(' ');\r\n\r\n };\r\n\r\n flashBlockHandler = function() {\r\n\r\n // *possible* flash block situation.\r\n\r\n var name = str('fbHandler'),\r\n p = sm2.getMoviePercent(),\r\n css = swfCSS,\r\n error = {\r\n type: 'FLASHBLOCK'\r\n };\r\n\r\n if (sm2.html5Only) {\r\n // no flash, or unused\r\n return;\r\n }\r\n\r\n if (!sm2.ok()) {\r\n\r\n if (needsFlash) {\r\n // make the movie more visible, so user can fix\r\n sm2.oMC.className = getSWFCSS() + ' ' + css.swfDefault + ' ' + (p === null ? css.swfTimedout : css.swfError);\r\n sm2._wD(name + ': ' + str('fbTimeout') + (p ? ' (' + str('fbLoaded') + ')' : ''));\r\n }\r\n\r\n sm2.didFlashBlock = true;\r\n\r\n // fire onready(), complain lightly\r\n processOnEvents({\r\n type: 'ontimeout',\r\n ignoreInit: true,\r\n error: error\r\n });\r\n\r\n catchError(error);\r\n\r\n } else {\r\n\r\n // SM2 loaded OK (or recovered)\r\n\r\n // <d>\r\n if (sm2.didFlashBlock) {\r\n sm2._wD(name + ': Unblocked');\r\n }\r\n // </d>\r\n\r\n if (sm2.oMC) {\r\n sm2.oMC.className = [getSWFCSS(), css.swfDefault, css.swfLoaded + (sm2.didFlashBlock ? ' ' + css.swfUnblocked : '')].join(' ');\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n addOnEvent = function(sType, oMethod, oScope) {\r\n\r\n if (on_queue[sType] === _undefined) {\r\n on_queue[sType] = [];\r\n }\r\n\r\n on_queue[sType].push({\r\n method: oMethod,\r\n scope: (oScope || null),\r\n fired: false\r\n });\r\n\r\n };\r\n\r\n processOnEvents = function(oOptions) {\r\n\r\n // if unspecified, assume OK/error\r\n\r\n if (!oOptions) {\r\n oOptions = {\r\n type: (sm2.ok() ? 'onready' : 'ontimeout')\r\n };\r\n }\r\n\r\n // not ready yet.\r\n if (!didInit && oOptions && !oOptions.ignoreInit) return false;\r\n\r\n // invalid case\r\n if (oOptions.type === 'ontimeout' && (sm2.ok() || (disabled && !oOptions.ignoreInit))) return false;\r\n\r\n var status = {\r\n success: (oOptions && oOptions.ignoreInit ? sm2.ok() : !disabled)\r\n },\r\n\r\n // queue specified by type, or none\r\n srcQueue = (oOptions && oOptions.type ? on_queue[oOptions.type] || [] : []),\r\n\r\n queue = [], i, j,\r\n args = [status],\r\n canRetry = (needsFlash && !sm2.ok());\r\n\r\n if (oOptions.error) {\r\n args[0].error = oOptions.error;\r\n }\r\n\r\n for (i = 0, j = srcQueue.length; i < j; i++) {\r\n if (srcQueue[i].fired !== true) {\r\n queue.push(srcQueue[i]);\r\n }\r\n }\r\n\r\n if (queue.length) {\r\n\r\n // sm2._wD(sm + ': Firing ' + queue.length + ' ' + oOptions.type + '() item' + (queue.length === 1 ? '' : 's'));\r\n for (i = 0, j = queue.length; i < j; i++) {\r\n\r\n if (queue[i].scope) {\r\n queue[i].method.apply(queue[i].scope, args);\r\n } else {\r\n queue[i].method.apply(this, args);\r\n }\r\n\r\n if (!canRetry) {\r\n // useFlashBlock and SWF timeout case doesn't count here.\r\n queue[i].fired = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n initUserOnload = function() {\r\n\r\n window.setTimeout(function() {\r\n\r\n if (sm2.useFlashBlock) {\r\n flashBlockHandler();\r\n }\r\n\r\n processOnEvents();\r\n\r\n // call user-defined \"onload\", scoped to window\r\n\r\n if (typeof sm2.onload === 'function') {\r\n _wDS('onload', 1);\r\n sm2.onload.apply(window);\r\n _wDS('onloadOK', 1);\r\n }\r\n\r\n if (sm2.waitForWindowLoad) {\r\n event.add(window, 'load', initUserOnload);\r\n }\r\n\r\n }, 1);\r\n\r\n };\r\n\r\n detectFlash = function() {\r\n\r\n /**\r\n * Hat tip: Flash Detect library (BSD, (C) 2007) by Carl \"DocYes\" S. Yestrau\r\n * http://featureblend.com/javascript-flash-detection-library.html / http://featureblend.com/license.txt\r\n */\r\n\r\n // this work has already been done.\r\n if (hasFlash !== _undefined) return hasFlash;\r\n\r\n var hasPlugin = false, n = navigator, obj, type, types, AX = window.ActiveXObject;\r\n\r\n // MS Edge 14 throws an \"Unspecified Error\" because n.plugins is inaccessible due to permissions\r\n var nP;\r\n\r\n try {\r\n nP = n.plugins;\r\n } catch(e) {\r\n nP = undefined;\r\n }\r\n\r\n if (nP && nP.length) {\r\n\r\n type = 'application/x-shockwave-flash';\r\n types = n.mimeTypes;\r\n\r\n if (types && types[type] && types[type].enabledPlugin && types[type].enabledPlugin.description) {\r\n hasPlugin = true;\r\n }\r\n\r\n } else if (AX !== _undefined && !ua.match(/MSAppHost/i)) {\r\n\r\n // Windows 8 Store Apps (MSAppHost) are weird (compatibility?) and won't complain here, but will barf if Flash/ActiveX object is appended to the DOM.\r\n try {\r\n obj = new AX('ShockwaveFlash.ShockwaveFlash');\r\n } catch(e) {\r\n // oh well\r\n obj = null;\r\n }\r\n\r\n hasPlugin = (!!obj);\r\n\r\n // cleanup, because it is ActiveX after all\r\n obj = null;\r\n\r\n }\r\n\r\n hasFlash = hasPlugin;\r\n\r\n return hasPlugin;\r\n\r\n };\r\n\r\n featureCheck = function() {\r\n\r\n var flashNeeded,\r\n item,\r\n formats = sm2.audioFormats,\r\n // iPhone <= 3.1 has broken HTML5 audio(), but firmware 3.2 (original iPad) + iOS4 works.\r\n isSpecial = (is_iDevice && !!(ua.match(/os (1|2|3_0|3_1)\\s/i)));\r\n\r\n if (isSpecial) {\r\n\r\n // has Audio(), but is broken; let it load links directly.\r\n sm2.hasHTML5 = false;\r\n\r\n // ignore flash case, however\r\n sm2.html5Only = true;\r\n\r\n // hide the SWF, if present\r\n if (sm2.oMC) {\r\n sm2.oMC.style.display = 'none';\r\n }\r\n\r\n } else if (sm2.useHTML5Audio) {\r\n\r\n if (!sm2.html5 || !sm2.html5.canPlayType) {\r\n sm2._wD('SoundManager: No HTML5 Audio() support detected.');\r\n sm2.hasHTML5 = false;\r\n }\r\n\r\n // <d>\r\n if (isBadSafari) {\r\n sm2._wD(smc + 'Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - ' + (!hasFlash ? ' would use flash fallback for MP3/MP4, but none detected.' : 'will use flash fallback for MP3/MP4, if available'), 1);\r\n }\r\n // </d>\r\n\r\n }\r\n\r\n if (sm2.useHTML5Audio && sm2.hasHTML5) {\r\n\r\n // sort out whether flash is optional, required or can be ignored.\r\n\r\n // innocent until proven guilty.\r\n canIgnoreFlash = true;\r\n\r\n for (item in formats) {\r\n\r\n if (formats.hasOwnProperty(item)) {\r\n\r\n if (formats[item].required) {\r\n\r\n if (!sm2.html5.canPlayType(formats[item].type)) {\r\n\r\n // 100% HTML5 mode is not possible.\r\n canIgnoreFlash = false;\r\n flashNeeded = true;\r\n\r\n } else if (sm2.preferFlash && (sm2.flash[item] || sm2.flash[formats[item].type])) {\r\n\r\n // flash may be required, or preferred for this format.\r\n flashNeeded = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // sanity check...\r\n if (sm2.ignoreFlash) {\r\n flashNeeded = false;\r\n canIgnoreFlash = true;\r\n }\r\n\r\n sm2.html5Only = (sm2.hasHTML5 && sm2.useHTML5Audio && !flashNeeded);\r\n\r\n return (!sm2.html5Only);\r\n\r\n };\r\n\r\n parseURL = function(url) {\r\n\r\n /**\r\n * Internal: Finds and returns the first playable URL (or failing that, the first URL.)\r\n * @param {string or array} url A single URL string, OR, an array of URL strings or {url:'/path/to/resource', type:'audio/mp3'} objects.\r\n */\r\n\r\n var i, j, urlResult = 0, result;\r\n\r\n if (url instanceof Array) {\r\n\r\n // find the first good one\r\n for (i = 0, j = url.length; i < j; i++) {\r\n\r\n if (url[i] instanceof Object) {\r\n\r\n // MIME check\r\n if (sm2.canPlayMIME(url[i].type)) {\r\n urlResult = i;\r\n break;\r\n }\r\n\r\n } else if (sm2.canPlayURL(url[i])) {\r\n\r\n // URL string check\r\n urlResult = i;\r\n break;\r\n\r\n }\r\n\r\n }\r\n\r\n // normalize to string\r\n if (url[urlResult].url) {\r\n url[urlResult] = url[urlResult].url;\r\n }\r\n\r\n result = url[urlResult];\r\n\r\n } else {\r\n\r\n // single URL case\r\n result = url;\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n\r\n startTimer = function(oSound) {\r\n\r\n /**\r\n * attach a timer to this sound, and start an interval if needed\r\n */\r\n\r\n if (!oSound._hasTimer) {\r\n\r\n oSound._hasTimer = true;\r\n\r\n if (!mobileHTML5 && sm2.html5PollingInterval) {\r\n\r\n if (h5IntervalTimer === null && h5TimerCount === 0) {\r\n\r\n h5IntervalTimer = setInterval(timerExecute, sm2.html5PollingInterval);\r\n\r\n }\r\n\r\n h5TimerCount++;\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n stopTimer = function(oSound) {\r\n\r\n /**\r\n * detach a timer\r\n */\r\n\r\n if (oSound._hasTimer) {\r\n\r\n oSound._hasTimer = false;\r\n\r\n if (!mobileHTML5 && sm2.html5PollingInterval) {\r\n\r\n // interval will stop itself at next execution.\r\n\r\n h5TimerCount--;\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n timerExecute = function() {\r\n\r\n /**\r\n * manual polling for HTML5 progress events, ie., whileplaying()\r\n * (can achieve greater precision than conservative default HTML5 interval)\r\n */\r\n\r\n var i;\r\n\r\n if (h5IntervalTimer !== null && !h5TimerCount) {\r\n\r\n // no active timers, stop polling interval.\r\n\r\n clearInterval(h5IntervalTimer);\r\n\r\n h5IntervalTimer = null;\r\n\r\n return;\r\n\r\n }\r\n\r\n // check all HTML5 sounds with timers\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n\r\n if (sm2.sounds[sm2.soundIDs[i]].isHTML5 && sm2.sounds[sm2.soundIDs[i]]._hasTimer) {\r\n sm2.sounds[sm2.soundIDs[i]]._onTimer();\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n catchError = function(options) {\r\n\r\n options = (options !== _undefined ? options : {});\r\n\r\n if (typeof sm2.onerror === 'function') {\r\n sm2.onerror.apply(window, [{\r\n type: (options.type !== _undefined ? options.type : null)\r\n }]);\r\n }\r\n\r\n if (options.fatal !== _undefined && options.fatal) {\r\n sm2.disable();\r\n }\r\n\r\n };\r\n\r\n badSafariFix = function() {\r\n\r\n // special case: \"bad\" Safari (OS X 10.3 - 10.7) must fall back to flash for MP3/MP4\r\n if (!isBadSafari || !detectFlash()) {\r\n // doesn't apply\r\n return;\r\n }\r\n\r\n var aF = sm2.audioFormats, i, item;\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n if (item === 'mp3' || item === 'mp4') {\r\n\r\n sm2._wD(sm + ': Using flash fallback for ' + item + ' format');\r\n sm2.html5[item] = false;\r\n\r\n // assign result to related formats, too\r\n if (aF[item] && aF[item].related) {\r\n for (i = aF[item].related.length - 1; i >= 0; i--) {\r\n sm2.html5[aF[item].related[i]] = false;\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Pseudo-private flash/ExternalInterface methods\r\n * ----------------------------------------------\r\n */\r\n\r\n this._setSandboxType = function(sandboxType) {\r\n\r\n // <d>\r\n // Security sandbox according to Flash plugin\r\n var sb = sm2.sandbox;\r\n\r\n sb.type = sandboxType;\r\n sb.description = sb.types[(sb.types[sandboxType] !== _undefined ? sandboxType : 'unknown')];\r\n\r\n if (sb.type === 'localWithFile') {\r\n\r\n sb.noRemote = true;\r\n sb.noLocal = false;\r\n _wDS('secNote', 2);\r\n\r\n } else if (sb.type === 'localWithNetwork') {\r\n\r\n sb.noRemote = false;\r\n sb.noLocal = true;\r\n\r\n } else if (sb.type === 'localTrusted') {\r\n\r\n sb.noRemote = false;\r\n sb.noLocal = false;\r\n\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n this._externalInterfaceOK = function(swfVersion) {\r\n\r\n // flash callback confirming flash loaded, EI working etc.\r\n // swfVersion: SWF build string\r\n\r\n if (sm2.swfLoaded) {\r\n return;\r\n }\r\n\r\n var e;\r\n\r\n debugTS('swf', true);\r\n debugTS('flashtojs', true);\r\n sm2.swfLoaded = true;\r\n tryInitOnFocus = false;\r\n\r\n if (isBadSafari) {\r\n badSafariFix();\r\n }\r\n\r\n // complain if JS + SWF build/version strings don't match, excluding +DEV builds\r\n // <d>\r\n if (!swfVersion || swfVersion.replace(/\\+dev/i, '') !== sm2.versionNumber.replace(/\\+dev/i, '')) {\r\n\r\n e = sm + ': Fatal: JavaScript file build \"' + sm2.versionNumber + '\" does not match Flash SWF build \"' + swfVersion + '\" at ' + sm2.url + '. Ensure both are up-to-date.';\r\n\r\n // escape flash -> JS stack so this error fires in window.\r\n setTimeout(function() {\r\n throw new Error(e);\r\n }, 0);\r\n\r\n // exit, init will fail with timeout\r\n return;\r\n\r\n }\r\n // </d>\r\n\r\n // IE needs a larger timeout\r\n setTimeout(init, isIE ? 100 : 1);\r\n\r\n };\r\n\r\n /**\r\n * Private initialization helpers\r\n * ------------------------------\r\n */\r\n\r\n createMovie = function(movieID, movieURL) {\r\n\r\n // ignore if already connected\r\n if (didAppend && appendSuccess) return false;\r\n\r\n function initMsg() {\r\n\r\n // <d>\r\n\r\n var options = [],\r\n title,\r\n msg = [],\r\n delimiter = ' + ';\r\n\r\n title = 'SoundManager ' + sm2.version + (!sm2.html5Only && sm2.useHTML5Audio ? (sm2.hasHTML5 ? ' + HTML5 audio' : ', no HTML5 audio support') : '');\r\n\r\n if (!sm2.html5Only) {\r\n\r\n if (sm2.preferFlash) {\r\n options.push('preferFlash');\r\n }\r\n\r\n if (sm2.useHighPerformance) {\r\n options.push('useHighPerformance');\r\n }\r\n\r\n if (sm2.flashPollingInterval) {\r\n options.push('flashPollingInterval (' + sm2.flashPollingInterval + 'ms)');\r\n }\r\n\r\n if (sm2.html5PollingInterval) {\r\n options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');\r\n }\r\n\r\n if (sm2.wmode) {\r\n options.push('wmode (' + sm2.wmode + ')');\r\n }\r\n\r\n if (sm2.debugFlash) {\r\n options.push('debugFlash');\r\n }\r\n\r\n if (sm2.useFlashBlock) {\r\n options.push('flashBlock');\r\n }\r\n\r\n } else if (sm2.html5PollingInterval) {\r\n options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');\r\n }\r\n\r\n if (options.length) {\r\n msg = msg.concat([options.join(delimiter)]);\r\n }\r\n\r\n sm2._wD(title + (msg.length ? delimiter + msg.join(', ') : ''), 1);\r\n\r\n showSupport();\r\n\r\n // </d>\r\n\r\n }\r\n\r\n if (sm2.html5Only) {\r\n\r\n // 100% HTML5 mode\r\n setVersionInfo();\r\n\r\n initMsg();\r\n sm2.oMC = id(sm2.movieID);\r\n init();\r\n\r\n // prevent multiple init attempts\r\n didAppend = true;\r\n\r\n appendSuccess = true;\r\n\r\n return false;\r\n\r\n }\r\n\r\n // flash path\r\n var remoteURL = (movieURL || sm2.url),\r\n localURL = (sm2.altURL || remoteURL),\r\n swfTitle = 'JS/Flash audio component (SoundManager 2)',\r\n oTarget = getDocument(),\r\n extraClass = getSWFCSS(),\r\n isRTL = null,\r\n html = doc.getElementsByTagName('html')[0],\r\n oEmbed, oMovie, tmp, movieHTML, oEl, s, x, sClass;\r\n\r\n isRTL = (html && html.dir && html.dir.match(/rtl/i));\r\n movieID = (movieID === _undefined ? sm2.id : movieID);\r\n\r\n function param(name, value) {\r\n return '<param name=\"' + name + '\" value=\"' + value + '\" />';\r\n }\r\n\r\n // safety check for legacy (change to Flash 9 URL)\r\n setVersionInfo();\r\n sm2.url = normalizeMovieURL(overHTTP ? remoteURL : localURL);\r\n movieURL = sm2.url;\r\n\r\n sm2.wmode = (!sm2.wmode && sm2.useHighPerformance ? 'transparent' : sm2.wmode);\r\n\r\n if (sm2.wmode !== null && (ua.match(/msie 8/i) || (!isIE && !sm2.useHighPerformance)) && navigator.platform.match(/win32|win64/i)) {\r\n /**\r\n * extra-special case: movie doesn't load until scrolled into view when using wmode = anything but 'window' here\r\n * does not apply when using high performance (position:fixed means on-screen), OR infinite flash load timeout\r\n * wmode breaks IE 8 on Vista + Win7 too in some cases, as of January 2011 (?)\r\n */\r\n messages.push(strings.spcWmode);\r\n sm2.wmode = null;\r\n }\r\n\r\n oEmbed = {\r\n name: movieID,\r\n id: movieID,\r\n src: movieURL,\r\n quality: 'high',\r\n allowScriptAccess: sm2.allowScriptAccess,\r\n bgcolor: sm2.bgColor,\r\n pluginspage: http + 'www.macromedia.com/go/getflashplayer',\r\n title: swfTitle,\r\n type: 'application/x-shockwave-flash',\r\n wmode: sm2.wmode,\r\n // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html\r\n hasPriority: 'true'\r\n };\r\n\r\n if (sm2.debugFlash) {\r\n oEmbed.FlashVars = 'debug=1';\r\n }\r\n\r\n if (!sm2.wmode) {\r\n // don't write empty attribute\r\n delete oEmbed.wmode;\r\n }\r\n\r\n if (isIE) {\r\n\r\n // IE is \"special\".\r\n oMovie = doc.createElement('div');\r\n movieHTML = [\r\n '<object id=\"' + movieID + '\" data=\"' + movieURL + '\" type=\"' + oEmbed.type + '\" title=\"' + oEmbed.title + '\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\">',\r\n param('movie', movieURL),\r\n param('AllowScriptAccess', sm2.allowScriptAccess),\r\n param('quality', oEmbed.quality),\r\n (sm2.wmode ? param('wmode', sm2.wmode) : ''),\r\n param('bgcolor', sm2.bgColor),\r\n param('hasPriority', 'true'),\r\n (sm2.debugFlash ? param('FlashVars', oEmbed.FlashVars) : ''),\r\n '</object>'\r\n ].join('');\r\n\r\n } else {\r\n\r\n oMovie = doc.createElement('embed');\r\n for (tmp in oEmbed) {\r\n if (oEmbed.hasOwnProperty(tmp)) {\r\n oMovie.setAttribute(tmp, oEmbed[tmp]);\r\n }\r\n }\r\n\r\n }\r\n\r\n initDebug();\r\n extraClass = getSWFCSS();\r\n oTarget = getDocument();\r\n\r\n if (oTarget) {\r\n\r\n sm2.oMC = (id(sm2.movieID) || doc.createElement('div'));\r\n\r\n if (!sm2.oMC.id) {\r\n\r\n sm2.oMC.id = sm2.movieID;\r\n sm2.oMC.className = swfCSS.swfDefault + ' ' + extraClass;\r\n s = null;\r\n oEl = null;\r\n\r\n if (!sm2.useFlashBlock) {\r\n if (sm2.useHighPerformance) {\r\n // on-screen at all times\r\n s = {\r\n position: 'fixed',\r\n width: '8px',\r\n height: '8px',\r\n // >= 6px for flash to run fast, >= 8px to start up under Firefox/win32 in some cases. odd? yes.\r\n bottom: '0px',\r\n left: '0px',\r\n overflow: 'hidden'\r\n };\r\n } else {\r\n // hide off-screen, lower priority\r\n s = {\r\n position: 'absolute',\r\n width: '6px',\r\n height: '6px',\r\n top: '-9999px',\r\n left: '-9999px'\r\n };\r\n if (isRTL) {\r\n s.left = Math.abs(parseInt(s.left, 10)) + 'px';\r\n }\r\n }\r\n }\r\n\r\n if (isWebkit) {\r\n // soundcloud-reported render/crash fix, safari 5\r\n sm2.oMC.style.zIndex = 10000;\r\n }\r\n\r\n if (!sm2.debugFlash) {\r\n for (x in s) {\r\n if (s.hasOwnProperty(x)) {\r\n sm2.oMC.style[x] = s[x];\r\n }\r\n }\r\n }\r\n\r\n try {\r\n\r\n if (!isIE) {\r\n sm2.oMC.appendChild(oMovie);\r\n }\r\n\r\n oTarget.appendChild(sm2.oMC);\r\n\r\n if (isIE) {\r\n oEl = sm2.oMC.appendChild(doc.createElement('div'));\r\n oEl.className = swfCSS.swfBox;\r\n oEl.innerHTML = movieHTML;\r\n }\r\n\r\n appendSuccess = true;\r\n\r\n } catch(e) {\r\n\r\n throw new Error(str('domError') + ' \\n' + e.toString());\r\n\r\n }\r\n\r\n } else {\r\n\r\n // SM2 container is already in the document (eg. flashblock use case)\r\n sClass = sm2.oMC.className;\r\n sm2.oMC.className = (sClass ? sClass + ' ' : swfCSS.swfDefault) + (extraClass ? ' ' + extraClass : '');\r\n sm2.oMC.appendChild(oMovie);\r\n\r\n if (isIE) {\r\n oEl = sm2.oMC.appendChild(doc.createElement('div'));\r\n oEl.className = swfCSS.swfBox;\r\n oEl.innerHTML = movieHTML;\r\n }\r\n\r\n appendSuccess = true;\r\n\r\n }\r\n\r\n }\r\n\r\n didAppend = true;\r\n\r\n initMsg();\r\n\r\n // sm2._wD(sm + ': Trying to load ' + movieURL + (!overHTTP && sm2.altURL ? ' (alternate URL)' : ''), 1);\r\n\r\n return true;\r\n\r\n };\r\n\r\n initMovie = function() {\r\n\r\n if (sm2.html5Only) {\r\n createMovie();\r\n return false;\r\n }\r\n\r\n // attempt to get, or create, movie (may already exist)\r\n if (flash) return false;\r\n\r\n if (!sm2.url) {\r\n\r\n /**\r\n * Something isn't right - we've reached init, but the soundManager url property has not been set.\r\n * User has not called setup({url: ...}), or has not set soundManager.url (legacy use case) directly before init time.\r\n * Notify and exit. If user calls setup() with a url: property, init will be restarted as in the deferred loading case.\r\n */\r\n\r\n _wDS('noURL');\r\n return false;\r\n\r\n }\r\n\r\n // inline markup case\r\n flash = sm2.getMovie(sm2.id);\r\n\r\n if (!flash) {\r\n\r\n if (!oRemoved) {\r\n\r\n // try to create\r\n createMovie(sm2.id, sm2.url);\r\n\r\n } else {\r\n\r\n // try to re-append removed movie after reboot()\r\n if (!isIE) {\r\n sm2.oMC.appendChild(oRemoved);\r\n } else {\r\n sm2.oMC.innerHTML = oRemovedHTML;\r\n }\r\n\r\n oRemoved = null;\r\n didAppend = true;\r\n\r\n }\r\n\r\n flash = sm2.getMovie(sm2.id);\r\n\r\n }\r\n\r\n if (typeof sm2.oninitmovie === 'function') {\r\n setTimeout(sm2.oninitmovie, 1);\r\n }\r\n\r\n // <d>\r\n flushMessages();\r\n // </d>\r\n\r\n return true;\r\n\r\n };\r\n\r\n delayWaitForEI = function() {\r\n\r\n setTimeout(waitForEI, 1000);\r\n\r\n };\r\n\r\n rebootIntoHTML5 = function() {\r\n\r\n // special case: try for a reboot with preferFlash: false, if 100% HTML5 mode is possible and useFlashBlock is not enabled.\r\n\r\n window.setTimeout(function() {\r\n\r\n complain(smc + 'useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false...');\r\n\r\n sm2.setup({\r\n preferFlash: false\r\n }).reboot();\r\n\r\n // if for some reason you want to detect this case, use an ontimeout() callback and look for html5Only and didFlashBlock == true.\r\n sm2.didFlashBlock = true;\r\n\r\n sm2.beginDelayedInit();\r\n\r\n }, 1);\r\n\r\n };\r\n\r\n waitForEI = function() {\r\n\r\n var p,\r\n loadIncomplete = false;\r\n\r\n if (!sm2.url) {\r\n // No SWF url to load (noURL case) - exit for now. Will be retried when url is set.\r\n return;\r\n }\r\n\r\n if (waitingForEI) {\r\n return;\r\n }\r\n\r\n waitingForEI = true;\r\n event.remove(window, 'load', delayWaitForEI);\r\n\r\n if (hasFlash && tryInitOnFocus && !isFocused) {\r\n // Safari won't load flash in background tabs, only when focused.\r\n _wDS('waitFocus');\r\n return;\r\n }\r\n\r\n if (!didInit) {\r\n p = sm2.getMoviePercent();\r\n if (p > 0 && p < 100) {\r\n loadIncomplete = true;\r\n }\r\n }\r\n\r\n setTimeout(function() {\r\n\r\n p = sm2.getMoviePercent();\r\n\r\n if (loadIncomplete) {\r\n // special case: if movie *partially* loaded, retry until it's 100% before assuming failure.\r\n waitingForEI = false;\r\n sm2._wD(str('waitSWF'));\r\n window.setTimeout(delayWaitForEI, 1);\r\n return;\r\n }\r\n\r\n // <d>\r\n if (!didInit) {\r\n\r\n sm2._wD(sm + ': No Flash response within expected time. Likely causes: ' + (p === 0 ? 'SWF load failed, ' : '') + 'Flash blocked or JS-Flash security error.' + (sm2.debugFlash ? ' ' + str('checkSWF') : ''), 2);\r\n\r\n if (!overHTTP && p) {\r\n\r\n _wDS('localFail', 2);\r\n\r\n if (!sm2.debugFlash) {\r\n _wDS('tryDebug', 2);\r\n }\r\n\r\n }\r\n\r\n if (p === 0) {\r\n\r\n // if 0 (not null), probably a 404.\r\n sm2._wD(str('swf404', sm2.url), 1);\r\n\r\n }\r\n\r\n debugTS('flashtojs', false, ': Timed out' + (overHTTP ? ' (Check flash security or flash blockers)' : ' (No plugin/missing SWF?)'));\r\n\r\n }\r\n // </d>\r\n\r\n // give up / time-out, depending\r\n\r\n if (!didInit && okToDisable) {\r\n\r\n if (p === null) {\r\n\r\n // SWF failed to report load progress. Possibly blocked.\r\n\r\n if (sm2.useFlashBlock || sm2.flashLoadTimeout === 0) {\r\n\r\n if (sm2.useFlashBlock) {\r\n\r\n flashBlockHandler();\r\n\r\n }\r\n\r\n _wDS('waitForever');\r\n\r\n } else if (!sm2.useFlashBlock && canIgnoreFlash) {\r\n\r\n // no custom flash block handling, but SWF has timed out. Will recover if user unblocks / allows SWF load.\r\n rebootIntoHTML5();\r\n\r\n } else {\r\n\r\n _wDS('waitForever');\r\n\r\n // fire any regular registered ontimeout() listeners.\r\n processOnEvents({\r\n type: 'ontimeout',\r\n ignoreInit: true,\r\n error: {\r\n type: 'INIT_FLASHBLOCK'\r\n }\r\n });\r\n\r\n }\r\n\r\n } else if (sm2.flashLoadTimeout === 0) {\r\n\r\n // SWF loaded? Shouldn't be a blocking issue, then.\r\n\r\n _wDS('waitForever');\r\n\r\n } else if (!sm2.useFlashBlock && canIgnoreFlash) {\r\n\r\n rebootIntoHTML5();\r\n\r\n } else {\r\n\r\n failSafely(true);\r\n\r\n }\r\n\r\n }\r\n\r\n }, sm2.flashLoadTimeout);\r\n\r\n };\r\n\r\n handleFocus = function() {\r\n\r\n function cleanup() {\r\n event.remove(window, 'focus', handleFocus);\r\n }\r\n\r\n if (isFocused || !tryInitOnFocus) {\r\n // already focused, or not special Safari background tab case\r\n cleanup();\r\n return true;\r\n }\r\n\r\n okToDisable = true;\r\n isFocused = true;\r\n _wDS('gotFocus');\r\n\r\n // allow init to restart\r\n waitingForEI = false;\r\n\r\n // kick off ExternalInterface timeout, now that the SWF has started\r\n delayWaitForEI();\r\n\r\n cleanup();\r\n return true;\r\n\r\n };\r\n\r\n flushMessages = function() {\r\n\r\n // <d>\r\n\r\n // SM2 pre-init debug messages\r\n if (messages.length) {\r\n sm2._wD('SoundManager 2: ' + messages.join(' '), 1);\r\n messages = [];\r\n }\r\n\r\n // </d>\r\n\r\n };\r\n\r\n showSupport = function() {\r\n\r\n // <d>\r\n\r\n flushMessages();\r\n\r\n var item, tests = [];\r\n\r\n if (sm2.useHTML5Audio && sm2.hasHTML5) {\r\n for (item in sm2.audioFormats) {\r\n if (sm2.audioFormats.hasOwnProperty(item)) {\r\n tests.push(item + ' = ' + sm2.html5[item] + (!sm2.html5[item] && needsFlash && sm2.flash[item] ? ' (using flash)' : (sm2.preferFlash && sm2.flash[item] && needsFlash ? ' (preferring flash)' : (!sm2.html5[item] ? ' (' + (sm2.audioFormats[item].required ? 'required, ' : '') + 'and no flash support)' : ''))));\r\n }\r\n }\r\n sm2._wD('SoundManager 2 HTML5 support: ' + tests.join(', '), 1);\r\n }\r\n\r\n // </d>\r\n\r\n };\r\n\r\n initComplete = function(bNoDisable) {\r\n\r\n if (didInit) return false;\r\n\r\n if (sm2.html5Only) {\r\n // all good.\r\n _wDS('sm2Loaded', 1);\r\n didInit = true;\r\n initUserOnload();\r\n debugTS('onload', true);\r\n return true;\r\n }\r\n\r\n var wasTimeout = (sm2.useFlashBlock && sm2.flashLoadTimeout && !sm2.getMoviePercent()),\r\n result = true,\r\n error;\r\n\r\n if (!wasTimeout) {\r\n didInit = true;\r\n }\r\n\r\n error = {\r\n type: (!hasFlash && needsFlash ? 'NO_FLASH' : 'INIT_TIMEOUT')\r\n };\r\n\r\n sm2._wD('SoundManager 2 ' + (disabled ? 'failed to load' : 'loaded') + ' (' + (disabled ? 'Flash security/load error' : 'OK') + ') ' + String.fromCharCode(disabled ? 10006 : 10003), disabled ? 2 : 1);\r\n\r\n if (disabled || bNoDisable) {\r\n\r\n if (sm2.useFlashBlock && sm2.oMC) {\r\n sm2.oMC.className = getSWFCSS() + ' ' + (sm2.getMoviePercent() === null ? swfCSS.swfTimedout : swfCSS.swfError);\r\n }\r\n\r\n processOnEvents({\r\n type: 'ontimeout',\r\n error: error,\r\n ignoreInit: true\r\n });\r\n\r\n debugTS('onload', false);\r\n catchError(error);\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n debugTS('onload', true);\r\n\r\n }\r\n\r\n if (!disabled) {\r\n\r\n if (sm2.waitForWindowLoad && !windowLoaded) {\r\n\r\n _wDS('waitOnload');\r\n event.add(window, 'load', initUserOnload);\r\n\r\n } else {\r\n\r\n // <d>\r\n if (sm2.waitForWindowLoad && windowLoaded) {\r\n _wDS('docLoaded');\r\n }\r\n // </d>\r\n\r\n initUserOnload();\r\n\r\n }\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * apply top-level setupOptions object as local properties, eg., this.setupOptions.flashVersion -> this.flashVersion (soundManager.flashVersion)\r\n * this maintains backward compatibility, and allows properties to be defined separately for use by soundManager.setup().\r\n */\r\n\r\n setProperties = function() {\r\n\r\n var i,\r\n o = sm2.setupOptions;\r\n\r\n for (i in o) {\r\n\r\n if (o.hasOwnProperty(i)) {\r\n\r\n // assign local property if not already defined\r\n\r\n if (sm2[i] === _undefined) {\r\n\r\n sm2[i] = o[i];\r\n\r\n } else if (sm2[i] !== o[i]) {\r\n\r\n // legacy support: write manually-assigned property (eg., soundManager.url) back to setupOptions to keep things in sync\r\n sm2.setupOptions[i] = sm2[i];\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n\r\n init = function() {\r\n\r\n // called after onload()\r\n\r\n if (didInit) {\r\n _wDS('didInit');\r\n return false;\r\n }\r\n\r\n function cleanup() {\r\n event.remove(window, 'load', sm2.beginDelayedInit);\r\n }\r\n\r\n if (sm2.html5Only) {\r\n\r\n if (!didInit) {\r\n // we don't need no steenking flash!\r\n cleanup();\r\n sm2.enabled = true;\r\n initComplete();\r\n }\r\n\r\n return true;\r\n\r\n }\r\n\r\n // flash path\r\n initMovie();\r\n\r\n try {\r\n\r\n // attempt to talk to Flash\r\n flash._externalInterfaceTest(false);\r\n\r\n /**\r\n * Apply user-specified polling interval, OR, if \"high performance\" set, faster vs. default polling\r\n * (determines frequency of whileloading/whileplaying callbacks, effectively driving UI framerates)\r\n */\r\n setPolling(true, (sm2.flashPollingInterval || (sm2.useHighPerformance ? 10 : 50)));\r\n\r\n if (!sm2.debugMode) {\r\n // stop the SWF from making debug output calls to JS\r\n flash._disableDebug();\r\n }\r\n\r\n sm2.enabled = true;\r\n debugTS('jstoflash', true);\r\n\r\n if (!sm2.html5Only) {\r\n // prevent browser from showing cached page state (or rather, restoring \"suspended\" page state) via back button, because flash may be dead\r\n // http://www.webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/\r\n event.add(window, 'unload', doNothing);\r\n }\r\n\r\n } catch(e) {\r\n\r\n sm2._wD('js/flash exception: ' + e.toString());\r\n\r\n debugTS('jstoflash', false);\r\n\r\n catchError({\r\n type: 'JS_TO_FLASH_EXCEPTION',\r\n fatal: true\r\n });\r\n\r\n // don't disable, for reboot()\r\n failSafely(true);\r\n\r\n initComplete();\r\n\r\n return false;\r\n\r\n }\r\n\r\n initComplete();\r\n\r\n // disconnect events\r\n cleanup();\r\n\r\n return true;\r\n\r\n };\r\n\r\n domContentLoaded = function() {\r\n\r\n if (didDCLoaded) return false;\r\n\r\n didDCLoaded = true;\r\n\r\n // assign top-level soundManager properties eg. soundManager.url\r\n setProperties();\r\n\r\n initDebug();\r\n\r\n if (!hasFlash && sm2.hasHTML5) {\r\n\r\n sm2._wD('SoundManager 2: No Flash detected' + (!sm2.useHTML5Audio ? ', enabling HTML5.' : '. Trying HTML5-only mode.'), 1);\r\n\r\n sm2.setup({\r\n useHTML5Audio: true,\r\n // make sure we aren't preferring flash, either\r\n // TODO: preferFlash should not matter if flash is not installed. Currently, stuff breaks without the below tweak.\r\n preferFlash: false\r\n });\r\n\r\n }\r\n\r\n testHTML5();\r\n\r\n if (!hasFlash && needsFlash) {\r\n\r\n messages.push(strings.needFlash);\r\n\r\n // TODO: Fatal here vs. timeout approach, etc.\r\n // hack: fail sooner.\r\n sm2.setup({\r\n flashLoadTimeout: 1\r\n });\r\n\r\n }\r\n\r\n if (doc.removeEventListener) {\r\n doc.removeEventListener('DOMContentLoaded', domContentLoaded, false);\r\n }\r\n\r\n initMovie();\r\n\r\n return true;\r\n\r\n };\r\n\r\n domContentLoadedIE = function() {\r\n\r\n if (doc.readyState === 'complete') {\r\n domContentLoaded();\r\n doc.detachEvent('onreadystatechange', domContentLoadedIE);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n winOnLoad = function() {\r\n\r\n // catch edge case of initComplete() firing after window.load()\r\n windowLoaded = true;\r\n\r\n // catch case where DOMContentLoaded has been sent, but we're still in doc.readyState = 'interactive'\r\n domContentLoaded();\r\n\r\n event.remove(window, 'load', winOnLoad);\r\n\r\n };\r\n\r\n // sniff up-front\r\n detectFlash();\r\n\r\n // focus and window load, init (primarily flash-driven)\r\n event.add(window, 'focus', handleFocus);\r\n event.add(window, 'load', delayWaitForEI);\r\n event.add(window, 'load', winOnLoad);\r\n\r\n if (doc.addEventListener) {\r\n\r\n doc.addEventListener('DOMContentLoaded', domContentLoaded, false);\r\n\r\n } else if (doc.attachEvent) {\r\n\r\n doc.attachEvent('onreadystatechange', domContentLoadedIE);\r\n\r\n } else {\r\n\r\n // no add/attachevent support - safe to assume no JS -> Flash either\r\n debugTS('onload', false);\r\n catchError({\r\n type: 'NO_DOM2_EVENTS',\r\n fatal: true\r\n });\r\n\r\n }\r\n\r\n} // SoundManager()\r\n\r\n// SM2_DEFER details: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading\r\n\r\nif (window.SM2_DEFER === _undefined || !SM2_DEFER) {\r\n soundManager = new SoundManager();\r\n}\r\n\r\n/**\r\n * SoundManager public interfaces\r\n * ------------------------------\r\n */\r\n\r\nif (typeof module === 'object' && module && typeof module.exports === 'object') {\r\n\r\n /**\r\n * commonJS module\r\n */\r\n\r\n module.exports.SoundManager = SoundManager;\r\n module.exports.soundManager = soundManager;\r\n\r\n} else if (typeof define === 'function' && define.amd) {\r\n\r\n /**\r\n * AMD - requireJS\r\n * basic usage:\r\n * require([\"/path/to/soundmanager2.js\"], function(SoundManager) {\r\n * SoundManager.getInstance().setup({\r\n * url: '/swf/',\r\n * onready: function() { ... }\r\n * })\r\n * });\r\n *\r\n * SM2_DEFER usage:\r\n * window.SM2_DEFER = true;\r\n * require([\"/path/to/soundmanager2.js\"], function(SoundManager) {\r\n * SoundManager.getInstance(function() {\r\n * var soundManager = new SoundManager.constructor();\r\n * soundManager.setup({\r\n * url: '/swf/',\r\n * ...\r\n * });\r\n * ...\r\n * soundManager.beginDelayedInit();\r\n * return soundManager;\r\n * })\r\n * });\r\n */\r\n\r\n define(function() {\r\n /**\r\n * Retrieve the global instance of SoundManager.\r\n * If a global instance does not exist it can be created using a callback.\r\n *\r\n * @param {Function} smBuilder Optional: Callback used to create a new SoundManager instance\r\n * @return {SoundManager} The global SoundManager instance\r\n */\r\n function getInstance(smBuilder) {\r\n if (!window.soundManager && smBuilder instanceof Function) {\r\n var instance = smBuilder(SoundManager);\r\n if (instance instanceof SoundManager) {\r\n window.soundManager = instance;\r\n }\r\n }\r\n return window.soundManager;\r\n }\r\n return {\r\n constructor: SoundManager,\r\n getInstance: getInstance\r\n };\r\n });\r\n\r\n}\r\n\r\n// standard browser case\r\n\r\n// constructor\r\nwindow.SoundManager = SoundManager;\r\n\r\n/**\r\n * note: SM2 requires a window global due to Flash, which makes calls to window.soundManager.\r\n * Flash may not always be needed, but this is not known until async init and SM2 may even \"reboot\" into Flash mode.\r\n */\r\n\r\n// public API, flash callbacks etc.\r\nwindow.soundManager = soundManager;\r\n\r\n}(window));\r\n"],"names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","methodName","return","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_defineProperties","target","props","descriptor","input","hint","prim","toPrimitive","res","String","_toPrimitive","PageChunk","leafIndex","chunkIndex","text","lineRects","instance","Constructor","_classCallCheck","this","staticProps","_fetch","_callee","server","bookPath","chunks","_context","$","ajax","url","concat","dataType","cache","data","path","page","_fromTextWrapperResponse","args","arguments","apply","_x","_x2","_x3","chunksResponse","map","c","correctedLineRects","_fixChunkRects","correctedText","_removeDanglingHyphens","rects","_rects","_slicedToArray","firstRect","secondRect","_firstRect","left","bottom","width","secondHeight","secondWidth","secondRight","replace","PageChunkIterator","pageCount","start","opts","assign","DEFAULT_OPTS","_cursor","chunk","_bufferedPages","_bufferingPages","_cursorLock","protoProps","_nextUncontrolled2","_this","_nextUncontrolled","_this2","_decrementUncontrolled","AT_END","_recenterBuffer","_fetchPageChunks","_this3","cursorChangePromise","prevPageChunks","index","Math","max","pageBufferSize","end","min","_removePageFromBuffer","_this4","_fetchPageChunksDirect","fetch","_asyncToGenerator","_toPropertyKey","AbstractTTSEngine","options","voice","getBestBookVoice","getVoices","bookLanguage","playing","paused","_chunkIterator","activeSound","playbackRate","events","on","updateBestVoice","trigger","_step","_jumpBackward","numLeafs","onLoadingStart","step","fireEvent","pause","resume","all","decrement","voiceURI","off","find","setVoice","newRate","setPlaybackRate","_callee2","sound","playPromise","_context2","onDone","createSound","rate","load","onLoadingComplete","beforeChunkPlay","playSound","afterChunkPlay","loaded","play","voices","userLanguages","navigator","languages","bookLangVoices","filter","v","lang","startsWith","matchingUserLangs","language","getMatchingVoice","default","_step2","_iterator","_createForOfIteratorHelper","_loop","matchingVoices","s","n","_ret","e","f","_createClass","_get","Reflect","get","bind","property","receiver","base","_getPrototypeOf","_superPropBase","getOwnPropertyDescriptor","_setPrototypeOf","o","p","FestivalTTSEngine","_AbstractTTSEngine","subClass","superClass","_inherits","_iOSCaptureUserIntentHack","Derived","hasNativeReflectConstruct","_super","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","Super","NewTarget","ReferenceError","_assertThisInitialized","_possibleConstructorReturn","_$$browser","audioFormat","browser","mozilla","localService","soundManager","setup","debugMode","preferFlash","useHTML5Audio","flashVersion","promise","userAgent","match","iOSCaptureUserIntentHack","FestivalTTSSound","getSoundUrl","dataString","encodeURIComponent","SILENCE_1MS","onfinish","destruct","supported","soundUrl","_finishResolver","_play","onload","_onresume","onresume","sleep","_callee3","_context3","mp3","ogg","isChrome","vendor","test","isFirefox","isAndroid","COLUMN_TO_LANG_INDEX","searchForISO6391","columnsToSearch","langs","colI","column","split","x","toLowerCase","indexOf","super_","WebTTSEngine","speechSynthesis","addEventListener","audio","Audio","SILENCE_6S_MP3","loop","src","mediaSession","metadata","MediaMetadata","title","br","bookTitle","artist","m","label","artwork","thumbnail","setActionHandler","jumpBackward","jumpForward","unshift","WebTTSSound","window","started","stopped","utterance","_lastEvents","boundary","_charIndex","_finishPromise","_chromePausingBugFix2","_resume","_pause","_finish","_reload","_this$voice","SpeechSynthesisUtterance","location","toString","console","log","ev","dispatchEvent","CustomEvent","wasPaused","recentEvent","charIndex","cancel","speak","isLocalVoice","_chromePausingBugFix","endPromise","race","promisifyEvent","Event","pausePromise","pauseMightNotWork","timeoutPromise","_callee4","resumeMightNotWork","resumeMightNotFire","resumePromise","_context4","reload","_callee5","_context5","t0","en","jQuery","extend","BookReader","defaultOptions","enableTtsPlugin","_ttsBoxesByIndex","TTSEngine","isSupported","engineName","festival","web","ttsEngine","showProgressPopup","removeProgressPopup","ttsStop","ttsBeforeChunkPlay","ttsSendChunkFinishedAnalyticsEvent","init","eventNames","PostInit","click","ttsToggle","ttsStart","_createPageContainer","pageContainer","pageIndex","renderBoxesInPageContainerLayer","$container","buildMobileDrawerElement","$el","after","imagesBaseURL","initNavbar","refs","$BRReadAloudToolbar","prepend","renderVoiceOption","join","voiceSortOrder","a","b","localeCompare","renderVoicesMenu","voicesMenu","empty","bookLanguages","sort","otherLanguages","append","show","hide","ttsUpdateState","ttsPlayPause","ttsJumpForward","ttsJumpBackward","$rateSelector","parseFloat","tooltips","insertBefore","closest","autoStop","startTTSEngine","constModeThumb","mode","switchMode","constMode1up","addClass","ttsSendAnalyticsEvent","currentIndex","book","getNumLeafs","isPlaying","toggleClass","togglePlayPause","removeClass","ttsRemoveHilites","_ref","ttsMaybeFlipToIndex","ttsHighlightChunk","ttsScrollToChunk","_ref2","constMode2up","jumpToIndex","_modes","mode2Up","mode2UpLit","_ref3","_ref4","l","r","t","_Object$entries$_i","_Object$entries","_i2","pageIndexString","boxes","getPage","getActivePageContainerElementsForIndex","container","entries","_$$last","_$$last$","last","scrollIntoView","block","isFullscreenActive","inline","behavior","getActivePageContainerElements","remove","action","archiveAnalyticsSendEvent","extraValues","mediaLanguage","global","fails","uncurryThis","trim","whitespaces","$parseFloat","ITERATOR","FORCED","module","string","trimmedString","$entries","stat","O","forced","uaMatch","ua","exec","platform_match","matched","version","versionNumber","platform","parseInt","android","bb","blackberry","ipad","iphone","ipod","kindle","playbook","silk","mobile","cros","mac","linux","win","desktop","chrome","opr","safari","webkit","rv","iemobile","ie","edge","msedge","opera","jQBrowser","factory","_undefined","document","SoundManager","smURL","smID","setupOptions","debugFlash","useConsole","consoleOnly","waitForWindowLoad","bgColor","useHighPerformance","flashPollingInterval","html5PollingInterval","flashLoadTimeout","wmode","allowScriptAccess","useFlashBlock","forceUseGlobalHTML5Audio","ignoreMobileRestrictions","html5Test","noSWFCache","idPrefix","autoLoad","autoPlay","from","loops","onid3","onerror","whileloading","onplay","onpause","whileplaying","onposition","onstop","multiShot","multiShotEvents","position","pan","stream","to","usePolicyFile","volume","flash9Options","onfailure","isMovieStar","usePeakData","useWaveformData","useEQData","onbufferchange","ondataerror","movieStarOptions","bufferTime","serverURL","onconnect","duration","audioFormats","required","mp4","related","opus","wav","flac","movieID","id","debugID","debugURLParam","movieURL","altURL","swfLoaded","enabled","oMC","sounds","soundIDs","muted","didFlashBlock","filePattern","filePatterns","flash8","flash9","features","buffering","peakData","waveformData","eqData","movieStar","sandbox","types","remote","localWithFile","localWithNetwork","localTrusted","description","noRemote","noLocal","html5","usingFlash","flash","html5Only","ignoreFlash","SMSound","doNothing","setProperties","fV","debugTS","_wDS","initComplete","mixin","extraOptions","addOnEvent","processOnEvents","initUserOnload","delayWaitForEI","waitForEI","rebootIntoHTML5","setVersionInfo","handleFocus","strings","initMovie","domContentLoaded","winOnLoad","didDCLoaded","getDocument","createMovie","catchError","setPolling","initDebug","disableObject","failSafely","normalizeMovieURL","str","flashBlockHandler","getSWFCSS","swfCSS","toggleDebug","loopFix","policyFix","complain","idCheck","startTimer","stopTimer","timerExecute","parseURL","canIgnoreFlash","featureCheck","html5OK","html5CanPlay","html5ErrorCodes","html5Ext","html5Unload","domContentLoadedIE","testHTML5","event","lastGlobalHTML5URL","hasFlash","detectFlash","badSafariFix","html5_events","showSupport","flushMessages","wrapCallback","didSetup","sm2","globalHTML5Audio","sm","smc","wl","href","doc","on_queue","debugOpen","didAppend","appendSuccess","didInit","disabled","windowLoaded","wdCount","debugLevels","oRemoved","oRemovedHTML","waitingForEI","initPending","h5TimerCount","h5IntervalTimer","messages","needsFlash","Array","useGlobalHTML5Audio","idCounter","msecScale","is_iDevice","isIE","isWebkit","isSafari","isOpera","mobileHTML5","isBadSafari","hasConsole","isFocused","hasFocus","tryInitOnFocus","okToDisable","flashMIME","emptyURL","overHTTP","protocol","http","netStreamMimeTypes","netStreamTypes","netStreamPattern","RegExp","preferFlashCheck","kind","html5_event","oFn","_s","_a","_wD","h5","mimePattern","useAltURL","swfBox","swfDefault","swfError","swfTimedout","swfUnblocked","sm2Debug","highPerf","flashDebug","hasHTML5","canPlayType","noURL","ok","globalHTML5","ignoreMobile","mobileUA","beginDelayedInit","readyState","setTimeout","getMovie","movie_id","oOptions","_url","cs","cs_string","oSound","make","_setup_html5","_createSound","connected","destroySound","sID","_bFromSound","oS","_iO","unload","splice","onPosition","nPosition","oMethod","oScope","clearOnPosition","overloaded","allowOverride","setPosition","nMsecOffset","stopAll","pauseAll","resumeAll","togglePause","setPan","nPan","setVolume","nVol","j","mute","muteAll","unmute","unmuteAll","toggleMute","getMemoryUse","ram","_getMemoryUse","disable","bNoDisable","canPlayMIME","sMIME","canPlayURL","sURL","canPlayLink","oLink","getSoundById","_suppressDebug","onready","sType","ontimeout","_writeDebug","sText","sTypeOrObject","oItem","createElement","className","appendChild","createTextNode","style","fontWeight","color","firstChild","alert","_debug","reboot","resetEvents","excludeInit","k","innerHTML","parentNode","removeChild","fired","getMoviePercent","PercentLoaded","resetProperties","add_html5_events","remove_html5_events","stop_html5_timer","start_html5_timer","attachOnPosition","detachOnPosition","applyFromTo","lastHTML5State","urlOmitted","onplay_called","onPositionItems","onPositionFired","lastURL","time","instanceOptions","isHTML5","id3","playState","_called_load","_html5_canplay","autobuffer","preload","_load","fatal","_unload","_bFromSM","_destroySound","_updatePlayState","fN","audioClone","onended","oncanplay","startOK","getAutoPlay","setAutoPlay","substr","lastIndexOf","instanceCount","_oncanplay","_onfinish","currentTime","add","_start","onplayerror","bAll","originalPosition","_onbufferchange","_resetOnPosition","_onTimer","_stop","_setAutoPlay","normalizedRate","message","position1K","offset","toFixed","_setPosition","_bCallFlash","bInstanceOnly","_setPan","_bInstanceOnly","_setVolume","hasIO","scope","_processOnPosition","item","op","retainPosition","_hasTimer","bytesLoaded","bytesTotal","durationEstimate","buffered","right","failures","isBuffering","bForce","isNew","_get_html5_duration","_whileplaying","d","Infinity","_apply_loop","nLoops","sameURL","dURL","decodeURI","_added_events","oEvt","removeEventListener","_onload","nSuccess","loadOK","_onerror","errorCode","nIsBuffering","_onsuspend","onsuspend","_onfailure","msg","level","code","_onwarning","onwarning","io_onfinish","_whileloading","nBytesLoaded","nBytesTotal","nDuration","nBufferLength","floor","bufferLength","oPeakData","oWaveformDataLeft","oWaveformDataRight","oEQData","eqLeft","leftPeak","rightPeak","leftEQ","rightEQ","_oncaptiondata","oData","captiondata","oncaptiondata","_onmetadata","oMDProps","oMDData","onmetadata","_onid3","oID3Props","oID3Data","_onconnect","bSuccess","_ondataerror","sError","body","getElementsByTagName","getElementById","oMain","oAdd","o2","o1","callback","oParent","hasParent","bonusOptions","Function","old","evt","getArgs","oArgs","len","element","shift","abort","canplay","ee","canplaythrough","durationchange","ended","loadeddata","_loaded","loadedmetadata","loadstart","fromCharCode","progress","progStr","isProgress","ranges","total","ratechange","suspend","stalled","timeupdate","waiting","iO","oAudio","_called_unload","fileExt","mime","aF","lookup","support","cp","canPlay","isOK","notReady","notOK","domError","spcWmode","swf404","tryDebug","checkSWF","localFail","waitFocus","waitForever","waitSWF","needFunction","badID","currentObj","waitOnload","docLoaded","onloadOK","secNote","badRemove","shutdown","queue","smError","fbTimeout","fbLoaded","fbHandler","manURL","onURL","badFV","as2loop","noNSLoop","needfl9","mfTimeout","needFlash","gotFocus","policy","setupError","setupUndef","setupLate","sm2Loaded","sstr","sOpt","sPre","sMsg","warn","oProp","Date","getTime","isDebug","bPolling","bHighPerformance","_setPolling","oD","oDebug","oTarget","oToggle","tmp","height","lineHeight","margin","textAlign","border","cursor","background","zIndex","onclick","display","e2","errorLevel","oT","sEventType","sMessage","sm2Debugger","handleEvent","css","ignoreInit","status","success","srcQueue","canRetry","nP","hasPlugin","AX","ActiveXObject","plugins","mimeTypes","enabledPlugin","flashNeeded","formats","urlResult","setInterval","clearInterval","_setSandboxType","sandboxType","sb","_externalInterfaceOK","swfVersion","initMsg","isRTL","oEmbed","oMovie","movieHTML","oEl","sClass","remoteURL","localURL","extraClass","html","param","dir","quality","bgcolor","pluginspage","hasPriority","FlashVars","setAttribute","overflow","top","abs","oninitmovie","loadIncomplete","cleanup","tests","_externalInterfaceTest","_disableDebug","detachEvent","attachEvent","SM2_DEFER","getInstance","smBuilder"],"sourceRoot":""}
1
+ {"version":3,"file":"plugins/plugin.tts.js","mappings":";gtDACAA,EAAA,kBAAAC,CAAA,MAAAA,EAAA,GAAAC,EAAAC,OAAAC,UAAAC,EAAAH,EAAAI,eAAAC,EAAAJ,OAAAI,gBAAA,SAAAC,EAAAC,EAAAC,GAAAF,EAAAC,GAAAC,EAAAC,KAAA,EAAAC,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,gCAOHqE,EAAOoN,aAAeA,EAQtBpN,EAAOrE,aAAeA,CAEtB,CAxnMA,CAwnMEqE","sources":["webpack://@internetarchive/bookreader/./src/plugins/tts/PageChunk.js","webpack://@internetarchive/bookreader/./src/plugins/tts/PageChunkIterator.js","webpack://@internetarchive/bookreader/./src/plugins/tts/AbstractTTSEngine.js","webpack://@internetarchive/bookreader/./src/plugins/tts/FestivalTTSEngine.js","webpack://@internetarchive/bookreader/./src/util/browserSniffing.js","webpack://@internetarchive/bookreader/./src/plugins/tts/utils.js","webpack://@internetarchive/bookreader/./src/plugins/tts/WebTTSEngine.js","webpack://@internetarchive/bookreader/./src/plugins/tts/plugin.tts.js","webpack://@internetarchive/bookreader/./src/plugins/tts/tooltip_dict.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/number-parse-float.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.object.entries.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.parse-float.js","webpack://@internetarchive/bookreader/./node_modules/iso-language-codes/js/data.js","webpack://@internetarchive/bookreader/./node_modules/jquery.browser/dist/jquery.browser.js","webpack://@internetarchive/bookreader/./node_modules/soundmanager2/script/soundmanager2.js"],"sourcesContent":["/**\n * Class to manage a 'chunk' (approximately a paragraph) of text on a page.\n */\nexport default class PageChunk {\n /**\n * @param {number} leafIndex\n * @param {number} chunkIndex\n * @param {string} text\n * @param {DJVURect[]} lineRects\n */\n constructor(leafIndex, chunkIndex, text, lineRects) {\n this.leafIndex = leafIndex;\n this.chunkIndex = chunkIndex;\n this.text = text;\n this.lineRects = lineRects;\n }\n\n /**\n * @param {string} server\n * @param {string} bookPath\n * @param {number} leafIndex\n * @return {Promise<PageChunk[]>}\n */\n static async fetch(server, bookPath, leafIndex) {\n const chunks = await $.ajax({\n type: 'GET',\n url: `https://${server}/BookReader/BookReaderGetTextWrapper.php`,\n dataType:'jsonp',\n cache: true,\n data: {\n path: `${bookPath}_djvu.xml`,\n page: leafIndex\n }\n });\n return PageChunk._fromTextWrapperResponse(leafIndex, chunks);\n }\n\n /**\n * Convert the response from BookReaderGetTextWrapper.php into a {@link PageChunk} instance\n * @param {number} leafIndex\n * @param {Array<[String, ...DJVURect[]]>} chunksResponse\n * @return {PageChunk[]}\n */\n static _fromTextWrapperResponse(leafIndex, chunksResponse) {\n return chunksResponse.map((c, i) => {\n const correctedLineRects = PageChunk._fixChunkRects(c.slice(1));\n const correctedText = PageChunk._removeDanglingHyphens(c[0]);\n return new PageChunk(leafIndex, i, correctedText, correctedLineRects);\n });\n }\n\n /**\n * @private\n * Sometimes the first rectangle will be ridiculously wide/tall. Find those and fix them\n * *NOTE*: Modifies the original array and returns it.\n * *NOTE*: This should probably be fixed on the petabox side, and then removed here\n * Has 2 problems:\n * - If the rect is the last rect on the page (and hence the only rect in the array),\n * the rect's size isn't fixed\n * - Because this relies on the second rect, there's a chance it won't be the right\n * width\n * @param {DJVURect[]} rects\n * @return {DJVURect[]}\n */\n static _fixChunkRects(rects) {\n if (rects.length < 2) return rects;\n\n const [firstRect, secondRect] = rects;\n const [left, bottom, right] = firstRect;\n const width = right - left;\n const secondHeight = secondRect[1] - secondRect[3];\n const secondWidth = secondRect[2] - secondRect[0];\n const secondRight = secondRect[2];\n\n if (width > secondWidth * 30) {\n // Set the end to be the same\n firstRect[2] = secondRight;\n // And the top to be the same height\n firstRect[3] = bottom - secondHeight;\n }\n\n return rects;\n }\n\n /**\n * Remove \"dangling\" hyphens from read aloud text to avoid TTS stuttering\n * @param {string} text\n * @return {string}\n */\n static _removeDanglingHyphens(text) {\n // Some books mis-OCR a dangling hyphen as a ¬ (mathematical not sign) . Since in math\n // the not sign should not appear followed by a space, we think we can safely assume\n // this should be replaced.\n return text.replace(/[-¬]\\s+/g, '');\n }\n}\n\n/**\n * @typedef {[number, number, number, number]} DJVURect\n * coords are in l,b,r,t order\n */\n","import PageChunk from './PageChunk.js';\n\n/**\n * Class that iterates over the page chunks of a book; caching/buffering\n * as much as possible to try to ensure a smooth experience.\n */\nexport default class PageChunkIterator {\n /**\n * @param {number} pageCount total number of pages\n * @param {number} start page to start on\n * @param {PageChunkIteratorOptions} opts\n */\n constructor(pageCount, start, opts) {\n this.pageCount = pageCount;\n this.opts = Object.assign({}, DEFAULT_OPTS, opts);\n /** Position in the chunk sequence */\n this._cursor = { page: start, chunk: 0 };\n /** @type {Object<number, PageChunk[]>} leaf index -> chunks*/\n this._bufferedPages = {};\n /** @type {Object<number, PromiseLike<PageChunk[]>} leaf index -> chunks*/\n this._bufferingPages = {};\n /**\n * @type {Promise} promise that manages cursor modifications so that they\n * happen in order triggered as opposed to order the server responds\n **/\n this._cursorLock = Promise.resolve();\n }\n\n /**\n * Get the next chunk\n * @return {PromiseLike<\"__PageChunkIterator.AT_END__\" | PageChunk>}\n */\n next() {\n return this._cursorLock = this._cursorLock\n .then(() => this._nextUncontrolled());\n }\n\n /**\n * Sends the cursor back 1\n * @return {Promise}\n **/\n decrement() {\n return this._cursorLock = this._cursorLock\n .then(() => this._decrementUncontrolled());\n }\n\n /**\n * Gets without ensuring synchronization. Since this iterator has a lot of async\n * code, calling e.g. \"next\" twice (before the first call to next has finished)\n * would cause the system to be in a weird state. To avoid that, we make sure calls\n * to next and decrement (functions that modify the cursor) are synchronized,\n * so that regardless how long it takes for one to respond, they'll always be executed\n * in the correct order.\n * @return {PromiseLike<\"__PageChunkIterator.AT_END__\" | PageChunk>}\n */\n async _nextUncontrolled() {\n if (this._cursor.page == this.pageCount) {\n return Promise.resolve(PageChunkIterator.AT_END);\n }\n this._recenterBuffer(this._cursor.page);\n const chunks = await this._fetchPageChunks(this._cursor.page);\n if (this._cursor.chunk == chunks.length) {\n this._cursor.page++;\n this._cursor.chunk = 0;\n return this._nextUncontrolled();\n }\n return chunks[this._cursor.chunk++];\n }\n\n /**\n * Decrements without ensuring synchronization. (See {@link PageChunkIterator._nextUncontrolled});\n * @return {Promise}\n */\n _decrementUncontrolled() {\n let cursorChangePromise = Promise.resolve();\n\n if (this._cursor.chunk > 0) {\n this._cursor.chunk--;\n } else if (this._cursor.page > 0) {\n this._cursor.page--;\n // Go back possibly multiple pages, because pages can be blank\n cursorChangePromise = this._fetchPageChunks(this._cursor.page)\n .then(prevPageChunks => {\n if (prevPageChunks.length == 0) return this._decrementUncontrolled();\n else this._cursor.chunk = prevPageChunks.length - 1;\n });\n }\n\n return cursorChangePromise\n .then(() => this._fetchPageChunks(this._cursor.page));\n }\n\n /**\n * Recenter the buffer around the provided page index\n * @param {number} index\n */\n _recenterBuffer(index) {\n const start = Math.max(0, index - this.opts.pageBufferSize);\n const end = Math.min(this.pageCount, index + this.opts.pageBufferSize + 1);\n for (let i = start; i < end; i++) {\n this._fetchPageChunks(i);\n }\n\n this._removePageFromBuffer(start - 1);\n this._removePageFromBuffer(end + 1);\n }\n\n /**\n * @param {number} index\n */\n _removePageFromBuffer(index) {\n delete this._bufferingPages[index];\n delete this._bufferedPages[index];\n }\n\n /**\n * Fetches the chunks on a page; checks the buffer, so it won't make unnecessary\n * requests if it's called multiple times for the same index.\n * @param {number} index\n * @return {Promise<PageChunk[]>}\n */\n _fetchPageChunks(index) {\n if (index in this._bufferingPages) return this._bufferingPages[index];\n if (index in this._bufferedPages) return Promise.resolve(this._bufferedPages[index]);\n\n this._bufferingPages[index] = this._fetchPageChunksDirect(index)\n .then(chunks => {\n delete this._bufferingPages[index];\n this._bufferedPages[index] = chunks;\n return chunks;\n });\n\n return this._bufferingPages[index];\n }\n\n /**\n * Fetches a page without checking buffer\n * @param {number} index\n */\n _fetchPageChunksDirect(index) {\n return PageChunk.fetch(this.opts.server, this.opts.bookPath, index);\n }\n}\n\nPageChunkIterator.AT_END = \"__PageChunkIterator.AT_END__\";\n\n/** @type {PageChunkIteratorOptions} */\nconst DEFAULT_OPTS = {\n server: null,\n bookPath: null,\n pageBufferSize: 2,\n};\n\n/**\n * @typedef {Object} PageChunkIteratorOptions\n * @property {string} server\n * @property {string} bookPath\n * @property {number} [pageBufferSize] number of pages to buffer before/after the current page\n */\n","import PageChunkIterator from './PageChunkIterator.js';\n/** @typedef {import('./utils.js').ISO6391} ISO6391 */\n/** @typedef {import('./PageChunk.js')} PageChunk */\n\n/**\n * @export\n * @typedef {Object} TTSEngineOptions\n * @property {String} server\n * @property {String} bookPath\n * @property {ISO6391} bookLanguage\n * @property {Function} onLoadingStart\n * @property {Function} onLoadingComplete\n * @property {Function} onDone called when the entire book is done\n * @property {function(PageChunk): PromiseLike} beforeChunkPlay will delay the playing of the chunk\n * @property {function(PageChunk): void} afterChunkPlay fires once a chunk has fully finished\n */\n\n/**\n * @typedef {Object} AbstractTTSSound\n * @property {PageChunk} chunk\n * @property {boolean} loaded\n * @property {number} rate\n * @property {SpeechSynthesisVoice} voice\n * @property {(callback: Function) => void} load\n * @property {() => PromiseLike} play\n * @property {() => Promise} stop\n * @property {() => void} pause\n * @property {() => void} resume\n * @property {() => void} finish force the sound to 'finish'\n * @property {number => void} setPlaybackRate\n * @property {SpeechSynthesisVoice => void} setVoice\n **/\n\n/** Handling bookreader's text-to-speech */\nexport default class AbstractTTSEngine {\n /**\n * @protected\n * @param {TTSEngineOptions} options\n */\n constructor(options) {\n this.playing = false;\n this.paused = false;\n this.opts = options;\n /** @type {PageChunkIterator} */\n this._chunkIterator = null;\n /** @type {AbstractTTSSound} */\n this.activeSound = null;\n this.playbackRate = 1;\n /** Events we can bind to */\n this.events = $({});\n /** @type {SpeechSynthesisVoice} */\n this.voice = null;\n // Listen for voice changes (fired by subclasses)\n this.events.on('voiceschanged', this.updateBestVoice);\n this.events.trigger('voiceschanged');\n }\n\n /**\n * @abstract\n * @return {boolean}\n */\n static isSupported() { throw new Error(\"Unimplemented abstract class\"); }\n\n /**\n * @abstract\n * @return {SpeechSynthesisVoice[]}\n */\n getVoices() { throw new Error(\"Unimplemented abstract class\"); }\n\n /** @abstract */\n init() { return null; }\n\n updateBestVoice = () => {\n this.voice = AbstractTTSEngine.getBestBookVoice(this.getVoices(), this.opts.bookLanguage);\n }\n\n /**\n * @param {number} leafIndex\n * @param {number} numLeafs total number of leafs in the current book\n */\n start(leafIndex, numLeafs) {\n this.playing = true;\n this.opts.onLoadingStart();\n\n this._chunkIterator = new PageChunkIterator(numLeafs, leafIndex, {\n server: this.opts.server,\n bookPath: this.opts.bookPath,\n pageBufferSize: 5,\n });\n\n this.step();\n this.events.trigger('start');\n }\n\n stop() {\n if (this.activeSound) this.activeSound.stop();\n this.playing = false;\n this._chunkIterator = null;\n this.activeSound = null;\n this.events.trigger('stop');\n }\n\n /** @public */\n pause() {\n const fireEvent = !this.paused && this.activeSound;\n this.paused = true;\n if (this.activeSound) this.activeSound.pause();\n if (fireEvent) this.events.trigger('pause');\n }\n\n /** @public */\n resume() {\n const fireEvent = this.paused && this.activeSound;\n this.paused = false;\n if (this.activeSound) this.activeSound.resume();\n if (fireEvent) this.events.trigger('resume');\n }\n\n togglePlayPause() {\n if (this.paused) this.resume();\n else this.pause();\n }\n\n /** @public */\n jumpForward() {\n if (this.activeSound) this.activeSound.finish();\n }\n\n /** @public */\n async jumpBackward() {\n await Promise.all([\n this.activeSound.stop(),\n this._chunkIterator.decrement()\n .then(() => this._chunkIterator.decrement())\n ]);\n this.step();\n }\n\n /** @param {string} voiceURI */\n setVoice(voiceURI) {\n // if the user actively selects a voice, don't re-choose best voice anymore\n // MS Edge fires voices changed randomly very often\n this.events.off('voiceschanged', this.updateBestVoice);\n this.voice = this.getVoices().find(voice => voice.voiceURI === voiceURI);\n if (this.activeSound) this.activeSound.setVoice(this.voice);\n }\n\n /** @param {number} newRate */\n setPlaybackRate(newRate) {\n this.playbackRate = newRate;\n if (this.activeSound) this.activeSound.setPlaybackRate(newRate);\n }\n\n /** @private */\n async step() {\n const chunk = await this._chunkIterator.next();\n if (chunk == PageChunkIterator.AT_END) {\n this.stop();\n this.opts.onDone();\n return;\n }\n this.opts.onLoadingStart();\n const sound = this.createSound(chunk);\n sound.chunk = chunk;\n sound.rate = this.playbackRate;\n sound.voice = this.voice;\n sound.load(() => this.opts.onLoadingComplete());\n\n this.opts.onLoadingComplete();\n\n await this.opts.beforeChunkPlay(chunk);\n\n if (!this.playing) return;\n\n const playPromise = await this.playSound(sound)\n .then(()=> this.opts.afterChunkPlay(sound.chunk));\n\n if (this.paused) this.pause();\n await playPromise;\n\n if (this.playing) return this.step();\n }\n\n /**\n * @abstract\n * @param {PageChunk} chunk\n * @return {AbstractTTSSound}\n */\n createSound(chunk) { throw new Error(\"Unimplemented abstract class\"); }\n\n /**\n * @param {AbstractTTSSound} sound\n * @return {PromiseLike} promise called once playing finished\n */\n playSound(sound) {\n this.activeSound = sound;\n if (!this.activeSound.loaded) this.opts.onLoadingStart();\n return this.activeSound.play();\n }\n\n /** Convenience wrapper for {@see AbstractTTSEngine.getBestVoice} */\n getBestVoice() {\n return AbstractTTSEngine.getBestBookVoice(this.getVoices(), this.opts.bookLanguage);\n }\n\n /**\n * @private\n * Find the best voice to use given the available voices, the book language, and the user's\n * languages.\n * @param {SpeechSynthesisVoice[]} voices\n * @param {ISO6391} bookLanguage\n * @param {string[]} userLanguages languages in BCP47 format (e.g. en-US). Ordered by preference.\n * @return {SpeechSynthesisVoice | undefined}\n */\n static getBestBookVoice(voices, bookLanguage, userLanguages = navigator.languages) {\n const bookLangVoices = voices.filter(v => v.lang.startsWith(bookLanguage));\n // navigator.languages browser support isn't great yet, so get just 1 language otherwise\n // Sample navigator.languages: [\"en-CA\", \"fr-CA\", \"fr\", \"en-US\", \"en\", \"de-DE\", \"de\"]\n userLanguages = userLanguages || (navigator.language ? [navigator.language] : []);\n\n // user languages that match the book language\n const matchingUserLangs = userLanguages.filter(lang => lang.startsWith(bookLanguage));\n\n // Try to find voices that intersect these two sets\n return AbstractTTSEngine.getMatchingVoice(matchingUserLangs, bookLangVoices) ||\n // no user languages match the books; let's return the best voice for the book language\n (bookLangVoices.find(v => v.default) || bookLangVoices[0])\n // No voices match the book language? let's find a voice in the user's language\n // and ignore book lang\n || AbstractTTSEngine.getMatchingVoice(userLanguages, voices)\n // C'mon! Ok, just read with whatever we got!\n || (voices.find(v => v.default) || voices[0]);\n }\n\n /**\n * @private\n * Get the best voice that matches one of the BCP47 languages (order by preference)\n * @param {string[]} languages in BCP 47 format (e.g. 'en-US', or 'en'); ordered by preference\n * @param {SpeechSynthesisVoice[]} voices voices to choose from\n * @return {SpeechSynthesisVoice | undefined}\n */\n static getMatchingVoice(languages, voices) {\n for (const lang of languages) {\n // Chrome Android was returning voice languages like `en_US` instead of `en-US`\n const matchingVoices = voices.filter(v => v.lang.replace('_', '-').startsWith(lang));\n if (matchingVoices.length) {\n return matchingVoices.find(v => v.default) || matchingVoices[0];\n }\n }\n }\n}\n","import AbstractTTSEngine from './AbstractTTSEngine.js';\nimport { sleep } from '../../BookReader/utils.js';\n/* global soundManager */\nimport 'soundmanager2';\nimport 'jquery.browser';\n\n/** @typedef {import(\"./AbstractTTSEngine.js\").TTSEngineOptions} TTSEngineOptions */\n/** @typedef {import(\"./AbstractTTSEngine.js\").AbstractTTSSound} AbstractTTSSound */\n\n/**\n * @extends AbstractTTSEngine\n * TTS using Festival endpoint\n **/\nexport default class FestivalTTSEngine extends AbstractTTSEngine {\n /** @override */\n static isSupported() {\n return typeof(soundManager) !== 'undefined' && soundManager.supported();\n }\n\n /** @param {TTSEngineOptions} options */\n constructor(options) {\n super(options);\n // $.browsers is sometimes undefined on some Android browsers :/\n // Likely related to when $.browser was moved to npm\n /** @type {'mp3' | 'ogg'} format of audio to get */\n this.audioFormat = $.browser?.mozilla ? 'ogg' : 'mp3'; //eslint-disable-line no-jquery/no-browser\n }\n\n /** @override */\n getVoices() {\n return [\n { default: true, lang: \"en-US\", localService: false, name: \"Festival - English (US)\", voiceURI: null }\n ];\n }\n\n /** @override */\n init() {\n // setup sound manager\n soundManager.setup({\n debugMode: false,\n // Note, there's a bug in Chrome regarding range requests.\n // Flash is used as a workaround.\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=505707\n preferFlash: true,\n url: '/bookreader/BookReader/soundmanager/swf',\n useHTML5Audio: true,\n //flash 8 version of swf is buggy when calling play() on a sound that is still loading\n flashVersion: 9\n });\n }\n\n /**\n * @override\n * @param {number} leafIndex\n * @param {number} numLeafs total number of leafs in the current book\n */\n start(leafIndex, numLeafs) {\n let promise = null;\n\n // Hack for iOS\n if (navigator.userAgent.match(/mobile/i)) {\n promise = this.iOSCaptureUserIntentHack();\n }\n\n promise = promise || Promise.resolve();\n promise.then(() => super.start(leafIndex, numLeafs));\n }\n\n /** @override */\n createSound(chunk) {\n return new FestivalTTSSound(this.getSoundUrl(chunk.text));\n }\n\n /**\n * @private\n * Get URL for audio that says this text\n * @param {String} dataString the thing to say\n * @return {String} url\n */\n getSoundUrl(dataString) {\n return 'https://' + this.opts.server + '/BookReader/BookReaderGetTTS.php?string='\n + encodeURIComponent(dataString)\n + '&format=.' + this.audioFormat;\n }\n\n /**\n * @private\n * Security restrictions require playback to be triggered\n * by a user click/touch. This intention gets lost in the async calls\n * on iOS, but, for some reason, if we start the audio here, it works.\n * See https://stackoverflow.com/questions/12206631/html5-audio-cant-play-through-javascript-unless-triggered-manually-once\n * @return {PromiseLike}\n */\n async iOSCaptureUserIntentHack() {\n const sound = soundManager.createSound({ url: SILENCE_1MS[this.audioFormat] });\n await new Promise(res => sound.play({onfinish: res}));\n sound.destruct();\n }\n}\n\n/** @extends AbstractTTSSound */\nclass FestivalTTSSound {\n /** @param {string} soundUrl **/\n constructor(soundUrl) {\n this.soundUrl = soundUrl;\n /** @type {SMSound} */\n this.sound = null;\n this.rate = 1;\n /** @type {function} calling this resolves the \"play\" promise */\n this._finishResolver = null;\n }\n\n get loaded() {\n return this.sound && this.sound.loaded;\n }\n\n load(onload) {\n this.sound = soundManager.createSound({\n url: this.soundUrl,\n // API recommended, but only fires once play started on safari\n onload: () => {\n if (this.rate != 1) this.sound.setPlaybackRate(this.rate);\n onload();\n },\n onresume: async () => {\n await sleep(25);\n if (this.rate != 1) this.sound.setPlaybackRate(this.rate);\n }\n });\n return this.sound.load();\n }\n\n async play() {\n await new Promise(res => {\n this._finishResolver = res;\n this.sound.play({ onfinish: res });\n });\n this.sound.destruct();\n }\n\n /** @override */\n stop() {\n this.sound.stop();\n return Promise.resolve();\n }\n\n /** @override */\n pause() { this.sound.pause(); }\n /** @override */\n resume() { this.sound.resume(); }\n /** @override */\n setPlaybackRate(rate) {\n this.rate = rate;\n this.sound.setPlaybackRate(rate);\n }\n\n /** @override */\n finish() {\n this.sound.stop();\n this._finishResolver();\n }\n}\n\n/** Needed to capture the audio context for iOS hack. Generated using Audacity. */\nconst SILENCE_1MS = {\n mp3: 'data:audio/mp3;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAAAeTEFNRTMuOTlyBJwAAAAAAAAAADUgJAaUQQABrgAAAnHIf8sZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQxAADwlwBKGAAACAAAD/AAAAEAAAAH///////////////+UBAMExBTUUzLjk5LjOqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xDEIAPAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq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4wxxhhjjDHGGGOMMcYYW2uttdZaa6211lprrbXWWmutAEC/CgcA/wcbVkc4KRoLLDRkJQAQDgAAGMOYc445Bh2EhinopIQOQgihQ0o5KCWEUEopKXNOSkqlpJRaSplzUlIqJaWWUuogpNRaSi211loHJaXWUmqttdY6CKW01FprrbXYQUgppdZaiy3GUEpKrbXYYow1hlJSaq3F2GKsMaTSUmwtxhhjrKGU1lprMcYYay0ptdZijLXGWmtJqbXWYos11loLAOBucACASLBxhpWks8LR4EJDVgIAIQEABEKMOeeccxBCCCFSijHnoIMQQgghREox5hx0EEIIIYSMMeeggxBCCCGEkDHmHHQQQgghhBA65xyEEEIIoYRSSuccdBBCCCGUUELpIIQQQgihhFJKKR2EEEIooYRSSiklhBBCCaWUUkoppYQQQgihhBJKKaWUEEIIpZRSSimllBJCCCGUUkoppZRSQgihlFBKKaWUUkoIIYRSSimllFJKCSGEUEoppZRSSikhhBJKKaWUUkoppQAAgAMHAIAAI+gko8oibDThwgNQaMhKAIAMAABx2GrrKdbIIMWchJZLhJByEGIuEVKKOUexZUgZxRjVlDGlFFNSa+icYoxRT51jSjHDrJRWSiiRgtJyrLV2zAEAACAIADAQITOBQAEUGMgAgAOEBCkAoLDA0DFcBATkEjIKDArHhHPSaQMAEITIDJGIWAwSE6qBomI6AFhcYMgHgAyNjbSLC+gywAVd3HUghCAEIYjFARSQgIMTbnjiDU+4wQk6RaUOAgAAAAAAAQAeAACSDSAiIpo5jg6PD5AQkRGSEpMTlAAAAAAA4AGADwCAJAWIiIhmjqPD4wMkRGSEpMTkBCUAAAAAAAAAAAAICAgAAAAAAAQAAAAICE9nZ1MABCwAAAAAAAAAFRIAAAIAAAAPBTD1AgEBAAo=',\n};\n","\n/**\n * Checks whether the current browser is a Chrome/Chromium browser\n * Code from https://stackoverflow.com/a/4565120/2317712\n * @param {string} [userAgent]\n * @param {string} [vendor]\n * @return {boolean}\n */\nexport function isChrome(userAgent = navigator.userAgent, vendor = navigator.vendor) {\n return /chrome/i.test(userAgent) && /google inc/i.test(vendor);\n}\n\n/**\n * Checks whether the current browser is firefox\n * @param {string} [userAgent]\n * @return {boolean}\n */\nexport function isFirefox(userAgent = navigator.userAgent) {\n return /firefox/i.test(userAgent);\n}\n\n/**\n * Checks whether the current browser is safari\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Browser_Name\n * @param {string} [userAgent]\n * @return {boolean}\n */\nexport function isSafari(userAgent = navigator.userAgent) {\n return /safari/i.test(userAgent) && !/chrome|chromium/i.test(userAgent);\n}\n","import langs from 'iso-language-codes/js/data.js';\n\n/**\n * Use regex to approximate word count in a string\n * @param {string} text\n * @return {number}\n */\nexport function approximateWordCount(text) {\n const m = text.match(/\\S+/g);\n return m ? m.length : 0;\n}\n\n/**\n * Checks whether the current browser is on android\n * @param {string} [userAgent]\n * @return {boolean}\n */\nexport function isAndroid(userAgent = navigator.userAgent) {\n return /android/i.test(userAgent);\n}\n\n/**\n * @typedef {string} ISO6391\n * Language code in ISO 639-1 format. e.g. en, fr, zh\n **/\n\n/** Each lang is an array, with each index mapping to a different property */\nconst COLUMN_TO_LANG_INDEX = {\n 'Name': 0,\n 'Endonym': 1,\n 'ISO 639-1': 2,\n 'ISO 639-2/T': 3,\n 'ISO 639-2/B': 4\n};\n\n/**\n * @param {string} language in some format\n * @return {ISO6391?}\n */\nexport function toISO6391(language) {\n if (!language) return null;\n language = language.toLowerCase();\n\n return searchForISO6391(language, ['ISO 639-1']) ||\n searchForISO6391(language, ['ISO 639-2/B']) ||\n searchForISO6391(language, ['ISO 639-2/T', 'Endonym', 'Name']);\n}\n\n/**\n * Searches for the given long in the given columns.\n * @param {string} language\n * @param {Array<keyof COLUMN_TO_LANG_INDEX>} columnsToSearch\n * @return {ISO6391?}\n */\nfunction searchForISO6391(language, columnsToSearch) {\n for (let i = 0; i < langs.length; i++) {\n for (let colI = 0; colI < columnsToSearch.length; colI++) {\n const column = columnsToSearch[colI];\n const columnValue = langs[i][COLUMN_TO_LANG_INDEX[column]];\n if (columnValue.split(', ').map(x => x.toLowerCase()).indexOf(language) != -1) {\n return langs[i][COLUMN_TO_LANG_INDEX['ISO 639-1']];\n }\n }\n }\n return null;\n}\n","/* global br */\nimport { isChrome, isFirefox } from '../../util/browserSniffing.js';\nimport { isAndroid } from './utils.js';\nimport { promisifyEvent, sleep } from '../../BookReader/utils.js';\nimport AbstractTTSEngine from './AbstractTTSEngine.js';\n/** @typedef {import(\"./AbstractTTSEngine.js\").PageChunk} PageChunk */\n/** @typedef {import(\"./AbstractTTSEngine.js\").AbstractTTSSound} AbstractTTSSound */\n/** @typedef {import(\"./AbstractTTSEngine.js\").TTSEngineOptions} TTSEngineOptions */\n\n/**\n * @extends AbstractTTSEngine\n * TTS using Web Speech APIs\n **/\nexport default class WebTTSEngine extends AbstractTTSEngine {\n static isSupported() {\n return typeof(window.speechSynthesis) !== 'undefined' && !/samsungbrowser/i.test(navigator.userAgent);\n }\n\n /** @param {TTSEngineOptions} options */\n constructor(options) {\n super(options);\n\n // SAFARI doesn't have addEventListener on speechSynthesis\n if (speechSynthesis.addEventListener) {\n speechSynthesis.addEventListener('voiceschanged', () => this.events.trigger('voiceschanged'));\n }\n }\n\n /** @override */\n start(leafIndex, numLeafs) {\n // Need to run in this function to capture user intent to start playing audio\n if ('mediaSession' in navigator) {\n const audio = new Audio(SILENCE_6S_MP3);\n audio.loop = true;\n\n this.events.on('pause', () => audio.pause());\n this.events.on('resume', () => audio.play());\n // apparently this is what you need to do to make the media session notification go away\n // See https://developers.google.com/web/updates/2017/02/media-session#implementation_notes\n this.events.on('stop', () => audio.src = '');\n audio.play().then(() => {\n navigator.mediaSession.metadata = new MediaMetadata({\n title: br.bookTitle,\n artist: br.options.metadata.filter(m => m.label == 'Author').map(m => m.value)[0],\n // album: 'The Ultimate Collection (Remastered)',\n artwork: [\n { src: br.options.thumbnail, type: 'image/jpg' },\n ]\n });\n\n navigator.mediaSession.setActionHandler('play', () => {\n audio.play();\n this.resume();\n });\n navigator.mediaSession.setActionHandler('pause', () => {\n audio.pause();\n this.pause();\n });\n\n // navigator.mediaSession.setActionHandler('seekbackward', () => this.jumpBackward());\n // navigator.mediaSession.setActionHandler('seekforward', () => this.jumpForward());\n // Some devices only support the previoustrack/nexttrack (e.g. Win10), so show those.\n // Android devices do support the seek actions, but we don't want to show both buttons\n // and have them do the same thing.\n navigator.mediaSession.setActionHandler('previoustrack', () => this.jumpBackward());\n navigator.mediaSession.setActionHandler('nexttrack', () => this.jumpForward());\n });\n }\n\n return super.start(leafIndex, numLeafs);\n }\n\n /** @override */\n getVoices() {\n const voices = speechSynthesis.getVoices();\n if (voices.filter(v => v.default).length != 1) {\n // iOS bug where the default system voice is sometimes\n // missing from the list\n voices.unshift({\n voiceURI: 'bookreader.SystemDefault',\n name: 'System Default',\n // Not necessarily true, but very likely\n lang: navigator.language,\n default: true,\n localService: true,\n });\n }\n return voices;\n }\n\n /** @override */\n createSound(chunk) {\n return new WebTTSSound(chunk.text);\n }\n}\n\n/** @extends AbstractTTSSound */\nexport class WebTTSSound {\n /** @param {string} text **/\n constructor(text) {\n this.text = text;\n this.loaded = false;\n this.paused = false;\n this.started = false;\n /** Whether the audio was stopped with a .stop() call */\n this.stopped = false;\n this.rate = 1;\n\n /** @type {SpeechSynthesisUtterance} */\n this.utterance = null;\n\n /** @type {SpeechSynthesisVoice} */\n this.voice = null;\n\n this._lastEvents = {\n /** @type {SpeechSynthesisEvent} */\n pause: null,\n /** @type {SpeechSynthesisEvent} */\n boundary: null,\n /** @type {SpeechSynthesisEvent} */\n start: null,\n };\n\n /** Store where we are in the text. Only works on some browsers. */\n this._charIndex = 0;\n\n /** @type {Function} resolve function called when playback finished */\n this._finishResolver = null;\n\n /** @type {Promise} promise resolved by _finishResolver */\n this._finishPromise = null;\n }\n\n /** @override **/\n load(onload) {\n this.loaded = false;\n this.started = false;\n\n this.utterance = new SpeechSynthesisUtterance(this.text.slice(this._charIndex));\n // iOS bug where the default system voice is sometimes\n // missing from the list\n if (this.voice?.voiceURI !== 'bookreader.SystemDefault') {\n this.utterance.voice = this.voice;\n }\n // Need to also set lang (for some reason); won't set voice on Chrome@Android otherwise\n if (this.voice) this.utterance.lang = this.voice.lang;\n this.utterance.rate = this.rate;\n\n // Useful for debugging things\n if (location.toString().indexOf('_debugReadAloud=true') != -1) {\n this.utterance.addEventListener('pause', () => console.log('pause'));\n this.utterance.addEventListener('resume', () => console.log('resume'));\n this.utterance.addEventListener('start', () => console.log('start'));\n this.utterance.addEventListener('end', () => console.log('end'));\n this.utterance.addEventListener('error', () => console.log('error'));\n this.utterance.addEventListener('boundary', () => console.log('boundary'));\n this.utterance.addEventListener('mark', () => console.log('mark'));\n this.utterance.addEventListener('finish', () => console.log('finish'));\n }\n\n // Keep track of the speech synthesis events that come in; they have useful info\n // about progress (like charIndex)\n this.utterance.addEventListener('start', ev => this._lastEvents.start = ev);\n this.utterance.addEventListener('boundary', ev => this._lastEvents.boundary = ev);\n this.utterance.addEventListener('pause', ev => this._lastEvents.pause = ev);\n\n // Update our state\n this.utterance.addEventListener('start', () => {\n this.started = true;\n this.stopped = false;\n this.paused = false;\n });\n this.utterance.addEventListener('pause', () => this.paused = true);\n this.utterance.addEventListener('resume', () => this.paused = false);\n this.utterance.addEventListener('end', ev => {\n if (!this.paused && !this.stopped) {\n // Trigger a new event, finish, which only fires when audio fully completed\n this.utterance.dispatchEvent(new CustomEvent('finish', ev));\n }\n });\n this.loaded = true;\n onload && onload();\n }\n\n /**\n * Run whenever properties have changed. Tries to restart in the same spot it\n * left off.\n * @return {Promise<void>}\n */\n async reload() {\n // We'll restore the pause state, so copy it here\n const wasPaused = this.paused;\n // Use recent event to determine where we'll restart from\n // Browser support for this is mixed, but it degrades to restarting the chunk\n // and that's ok\n const recentEvent = this._lastEvents.boundary || this._lastEvents.pause;\n if (recentEvent) {\n this._charIndex = this.text.indexOf(recentEvent.target.text) + recentEvent.charIndex;\n }\n\n // We can't modify the utterance object, so we have to make a new one\n await this.stop();\n this.load();\n // Instead of playing and immediately pausing, we don't start playing. Note\n // this is a requirement because pause doesn't work consistently across\n // browsers.\n if (!wasPaused) this.play();\n }\n\n play() {\n this._finishPromise = this._finishPromise || new Promise(res => this._finishResolver = res);\n this.utterance.addEventListener('finish', this._finishResolver);\n\n // clear the queue\n speechSynthesis.cancel();\n // reset pause state\n speechSynthesis.resume();\n // Speak\n speechSynthesis.speak(this.utterance);\n\n const isLocalVoice = this.utterance.voice && this.utterance.voice.localService;\n if (isChrome() && !isLocalVoice) this._chromePausingBugFix();\n\n return this._finishPromise;\n }\n\n /** @return {Promise} */\n stop() {\n // 'end' won't fire if already stopped\n let endPromise = Promise.resolve();\n if (!this.stopped) {\n endPromise = Promise.race([\n promisifyEvent(this.utterance, 'end'),\n // Safari triggers an error when you call cancel mid-sound\n promisifyEvent(this.utterance, 'error'),\n ]);\n }\n this.stopped = true;\n speechSynthesis.cancel();\n return endPromise;\n }\n\n async finish() {\n await this.stop();\n this.utterance.dispatchEvent(new Event('finish'));\n }\n\n /**\n * @override\n * Will fire a pause event unless already paused\n **/\n async pause() {\n if (this.paused) return;\n\n const pausePromise = promisifyEvent(this.utterance, 'pause');\n speechSynthesis.pause();\n\n // There are a few awful browser cases:\n // 1. Pause works and fires\n // 2. Pause doesn't work and doesn't fire\n // 3. Pause works but doesn't fire\n const pauseMightNotWork = (isFirefox() && isAndroid());\n const pauseMightNotFire = isChrome() || pauseMightNotWork;\n\n if (pauseMightNotFire) {\n // wait for it just in case\n const timeoutPromise = sleep(100).then(() => 'timeout');\n const result = await Promise.race([pausePromise, timeoutPromise]);\n // We got our pause event; nothing to do!\n if (result != 'timeout') return;\n\n this.utterance.dispatchEvent(new CustomEvent('pause', this._lastEvents.start));\n\n // if pause might not work, then we'll stop entirely and restart later\n if (pauseMightNotWork) this.stop();\n }\n }\n\n async resume() {\n if (!this.started) {\n this.play();\n return;\n }\n\n if (!this.paused) return;\n\n // Browser cases:\n // 1. Resume works + fires\n // 2. Resume works + doesn't fire (Chrome Desktop)\n // 3. Resume doesn't work + doesn't fire (Chrome/FF Android)\n const resumeMightNotWork = (isChrome() && isAndroid()) || (isFirefox() && isAndroid());\n const resumeMightNotFire = isChrome() || resumeMightNotWork;\n\n // Try resume\n const resumePromise = promisifyEvent(this.utterance, 'resume');\n speechSynthesis.resume();\n\n if (resumeMightNotFire) {\n const result = await Promise.race([resumePromise, sleep(100).then(() => 'timeout')]);\n\n if (result != 'timeout') return;\n\n this.utterance.dispatchEvent(new CustomEvent('resume', {}));\n if (resumeMightNotWork) {\n await this.reload();\n this.play();\n }\n }\n }\n\n setPlaybackRate(rate) {\n this.rate = rate;\n this.reload();\n }\n\n /** @param {SpeechSynthesisVoice} voice */\n setVoice(voice) {\n this.voice = voice;\n this.reload();\n }\n /**\n * @private\n * Chrome has a bug where it only plays 15 seconds of TTS and then\n * suddenly stops (see https://bugs.chromium.org/p/chromium/issues/detail?id=679437 )\n * We avoid this (as described here: https://bugs.chromium.org/p/chromium/issues/detail?id=679437#c15 )\n * by pausing after 14 seconds and ~instantly resuming.\n */\n async _chromePausingBugFix() {\n const timeoutPromise = sleep(14000).then(() => 'timeout');\n const pausePromise = promisifyEvent(this.utterance, 'pause').then(() => 'paused');\n const endPromise = promisifyEvent(this.utterance, 'end').then(() => 'ended');\n const result = await Promise.race([timeoutPromise, pausePromise, endPromise]);\n if (location.toString().indexOf('_debugReadAloud=true') != -1) {\n console.log(`CHROME-PAUSE-HACK: ${result}`);\n }\n switch (result) {\n case 'ended':\n // audio was stopped/finished; nothing to do\n break;\n case 'paused':\n // audio was paused; wait for resume\n // Chrome won't let you resume the audio if 14s have passed 🤷‍\n // We could do the same as before (but resume+pause instead of pause+resume),\n // but that means we'd _constantly_ be running in the background. So in that\n // case, let's just restart the chunk\n await Promise.race([\n promisifyEvent(this.utterance, 'resume'),\n sleep(14000).then(() => 'timeout'),\n ]);\n result == 'timeout' ? this.reload() : this._chromePausingBugFix();\n break;\n case 'timeout':\n // We hit Chrome's secret cut off time. Pause/resume\n // to be able to keep TTS-ing\n speechSynthesis.pause();\n await sleep(25);\n speechSynthesis.resume();\n this._chromePausingBugFix();\n break;\n }\n }\n}\n\n/**\n * According to https://developers.google.com/web/updates/2017/02/media-session#implementation_notes , it needs to be at least 5 seconds\n * long to allow usage of the media sessions api\n */\nconst SILENCE_6S_MP3 = 'data:audio/mp3;base64,/+MYxAAMEAISSAhElhIpJYzz1vz9mUdlHvJwTP/n3FJesPxB9/8mp0oGaz9+7+T//8oCDhJqOMqLh4o4uhUAUUDaf//3r+///+MYxAoKy2ImKAgEqbfr/t///27/+n3s32/////+b5qMsq7vnXCKh2By3ZcIqyrUYbbRH0fp+ljtf+n2Uo72PHX/03f0df///+MYxBkKUAYmQAhEAL+2l44oKFjZMwJAOJnhguMqokFAqBKl/5f1/+f+3/v////9GT//r+//v+//////b1VvucaRChqnMqsY/+MYxCoLo2IiSAgEpRrgIRVq//p////25nlpVFbQ9kuXtrpt+n//3ZUZNKHVTHdJk3Q6h961DAU8loFlsfTnTZYLLQ1xiIYC/+MYxDYLa2YYAACNFAKKv5swEnqSccBoi//xVP9R/q/370r02////7VpaiWWLrDaF//X8+Rf/6ys2irmURCrI/Lr7///+m1t/+MYxEMKqAI2SAhElh7vNPmHrKdmMPFMimBI5xYQEiIRxh1gk0pKvfo7nezMyH6P67uKW+z/7NusoS/4//STUtCUiwASccAQ/+MYxFMKs2IcIABFEFRhEOUCgACs//l3/6df///+qZf6V9X2t69f/p////+v97UOY7UyyIxZWPa1inCgyCDq//pXpSia2v23/+MYxGMK6AYqSABEAl70RfX2+nu6///v+rfdWCLKMhUBmZhIDqt23LQGBjyNGEjBCnI5JGjRWkU2a8b29z/+n6/9SnN7LUfo/+MYxHILg2IiQAgEUPpX9//96jShqxUCtNiIeCAcmxc3/tn18pTBRmaNzgUvIqropQvPf/Fy99+z9/8/bx43Xn95kr6QHFQp/+MYxH8LG2IcAACNMTZjQ1mIlAyLi1r7PBeeff3WH/rB/r/2/7a/+6/0/0b19F5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7JYQwCIg1/+MYxPMPk1YaQAjNof+3GgQj8XKu+pz/PNeX2//81+BMxLX//nz8/5vXovznf9GZ8kZy//J/t1dPqqsZWQIqK2lF4LBUIAJn/+MYxO8Pq2YdoAlNopA5QImv5P/i4cqmi/y///9DP/mplLdWL/8rZS/qX////m+pfVpWM5jBgJysYxQpTGMYUcygIwYU6qqq/+MYxOsPE14aQAiNoYAwNmLCuoX4szULsxZmoXZiwr/FhX//gIWFSJmtiVCwr3f7P/ioqLCwsLC4qK1MQU1FMy45OS4zVVVV/+MYxOkN614mSAhE31VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOwz4hqAiHo1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOG1oOIAgEqFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxO4L6AVtkAhEAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV';\n","/* global BookReader */\n/**\n * Plugin for Text to Speech in BookReader\n */\nimport FestivalTTSEngine from './FestivalTTSEngine.js';\nimport WebTTSEngine from './WebTTSEngine.js';\nimport { toISO6391, approximateWordCount } from './utils.js';\nimport { en as tooltips } from './tooltip_dict.js';\nimport { renderBoxesInPageContainerLayer } from '../../BookReader/PageContainer.js';\n/** @typedef {import('./PageChunk.js').default} PageChunk */\n/** @typedef {import(\"./AbstractTTSEngine.js\").default} AbstractTTSEngine */\n\n// Default options for TTS\njQuery.extend(BookReader.defaultOptions, {\n server: 'ia600609.us.archive.org',\n bookPath: '',\n enableTtsPlugin: true,\n});\n\n// Extend the constructor to add TTS properties\nBookReader.prototype.setup = (function (super_) {\n return function (options) {\n super_.call(this, options);\n\n if (this.options.enableTtsPlugin) {\n /** @type { {[pageIndex: number]: Array<{ l: number, r: number, t: number, b: number }>} } */\n this._ttsBoxesByIndex = {};\n\n let TTSEngine = WebTTSEngine.isSupported() ? WebTTSEngine :\n FestivalTTSEngine.isSupported() ? FestivalTTSEngine :\n null;\n\n if (/_forceTTSEngine=(festival|web)/.test(location.toString())) {\n const engineName = location.toString().match(/_forceTTSEngine=(festival|web)/)[1];\n TTSEngine = { festival: FestivalTTSEngine, web: WebTTSEngine }[engineName];\n }\n\n if (TTSEngine) {\n /** @type {AbstractTTSEngine} */\n this.ttsEngine = new TTSEngine({\n server: options.server,\n bookPath: options.bookPath,\n bookLanguage: toISO6391(options.bookLanguage),\n onLoadingStart: this.showProgressPopup.bind(this, 'Loading audio...'),\n onLoadingComplete: this.removeProgressPopup.bind(this),\n onDone: this.ttsStop.bind(this),\n beforeChunkPlay: this.ttsBeforeChunkPlay.bind(this),\n afterChunkPlay: this.ttsSendChunkFinishedAnalyticsEvent.bind(this),\n });\n }\n }\n };\n})(BookReader.prototype.setup);\n\nBookReader.prototype.init = (function(super_) {\n return function() {\n if (this.options.enableTtsPlugin) {\n // Bind to events\n\n this.bind(BookReader.eventNames.PostInit, () => {\n this.$('.BRicon.read').click(() => {\n this.ttsToggle();\n return false;\n });\n if (this.ttsEngine) {\n this.ttsEngine.init();\n if (/[?&]_autoReadAloud=show/.test(location.toString())) {\n this.ttsStart(false); // false flag is to initiate read aloud controls\n }\n }\n });\n\n // This is fired when the hash changes by one of the other plugins!\n // i.e. it will fire every time the page changes -_-\n // this.bind(BookReader.eventNames.stop, function(e, br) {\n // this.ttsStop();\n // }.bind(this));\n }\n super_.call(this);\n };\n})(BookReader.prototype.init);\n\n/** @override */\nBookReader.prototype._createPageContainer = (function (super_) {\n return function (index) {\n const pageContainer = super_.call(this, index);\n if (this.options.enableTtsPlugin && pageContainer.page && index in this._ttsBoxesByIndex) {\n const pageIndex = pageContainer.page.index;\n renderBoxesInPageContainerLayer('ttsHiliteLayer', this._ttsBoxesByIndex[pageIndex], pageContainer.page, pageContainer.$container[0]);\n }\n return pageContainer;\n };\n})(BookReader.prototype._createPageContainer);\n\n// Extend buildMobileDrawerElement\nBookReader.prototype.buildMobileDrawerElement = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.options.enableTtsPlugin && this.ttsEngine) {\n $el.find('.BRmobileMenu__moreInfoRow').after($(`\n <li>\n <span>\n <span class=\"DrawerIconWrapper\"><img class=\"DrawerIcon\" src=\"${this.imagesBaseURL}icon_speaker_open.svg\" alt=\"info-speaker\"/></span>\n Read Aloud\n </span>\n <div>\n <span class=\"larger\">Press to toggle read aloud</span>\n <br/>\n <button class=\"BRicon read\"></button>\n </div>\n </li>`));\n }\n return $el;\n };\n})(BookReader.prototype.buildMobileDrawerElement);\n\n// Extend initNavbar\nBookReader.prototype.initNavbar = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.options.enableTtsPlugin && this.ttsEngine) {\n this.refs.$BRReadAloudToolbar = $(`\n <ul class=\"read-aloud\">\n <li>\n <select class=\"playback-speed\" name=\"playback-speed\" title=\"${tooltips.playbackSpeed}\">\n <option value=\"0.25\">0.25x</option>\n <option value=\"0.5\">0.5x</option>\n <option value=\"0.75\">0.75x</option>\n <option value=\"1.0\" selected>1.0x</option>\n <option value=\"1.25\">1.25x</option>\n <option value=\"1.5\">1.5x</option>\n <option value=\"1.75\">1.75x</option>\n <option value=\"2\">2x</option>\n </select>\n </li>\n <li>\n <button type=\"button\" name=\"review\" title=\"${tooltips.review}\">\n <div class=\"icon icon-review\"></div>\n </button>\n </li>\n <li>\n <button type=\"button\" name=\"play\" title=\"${tooltips.play}\">\n <div class=\"icon icon-play\"></div>\n <div class=\"icon icon-pause\"></div>\n </button>\n </li>\n <li>\n <button type=\"button\" name=\"advance\" title=\"${tooltips.advance}\">\n <div class=\"icon icon-advance\"></div>\n </button>\n </li>\n <li>\n <select class=\"playback-voices\" name=\"playback-voice\" style=\"display: none\" title=\"Change read aloud voices\">\n </select>\n </li>\n </ul>\n `);\n\n $el.find('.BRcontrols').prepend(this.refs.$BRReadAloudToolbar);\n\n const renderVoiceOption = (voices) => {\n return voices.map(voice =>\n `<option value=\"${voice.voiceURI}\">${voice.lang} - ${voice.name}</option>`).join('');\n };\n\n const voiceSortOrder = (a,b) => `${a.lang} - ${a.name}`.localeCompare(`${b.lang} - ${b.name}`);\n\n const renderVoicesMenu = (voicesMenu) => {\n voicesMenu.empty();\n const bookLanguage = this.ttsEngine.opts.bookLanguage;\n const bookLanguages = this.ttsEngine.getVoices().filter(v => v.lang.startsWith(bookLanguage)).sort(voiceSortOrder);\n const otherLanguages = this.ttsEngine.getVoices().filter(v => !v.lang.startsWith(bookLanguage)).sort(voiceSortOrder);\n\n if (this.ttsEngine.getVoices().length > 1) {\n voicesMenu.append($(`<optgroup label=\"Book Language (${bookLanguage})\"> ${renderVoiceOption(bookLanguages)} </optgroup>`));\n voicesMenu.append($(`<optgroup label=\"Other Languages\"> ${renderVoiceOption(otherLanguages)} </optgroup>`));\n\n voicesMenu.val(this.ttsEngine.voice.voiceURI);\n voicesMenu.show();\n } else {\n voicesMenu.hide();\n }\n };\n\n const voicesMenu = this.refs.$BRReadAloudToolbar.find('[name=playback-voice]');\n renderVoicesMenu(voicesMenu);\n voicesMenu.on(\"change\", ev => this.ttsEngine.setVoice(voicesMenu.val()));\n this.ttsEngine.events.on('pause resume start', () => this.ttsUpdateState());\n this.ttsEngine.events.on('voiceschanged', () => renderVoicesMenu(voicesMenu));\n this.refs.$BRReadAloudToolbar.find('[name=play]').on(\"click\", this.ttsPlayPause.bind(this));\n this.refs.$BRReadAloudToolbar.find('[name=advance]').on(\"click\", this.ttsJumpForward.bind(this));\n this.refs.$BRReadAloudToolbar.find('[name=review]').on(\"click\", this.ttsJumpBackward.bind(this));\n const $rateSelector = this.refs.$BRReadAloudToolbar.find('select[name=\"playback-speed\"]');\n $rateSelector.on(\"change\", ev => this.ttsEngine.setPlaybackRate(parseFloat($rateSelector.val())));\n $(`<li>\n <button class=\"BRicon read js-tooltip\" title=\"${tooltips.readAloud}\">\n <div class=\"icon icon-read-aloud\"></div>\n <span class=\"tooltip\">${tooltips.readAloud}</span>\n </button>\n </li>`).insertBefore($el.find('.BRcontrols .BRicon.zoom_out').closest('li'));\n }\n return $el;\n };\n})(BookReader.prototype.initNavbar);\n\n// ttsToggle()\n//______________________________________________________________________________\nBookReader.prototype.ttsToggle = function () {\n if (this.autoStop) this.autoStop();\n if (this.ttsEngine.playing) {\n this.ttsStop();\n } else {\n this.ttsStart();\n }\n};\n\n// ttsStart(\n//______________________________________________________________________________\nBookReader.prototype.ttsStart = function (startTTSEngine = true) {\n if (this.constModeThumb == this.mode)\n this.switchMode(this.constMode1up);\n\n this.refs.$BRReadAloudToolbar.addClass('visible');\n this.$('.BRicon.read').addClass('unread active');\n this.ttsSendAnalyticsEvent('Start');\n if (startTTSEngine)\n this.ttsEngine.start(this.currentIndex(), this.book.getNumLeafs());\n};\n\nBookReader.prototype.ttsJumpForward = function () {\n if (this.ttsEngine.paused) {\n this.ttsEngine.resume();\n }\n this.ttsEngine.jumpForward();\n};\n\nBookReader.prototype.ttsJumpBackward = function () {\n if (this.ttsEngine.paused) {\n this.ttsEngine.resume();\n }\n this.ttsEngine.jumpBackward();\n};\n\nBookReader.prototype.ttsUpdateState = function() {\n const isPlaying = !(this.ttsEngine.paused || !this.ttsEngine.playing);\n this.$('.read-aloud [name=play]').toggleClass('playing', isPlaying);\n};\n\nBookReader.prototype.ttsPlayPause = function() {\n if (!this.ttsEngine.playing) {\n this.ttsToggle();\n } else {\n this.ttsEngine.togglePlayPause();\n this.ttsUpdateState(this.ttsEngine.paused);\n }\n};\n\n// ttsStop()\n//______________________________________________________________________________\nBookReader.prototype.ttsStop = function () {\n this.refs.$BRReadAloudToolbar.removeClass('visible');\n this.$('.BRicon.read').removeClass('unread active');\n this.ttsSendAnalyticsEvent('Stop');\n this.ttsEngine.stop();\n this.ttsRemoveHilites();\n this.removeProgressPopup();\n};\n\n/**\n * @param {PageChunk} chunk\n * @return {PromiseLike<void>} returns once the flip is done\n */\nBookReader.prototype.ttsBeforeChunkPlay = async function(chunk) {\n await this.ttsMaybeFlipToIndex(chunk.leafIndex);\n this.ttsHighlightChunk(chunk);\n this.ttsScrollToChunk(chunk);\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsSendChunkFinishedAnalyticsEvent = function(chunk) {\n this.ttsSendAnalyticsEvent('ChunkFinished-Words', approximateWordCount(chunk.text));\n};\n\n/**\n * Flip the page if the provided leaf index is not visible\n * @param {Number} leafIndex\n */\nBookReader.prototype.ttsMaybeFlipToIndex = async function (leafIndex) {\n if (this.constMode2up != this.mode) {\n this.jumpToIndex(leafIndex);\n } else {\n await this._modes.mode2Up.mode2UpLit.jumpToIndex(leafIndex);\n }\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsHighlightChunk = function(chunk) {\n // The poorly-named variable leafIndex\n const pageIndex = chunk.leafIndex;\n\n this.ttsRemoveHilites();\n\n // group by index; currently only possible to have chunks on one page :/\n this._ttsBoxesByIndex = {\n [pageIndex]: chunk.lineRects.map(([l, b, r, t]) => ({l, r, b, t}))\n };\n\n // update any already created pages\n for (const [pageIndexString, boxes] of Object.entries(this._ttsBoxesByIndex)) {\n const pageIndex = parseFloat(pageIndexString);\n const page = this.book.getPage(pageIndex);\n const pageContainers = this.getActivePageContainerElementsForIndex(pageIndex);\n pageContainers.forEach(container => renderBoxesInPageContainerLayer('ttsHiliteLayer', boxes, page, container));\n }\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsScrollToChunk = function(chunk) {\n // It behaves weird if used in thumb mode\n if (this.constModeThumb == this.mode) return;\n\n $(`.pagediv${chunk.leafIndex} .ttsHiliteLayer rect`).last()?.[0]?.scrollIntoView({\n // Only vertically center the highlight if we're in 1up or in full screen. In\n // 2up, if we're not fullscreen, the whole body gets scrolled around to try to\n // center the highlight 🙄 See:\n // https://stackoverflow.com/questions/11039885/scrollintoview-causing-the-whole-page-to-move/11041376\n // Note: nearest doesn't quite work great, because the ReadAloud toolbar is now\n // full-width, and covers up the last line of the highlight.\n block: this.constMode1up == this.mode || this.isFullscreenActive ? 'center' : 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n};\n\n// ttsRemoveHilites()\n//______________________________________________________________________________\nBookReader.prototype.ttsRemoveHilites = function () {\n $(this.getActivePageContainerElements()).find('.ttsHiliteLayer').remove();\n this._ttsBoxesByIndex = {};\n};\n\n/**\n * @private\n * Send an analytics event with an optional value. Also attaches the book's language.\n * @param {string} action\n * @param {number} [value]\n */\nBookReader.prototype.ttsSendAnalyticsEvent = function(action, value) {\n if (this.archiveAnalyticsSendEvent) {\n const extraValues = {};\n const mediaLanguage = this.ttsEngine.opts.bookLanguage;\n if (mediaLanguage) extraValues.mediaLanguage = mediaLanguage;\n this.archiveAnalyticsSendEvent('BRReadAloud', action, value, extraValues);\n }\n};\n","export const en = {\n advance: 'Advance 10 seconds',\n play: 'Play',\n playbackSpeed: 'Playback speed',\n readAloud: 'Read this book aloud',\n review: 'Review 10 seconds',\n};\n\nexport const es = {\n advance: 'Avance 10 segundos',\n play: 'Jugar',\n playbackSpeed: 'Velocidad de reproducción',\n readAloud: 'Lee este libro en voz alta',\n review: 'Revisar 10 segundos',\n};\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar trim = require('../internals/string-trim').trim;\nvar whitespaces = require('../internals/whitespaces');\n\nvar charAt = uncurryThis(''.charAt);\nvar $parseFloat = global.parseFloat;\nvar Symbol = global.Symbol;\nvar ITERATOR = Symbol && Symbol.iterator;\nvar FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity\n // MS Edge 18- broken with boxed symbols\n || (ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); }));\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\nmodule.exports = FORCED ? function parseFloat(string) {\n var trimmedString = trim(toString(string));\n var result = $parseFloat(trimmedString);\n return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;\n} : $parseFloat;\n","var $ = require('../internals/export');\nvar $entries = require('../internals/object-to-array').entries;\n\n// `Object.entries` method\n// https://tc39.es/ecma262/#sec-object.entries\n$({ target: 'Object', stat: true }, {\n entries: function entries(O) {\n return $entries(O);\n }\n});\n","var $ = require('../internals/export');\nvar $parseFloat = require('../internals/number-parse-float');\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\n$({ global: true, forced: parseFloat != $parseFloat }, {\n parseFloat: $parseFloat\n});\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _default = [['Serbian', 'српски језик', 'sr', 'srp', 'srp'], ['Romanian, Moldavian, Moldovan', 'Română', 'ro', 'ron', 'rum'], ['Sichuan Yi, Nuosu', 'ꆈꌠ꒿ Nuosuhxop', 'ii', 'iii', 'iii'], ['Tahitian', 'Reo Tahiti', 'ty', 'tah', 'tah'], ['Tagalog', 'Wikang Tagalog', 'tl', 'tgl', 'tgl'], ['Yiddish', 'ייִדיש', 'yi', 'yid', 'yid'], ['Akan', 'Akan', 'ak', 'aka', 'aka'], ['Malay', 'Bahasa Melayu, بهاس ملايو‎', 'ms', 'msa', 'may'], ['Arabic', 'العربية', 'ar', 'ara', 'ara'], ['Norwegian', 'Norsk', 'no', 'nor', 'nor'], ['Ojibwa', 'ᐊᓂᔑᓈᐯᒧᐎᓐ', 'oj', 'oji', 'oji'], ['Fulah', 'Fulfulde, Pulaar, Pular', 'ff', 'ful', 'ful'], ['Persian', 'فارسی', 'fa', 'fas', 'per'], ['Albanian', 'Shqip', 'sq', 'sqi', 'alb'], ['Aymara', 'aymar aru', 'ay', 'aym', 'aym'], ['Azerbaijani', 'azərbaycan dili', 'az', 'aze', 'aze'], ['Chinese', '中文 (Zhōngwén), 汉语, 漢語', 'zh', 'zho', 'chi'], ['Cree', 'ᓀᐦᐃᔭᐍᐏᐣ', 'cr', 'cre', 'cre'], ['Estonian', 'eesti, eesti keel', 'et', 'est', 'est'], ['Guaraní', 'Avañe\\'ẽ', 'gn', 'grn', 'grn'], ['Inupiaq', 'Iñupiaq, Iñupiatun', 'ik', 'ipk', 'ipk'], ['Inuktitut', 'ᐃᓄᒃᑎᑐᑦ', 'iu', 'iku', 'iku'], ['Kanuri', 'Kanuri', 'kr', 'kau', 'kau'], ['Komi', 'коми кыв', 'kv', 'kom', 'kom'], ['Kongo', 'Kikongo', 'kg', 'kon', 'kon'], ['Kurdish', 'Kurdî, کوردی‎', 'ku', 'kur', 'kur'], ['Latvian', 'latviešu valoda', 'lv', 'lav', 'lav'], ['Malagasy', 'fiteny malagasy', 'mg', 'mlg', 'mlg'], ['Mongolian', 'Монгол хэл', 'mn', 'mon', 'mon'], ['Oromo', 'Afaan Oromoo', 'om', 'orm', 'orm'], ['Pashto, Pushto', 'پښتو', 'ps', 'pus', 'pus'], ['Quechua', 'Runa Simi, Kichwa', 'qu', 'que', 'que'], ['Sardinian', 'sardu', 'sc', 'srd', 'srd'], ['Swahili', 'Kiswahili', 'sw', 'swa', 'swa'], ['Uzbek', 'Oʻzbek, Ўзбек, أۇزبېك‎', 'uz', 'uzb', 'uzb'], ['Zhuang, Chuang', 'Saɯ cueŋƅ, Saw cuengh', 'za', 'zha', 'zha'], ['Bislama', 'Bislama', 'bi', 'bis', 'bis'], ['Norwegian Bokmål', 'Norsk Bokmål', 'nb', 'nob', 'nob'], ['Norwegian Nynorsk', 'Norsk Nynorsk', 'nn', 'nno', 'nno'], ['Indonesian', 'Bahasa Indonesia', 'id', 'ind', 'ind'], ['Twi', 'Twi', 'tw', 'twi', 'twi'], ['Esperanto', 'Esperanto', 'eo', 'epo', 'epo'], ['Interlingua', 'Interlingua', 'ia', 'ina', 'ina'], ['Interlingue', 'Originally called Occidental; then Interlingue after WWII', 'ie', 'ile', 'ile'], ['Ido', 'Ido', 'io', 'ido', 'ido'], ['Volapük', 'Volapük', 'vo', 'vol', 'vol'], ['Bihari languages', 'भोजपुरी', 'bh', 'bih', 'bih'], ['Hebrew (modern)', 'עברית', 'he', 'heb', 'heb'], ['Sanskrit', 'संस्कृतम्', 'sa', 'san', 'san'], ['Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian', 'ѩзыкъ словѣньскъ', 'cu', 'chu', 'chu'], ['Pali', 'पाऴि', 'pi', 'pli', 'pli'], ['Avestan', 'avesta', 'ae', 'ave', 'ave'], ['Latin', 'latine, lingua latina', 'la', 'lat', 'lat'], ['Armenian', 'Հայերեն', 'hy', 'hye', 'arm'], ['Swati', 'SiSwati', 'ss', 'ssw', 'ssw'], ['Tibetan', 'བོད་ཡིག', 'bo', 'bod', 'tib'], ['South Ndebele', 'isiNdebele', 'nr', 'nbl', 'nbl'], ['Slovene', 'Slovenski Jezik, Slovenščina', 'sl', 'slv', 'slv'], ['Oriya', 'ଓଡ଼ିଆ', 'or', 'ori', 'ori'], ['North Ndebele', 'isiNdebele', 'nd', 'nde', 'nde'], ['Nauru', 'Dorerin Naoero', 'na', 'nau', 'nau'], ['Maori', 'te reo Māori', 'mi', 'mri', 'mao'], ['Marathi', 'मराठी', 'mr', 'mar', 'mar'], ['Luba-Katanga', 'Kiluba', 'lu', 'lub', 'lub'], ['Rundi', 'Ikirundi', 'rn', 'run', 'run'], ['Central Khmer', 'ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ', 'km', 'khm', 'khm'], ['Western Frisian', 'Frysk', 'fy', 'fry', 'fry'], ['Bengali', 'বাংলা', 'bn', 'ben', 'ben'], ['Avaric', 'авар мацӀ, магӀарул мацӀ', 'av', 'ava', 'ava'], ['Abkhazian', 'аҧсуа бызшәа, аҧсшәа', 'ab', 'abk', 'abk'], ['Afar', 'Afaraf', 'aa', 'aar', 'aar'], ['Afrikaans', 'Afrikaans', 'af', 'afr', 'afr'], ['Amharic', 'አማርኛ', 'am', 'amh', 'amh'], ['Aragonese', 'aragonés', 'an', 'arg', 'arg'], ['Assamese', 'অসমীয়া', 'as', 'asm', 'asm'], ['Bambara', 'bamanankan', 'bm', 'bam', 'bam'], ['Bashkir', 'башҡорт теле', 'ba', 'bak', 'bak'], ['Basque', 'euskara, euskera', 'eu', 'eus', 'baq'], ['Belarusian', 'беларуская мова', 'be', 'bel', 'bel'], ['Bosnian', 'bosanski jezik', 'bs', 'bos', 'bos'], ['Breton', 'brezhoneg', 'br', 'bre', 'bre'], ['Bulgarian', 'български език', 'bg', 'bul', 'bul'], ['Burmese', 'ဗမာစာ', 'my', 'mya', 'bur'], ['Catalan, Valencian', 'català, valencià', 'ca', 'cat', 'cat'], ['Chamorro', 'Chamoru', 'ch', 'cha', 'cha'], ['Chechen', 'нохчийн мотт', 'ce', 'che', 'che'], ['Chichewa, Chewa, Nyanja', 'chiCheŵa, chinyanja', 'ny', 'nya', 'nya'], ['Chuvash', 'чӑваш чӗлхи', 'cv', 'chv', 'chv'], ['Cornish', 'Kernewek', 'kw', 'cor', 'cor'], ['Corsican', 'corsu, lingua corsa', 'co', 'cos', 'cos'], ['Croatian', 'hrvatski jezik', 'hr', 'hrv', 'hrv'], ['Czech', 'čeština, český jazyk', 'cs', 'ces', 'cze'], ['Danish', 'dansk', 'da', 'dan', 'dan'], ['Divehi, Dhivehi, Maldivian', 'ދިވެހި', 'dv', 'div', 'div'], ['Dutch, Flemish', 'Nederlands, Vlaams', 'nl', 'nld', 'dut'], ['Dzongkha', 'རྫོང་ཁ', 'dz', 'dzo', 'dzo'], ['English', 'English', 'en', 'eng', 'eng'], ['Ewe', 'Eʋegbe', 'ee', 'ewe', 'ewe'], ['Faroese', 'føroyskt', 'fo', 'fao', 'fao'], ['Fijian', 'vosa Vakaviti', 'fj', 'fij', 'fij'], ['Finnish', 'suomi, suomen kieli', 'fi', 'fin', 'fin'], ['French', 'français, langue française', 'fr', 'fra', 'fre'], ['Galician', 'Galego', 'gl', 'glg', 'glg'], ['Georgian', 'ქართული', 'ka', 'kat', 'geo'], ['German', 'Deutsch', 'de', 'deu', 'ger'], ['Greek (modern)', 'ελληνικά', 'el', 'ell', 'gre'], ['Gujarati', 'ગુજરાતી', 'gu', 'guj', 'guj'], ['Haitian, Haitian Creole', 'Kreyòl ayisyen', 'ht', 'hat', 'hat'], ['Hausa', '(Hausa) هَوُسَ', 'ha', 'hau', 'hau'], ['Herero', 'Otjiherero', 'hz', 'her', 'her'], ['Hindi', 'हिन्दी, हिंदी', 'hi', 'hin', 'hin'], ['Hiri Motu', 'Hiri Motu', 'ho', 'hmo', 'hmo'], ['Hungarian', 'magyar', 'hu', 'hun', 'hun'], ['Irish', 'Gaeilge', 'ga', 'gle', 'gle'], ['Igbo', 'Asụsụ Igbo', 'ig', 'ibo', 'ibo'], ['Icelandic', 'Íslenska', 'is', 'isl', 'ice'], ['Italian', 'Italiano', 'it', 'ita', 'ita'], ['Japanese', '日本語 (にほんご)', 'ja', 'jpn', 'jpn'], ['Javanese', 'ꦧꦱꦗꦮ, Basa Jawa', 'jv', 'jav', 'jav'], ['Kalaallisut, Greenlandic', 'kalaallisut, kalaallit oqaasii', 'kl', 'kal', 'kal'], ['Kannada', 'ಕನ್ನಡ', 'kn', 'kan', 'kan'], ['Kashmiri', 'कश्मीरी, كشميري‎', 'ks', 'kas', 'kas'], ['Kazakh', 'қазақ тілі', 'kk', 'kaz', 'kaz'], ['Kikuyu, Gikuyu', 'Gĩkũyũ', 'ki', 'kik', 'kik'], ['Kinyarwanda', 'Ikinyarwanda', 'rw', 'kin', 'kin'], ['Kirghiz, Kyrgyz', 'Кыргызча, Кыргыз тили', 'ky', 'kir', 'kir'], ['Korean', '한국어', 'ko', 'kor', 'kor'], ['Kuanyama, Kwanyama', 'Kuanyama', 'kj', 'kua', 'kua'], ['Luxembourgish, Letzeburgesch', 'Lëtzebuergesch', 'lb', 'ltz', 'ltz'], ['Ganda', 'Luganda', 'lg', 'lug', 'lug'], ['Limburgan, Limburger, Limburgish', 'Limburgs', 'li', 'lim', 'lim'], ['Lingala', 'Lingála', 'ln', 'lin', 'lin'], ['Lao', 'ພາສາລາວ', 'lo', 'lao', 'lao'], ['Lithuanian', 'lietuvių kalba', 'lt', 'lit', 'lit'], ['Manx', 'Gaelg, Gailck', 'gv', 'glv', 'glv'], ['Macedonian', 'македонски јазик', 'mk', 'mkd', 'mac'], ['Malayalam', 'മലയാളം', 'ml', 'mal', 'mal'], ['Maltese', 'Malti', 'mt', 'mlt', 'mlt'], ['Marshallese', 'Kajin M̧ajeļ', 'mh', 'mah', 'mah'], ['Navajo, Navaho', 'Diné bizaad', 'nv', 'nav', 'nav'], ['Nepali', 'नेपाली', 'ne', 'nep', 'nep'], ['Ndonga', 'Owambo', 'ng', 'ndo', 'ndo'], ['Occitan', 'occitan, lenga d\\'òc', 'oc', 'oci', 'oci'], ['Ossetian, Ossetic', 'ирон æвзаг', 'os', 'oss', 'oss'], ['Panjabi, Punjabi', 'ਪੰਜਾਬੀ', 'pa', 'pan', 'pan'], ['Polish', 'język polski, polszczyzna', 'pl', 'pol', 'pol'], ['Portuguese', 'Português', 'pt', 'por', 'por'], ['Romansh', 'Rumantsch Grischun', 'rm', 'roh', 'roh'], ['Russian', 'русский', 'ru', 'rus', 'rus'], ['Sindhi', 'सिन्धी, سنڌي، سندھی‎', 'sd', 'snd', 'snd'], ['Northern Sami', 'Davvisámegiella', 'se', 'sme', 'sme'], ['Samoan', 'gagana fa\\'a Samoa', 'sm', 'smo', 'smo'], ['Sango', 'yângâ tî sängö', 'sg', 'sag', 'sag'], ['Gaelic, Scottish Gaelic', 'Gàidhlig', 'gd', 'gla', 'gla'], ['Shona', 'chiShona', 'sn', 'sna', 'sna'], ['Sinhala, Sinhalese', 'සිංහල', 'si', 'sin', 'sin'], ['Slovak', 'Slovenčina, Slovenský Jazyk', 'sk', 'slk', 'slo'], ['Somali', 'Soomaaliga, af Soomaali', 'so', 'som', 'som'], ['Southern Sotho', 'Sesotho', 'st', 'sot', 'sot'], ['Spanish, Castilian', 'Español', 'es', 'spa', 'spa'], ['Sundanese', 'Basa Sunda', 'su', 'sun', 'sun'], ['Swedish', 'Svenska', 'sv', 'swe', 'swe'], ['Tamil', 'தமிழ்', 'ta', 'tam', 'tam'], ['Telugu', 'తెలుగు', 'te', 'tel', 'tel'], ['Tajik', 'тоҷикӣ, toçikī, تاجیکی‎', 'tg', 'tgk', 'tgk'], ['Thai', 'ไทย', 'th', 'tha', 'tha'], ['Tigrinya', 'ትግርኛ', 'ti', 'tir', 'tir'], ['Turkmen', 'Türkmen, Түркмен', 'tk', 'tuk', 'tuk'], ['Tswana', 'Setswana', 'tn', 'tsn', 'tsn'], ['Tongan (Tonga Islands)', 'Faka Tonga', 'to', 'ton', 'ton'], ['Turkish', 'Türkçe', 'tr', 'tur', 'tur'], ['Tsonga', 'Xitsonga', 'ts', 'tso', 'tso'], ['Tatar', 'татар теле, tatar tele', 'tt', 'tat', 'tat'], ['Uighur, Uyghur', 'ئۇيغۇرچە‎, Uyghurche', 'ug', 'uig', 'uig'], ['Ukrainian', 'Українська', 'uk', 'ukr', 'ukr'], ['Urdu', 'اردو', 'ur', 'urd', 'urd'], ['Venda', 'Tshivenḓa', 've', 'ven', 'ven'], ['Vietnamese', 'Tiếng Việt', 'vi', 'vie', 'vie'], ['Walloon', 'Walon', 'wa', 'wln', 'wln'], ['Welsh', 'Cymraeg', 'cy', 'cym', 'wel'], ['Wolof', 'Wollof', 'wo', 'wol', 'wol'], ['Xhosa', 'isiXhosa', 'xh', 'xho', 'xho'], ['Yoruba', 'Yorùbá', 'yo', 'yor', 'yor'], ['Zulu', 'isiZulu', 'zu', 'zul', 'zul']];\nexports[\"default\"] = _default;","/*!\n * jQuery Browser Plugin 0.1.0\n * https://github.com/gabceb/jquery-browser-plugin\n *\n * Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors\n * http://jquery.org/license\n *\n * Modifications Copyright 2015 Gabriel Cebrian\n * https://github.com/gabceb\n *\n * Released under the MIT license\n *\n * Date: 05-07-2015\n */\n/*global window: false */\n\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['jquery'], function ($) {\n return factory($);\n });\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\n // Node-like environment\n module.exports = factory(require('jquery'));\n } else {\n // Browser globals\n factory(window.jQuery);\n }\n}(function(jQuery) {\n \"use strict\";\n\n function uaMatch( ua ) {\n // If an UA is not provided, default to the current browser UA.\n if ( ua === undefined ) {\n ua = window.navigator.userAgent;\n }\n ua = ua.toLowerCase();\n\n var match = /(edge)\\/([\\w.]+)/.exec( ua ) ||\n /(opr)[\\/]([\\w.]+)/.exec( ua ) ||\n /(chrome)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(iemobile)[\\/]([\\w.]+)/.exec( ua ) ||\n /(version)(applewebkit)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(webkit)[ \\/]([\\w.]+).*(version)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(webkit)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(msie) ([\\w.]+)/.exec( ua ) ||\n ua.indexOf(\"trident\") >= 0 && /(rv)(?::| )([\\w.]+)/.exec( ua ) ||\n ua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec( ua ) ||\n [];\n\n var platform_match = /(ipad)/.exec( ua ) ||\n /(ipod)/.exec( ua ) ||\n /(windows phone)/.exec( ua ) ||\n /(iphone)/.exec( ua ) ||\n /(kindle)/.exec( ua ) ||\n /(silk)/.exec( ua ) ||\n /(android)/.exec( ua ) ||\n /(win)/.exec( ua ) ||\n /(mac)/.exec( ua ) ||\n /(linux)/.exec( ua ) ||\n /(cros)/.exec( ua ) ||\n /(playbook)/.exec( ua ) ||\n /(bb)/.exec( ua ) ||\n /(blackberry)/.exec( ua ) ||\n [];\n\n var browser = {},\n matched = {\n browser: match[ 5 ] || match[ 3 ] || match[ 1 ] || \"\",\n version: match[ 2 ] || match[ 4 ] || \"0\",\n versionNumber: match[ 4 ] || match[ 2 ] || \"0\",\n platform: platform_match[ 0 ] || \"\"\n };\n\n if ( matched.browser ) {\n browser[ matched.browser ] = true;\n browser.version = matched.version;\n browser.versionNumber = parseInt(matched.versionNumber, 10);\n }\n\n if ( matched.platform ) {\n browser[ matched.platform ] = true;\n }\n\n // These are all considered mobile platforms, meaning they run a mobile browser\n if ( browser.android || browser.bb || browser.blackberry || browser.ipad || browser.iphone ||\n browser.ipod || browser.kindle || browser.playbook || browser.silk || browser[ \"windows phone\" ]) {\n browser.mobile = true;\n }\n\n // These are all considered desktop platforms, meaning they run a desktop browser\n if ( browser.cros || browser.mac || browser.linux || browser.win ) {\n browser.desktop = true;\n }\n\n // Chrome, Opera 15+ and Safari are webkit based browsers\n if ( browser.chrome || browser.opr || browser.safari ) {\n browser.webkit = true;\n }\n\n // IE11 has a new token so we will assign it msie to avoid breaking changes\n if ( browser.rv || browser.iemobile) {\n var ie = \"msie\";\n\n matched.browser = ie;\n browser[ie] = true;\n }\n\n // Edge is officially known as Microsoft Edge, so rewrite the key to match\n if ( browser.edge ) {\n delete browser.edge;\n var msedge = \"msedge\";\n\n matched.browser = msedge;\n browser[msedge] = true;\n }\n\n // Blackberry browsers are marked as Safari on BlackBerry\n if ( browser.safari && browser.blackberry ) {\n var blackberry = \"blackberry\";\n\n matched.browser = blackberry;\n browser[blackberry] = true;\n }\n\n // Playbook browsers are marked as Safari on Playbook\n if ( browser.safari && browser.playbook ) {\n var playbook = \"playbook\";\n\n matched.browser = playbook;\n browser[playbook] = true;\n }\n\n // BB10 is a newer OS version of BlackBerry\n if ( browser.bb ) {\n var bb = \"blackberry\";\n\n matched.browser = bb;\n browser[bb] = true;\n }\n\n // Opera 15+ are identified as opr\n if ( browser.opr ) {\n var opera = \"opera\";\n\n matched.browser = opera;\n browser[opera] = true;\n }\n\n // Stock Android browsers are marked as Safari on Android.\n if ( browser.safari && browser.android ) {\n var android = \"android\";\n\n matched.browser = android;\n browser[android] = true;\n }\n\n // Kindle browsers are marked as Safari on Kindle\n if ( browser.safari && browser.kindle ) {\n var kindle = \"kindle\";\n\n matched.browser = kindle;\n browser[kindle] = true;\n }\n\n // Kindle Silk browsers are marked as Safari on Kindle\n if ( browser.safari && browser.silk ) {\n var silk = \"silk\";\n\n matched.browser = silk;\n browser[silk] = true;\n }\n\n // Assign the name and platform variable\n browser.name = matched.browser;\n browser.platform = matched.platform;\n return browser;\n }\n\n // Run the matching process, also assign the function to the returned object\n // for manual, jQuery-free use if desired\n window.jQBrowser = uaMatch( window.navigator.userAgent );\n window.jQBrowser.uaMatch = uaMatch;\n\n // Only assign to jQuery.browser if jQuery is loaded\n if ( jQuery ) {\n jQuery.browser = window.jQBrowser;\n }\n\n return window.jQBrowser;\n}));\n","/** @license\r\n *\r\n * SoundManager 2: JavaScript Sound for the Web\r\n * ----------------------------------------------\r\n * http://schillmania.com/projects/soundmanager2/\r\n *\r\n * Copyright (c) 2007, Scott Schiller. All rights reserved.\r\n * Code provided under the BSD License:\r\n * http://schillmania.com/projects/soundmanager2/license.txt\r\n *\r\n * V2.97a.20170601\r\n */\r\n\r\n/**\r\n * About this file\r\n * -------------------------------------------------------------------------------------\r\n * This is the fully-commented source version of the SoundManager 2 API,\r\n * recommended for use during development and testing.\r\n *\r\n * See soundmanager2-nodebug-jsmin.js for an optimized build (~11KB with gzip.)\r\n * http://schillmania.com/projects/soundmanager2/doc/getstarted/#basic-inclusion\r\n * Alternately, serve this file with gzip for 75% compression savings (~30KB over HTTP.)\r\n *\r\n * You may notice <d> and </d> comments in this source; these are delimiters for\r\n * debug blocks which are removed in the -nodebug builds, further optimizing code size.\r\n *\r\n * Also, as you may note: Whoa, reliable cross-platform/device audio support is hard! ;)\r\n */\r\n\r\n(function SM2(window, _undefined) {\r\n\r\n/* global Audio, document, window, navigator, define, module, SM2_DEFER, opera, setTimeout, setInterval, clearTimeout, sm2Debugger */\r\n\r\n'use strict';\r\n\r\nif (!window || !window.document) {\r\n\r\n // Don't cross the [environment] streams. SM2 expects to be running in a browser, not under node.js etc.\r\n // Additionally, if a browser somehow manages to fail this test, as Egon said: \"It would be bad.\"\r\n\r\n throw new Error('SoundManager requires a browser with window and document objects.');\r\n\r\n}\r\n\r\nvar soundManager = null;\r\n\r\n/**\r\n * The SoundManager constructor.\r\n *\r\n * @constructor\r\n * @param {string} smURL Optional: Path to SWF files\r\n * @param {string} smID Optional: The ID to use for the SWF container element\r\n * @this {SoundManager}\r\n * @return {SoundManager} The new SoundManager instance\r\n */\r\n\r\nfunction SoundManager(smURL, smID) {\r\n\r\n /**\r\n * soundManager configuration options list\r\n * defines top-level configuration properties to be applied to the soundManager instance (eg. soundManager.flashVersion)\r\n * to set these properties, use the setup() method - eg., soundManager.setup({url: '/swf/', flashVersion: 9})\r\n */\r\n\r\n this.setupOptions = {\r\n\r\n url: (smURL || null), // path (directory) where SoundManager 2 SWFs exist, eg., /path/to/swfs/\r\n flashVersion: 8, // flash build to use (8 or 9.) Some API features require 9.\r\n debugMode: true, // enable debugging output (console.log() with HTML fallback)\r\n debugFlash: false, // enable debugging output inside SWF, troubleshoot Flash/browser issues\r\n useConsole: true, // use console.log() if available (otherwise, writes to #soundmanager-debug element)\r\n consoleOnly: true, // if console is being used, do not create/write to #soundmanager-debug\r\n waitForWindowLoad: false, // force SM2 to wait for window.onload() before trying to call soundManager.onload()\r\n bgColor: '#ffffff', // SWF background color. N/A when wmode = 'transparent'\r\n useHighPerformance: false, // position:fixed flash movie can help increase js/flash speed, minimize lag\r\n flashPollingInterval: null, // msec affecting whileplaying/loading callback frequency. If null, default of 50 msec is used.\r\n html5PollingInterval: null, // msec affecting whileplaying() for HTML5 audio, excluding mobile devices. If null, native HTML5 update events are used.\r\n flashLoadTimeout: 1000, // msec to wait for flash movie to load before failing (0 = infinity)\r\n wmode: null, // flash rendering mode - null, 'transparent', or 'opaque' (last two allow z-index to work)\r\n allowScriptAccess: 'always', // for scripting the SWF (object/embed property), 'always' or 'sameDomain'\r\n useFlashBlock: false, // *requires flashblock.css, see demos* - allow recovery from flash blockers. Wait indefinitely and apply timeout CSS to SWF, if applicable.\r\n useHTML5Audio: true, // use HTML5 Audio() where API is supported (most Safari, Chrome versions), Firefox (MP3/MP4 support varies.) Ideally, transparent vs. Flash API where possible.\r\n forceUseGlobalHTML5Audio: false, // if true, a single Audio() object is used for all sounds - and only one can play at a time.\r\n ignoreMobileRestrictions: false, // if true, SM2 will not apply global HTML5 audio rules to mobile UAs. iOS > 7 and WebViews may allow multiple Audio() instances.\r\n html5Test: /^(probably|maybe)$/i, // HTML5 Audio() format support test. Use /^probably$/i; if you want to be more conservative.\r\n preferFlash: false, // overrides useHTML5audio, will use Flash for MP3/MP4/AAC if present. Potential option if HTML5 playback with these formats is quirky.\r\n noSWFCache: false, // if true, appends ?ts={date} to break aggressive SWF caching.\r\n idPrefix: 'sound' // if an id is not provided to createSound(), this prefix is used for generated IDs - 'sound0', 'sound1' etc.\r\n\r\n };\r\n\r\n this.defaultOptions = {\r\n\r\n /**\r\n * the default configuration for sound objects made with createSound() and related methods\r\n * eg., volume, auto-load behaviour and so forth\r\n */\r\n\r\n autoLoad: false, // enable automatic loading (otherwise .load() will be called on demand with .play(), the latter being nicer on bandwidth - if you want to .load yourself, you also can)\r\n autoPlay: false, // enable playing of file as soon as possible (much faster if \"stream\" is true)\r\n from: null, // position to start playback within a sound (msec), default = beginning\r\n loops: 1, // how many times to repeat the sound (position will wrap around to 0, setPosition() will break out of loop when >0)\r\n onid3: null, // callback function for \"ID3 data is added/available\"\r\n onerror: null, // callback function for \"load failed\" (or, playback/network/decode error under HTML5.)\r\n onload: null, // callback function for \"load finished\"\r\n whileloading: null, // callback function for \"download progress update\" (X of Y bytes received)\r\n onplay: null, // callback for \"play\" start\r\n onpause: null, // callback for \"pause\"\r\n onresume: null, // callback for \"resume\" (pause toggle)\r\n whileplaying: null, // callback during play (position update)\r\n onposition: null, // object containing times and function callbacks for positions of interest\r\n onstop: null, // callback for \"user stop\"\r\n onfinish: null, // callback function for \"sound finished playing\"\r\n multiShot: true, // let sounds \"restart\" or layer on top of each other when played multiple times, rather than one-shot/one at a time\r\n multiShotEvents: false, // fire multiple sound events (currently onfinish() only) when multiShot is enabled\r\n position: null, // offset (milliseconds) to seek to within loaded sound data.\r\n pan: 0, // \"pan\" settings, left-to-right, -100 to 100\r\n playbackRate: 1, // rate at which to play the sound (HTML5-only)\r\n stream: true, // allows playing before entire file has loaded (recommended)\r\n to: null, // position to end playback within a sound (msec), default = end\r\n type: null, // MIME-like hint for file pattern / canPlay() tests, eg. audio/mp3\r\n usePolicyFile: false, // enable crossdomain.xml request for audio on remote domains (for ID3/waveform access)\r\n volume: 100 // self-explanatory. 0-100, the latter being the max.\r\n\r\n };\r\n\r\n this.flash9Options = {\r\n\r\n /**\r\n * flash 9-only options,\r\n * merged into defaultOptions if flash 9 is being used\r\n */\r\n\r\n onfailure: null, // callback function for when playing fails (Flash 9, MovieStar + RTMP-only)\r\n isMovieStar: null, // \"MovieStar\" MPEG4 audio mode. Null (default) = auto detect MP4, AAC etc. based on URL. true = force on, ignore URL\r\n usePeakData: false, // enable left/right channel peak (level) data\r\n useWaveformData: false, // enable sound spectrum (raw waveform data) - NOTE: May increase CPU load.\r\n useEQData: false, // enable sound EQ (frequency spectrum data) - NOTE: May increase CPU load.\r\n onbufferchange: null, // callback for \"isBuffering\" property change\r\n ondataerror: null // callback for waveform/eq data access error (flash playing audio in other tabs/domains)\r\n\r\n };\r\n\r\n this.movieStarOptions = {\r\n\r\n /**\r\n * flash 9.0r115+ MPEG4 audio options,\r\n * merged into defaultOptions if flash 9+movieStar mode is enabled\r\n */\r\n\r\n bufferTime: 3, // seconds of data to buffer before playback begins (null = flash default of 0.1 seconds - if AAC playback is gappy, try increasing.)\r\n serverURL: null, // rtmp: FMS or FMIS server to connect to, required when requesting media via RTMP or one of its variants\r\n onconnect: null, // rtmp: callback for connection to flash media server\r\n duration: null // rtmp: song duration (msec)\r\n\r\n };\r\n\r\n this.audioFormats = {\r\n\r\n /**\r\n * determines HTML5 support + flash requirements.\r\n * if no support (via flash and/or HTML5) for a \"required\" format, SM2 will fail to start.\r\n * flash fallback is used for MP3 or MP4 if HTML5 can't play it (or if preferFlash = true)\r\n */\r\n\r\n mp3: {\r\n type: ['audio/mpeg; codecs=\"mp3\"', 'audio/mpeg', 'audio/mp3', 'audio/MPA', 'audio/mpa-robust'],\r\n required: true\r\n },\r\n\r\n mp4: {\r\n related: ['aac', 'm4a', 'm4b'], // additional formats under the MP4 container\r\n type: ['audio/mp4; codecs=\"mp4a.40.2\"', 'audio/aac', 'audio/x-m4a', 'audio/MP4A-LATM', 'audio/mpeg4-generic'],\r\n required: false\r\n },\r\n\r\n ogg: {\r\n type: ['audio/ogg; codecs=vorbis'],\r\n required: false\r\n },\r\n\r\n opus: {\r\n type: ['audio/ogg; codecs=opus', 'audio/opus'],\r\n required: false\r\n },\r\n\r\n wav: {\r\n type: ['audio/wav; codecs=\"1\"', 'audio/wav', 'audio/wave', 'audio/x-wav'],\r\n required: false\r\n },\r\n\r\n flac: {\r\n type: ['audio/flac'],\r\n required: false\r\n }\r\n\r\n };\r\n\r\n // HTML attributes (id + class names) for the SWF container\r\n\r\n this.movieID = 'sm2-container';\r\n this.id = (smID || 'sm2movie');\r\n\r\n this.debugID = 'soundmanager-debug';\r\n this.debugURLParam = /([#?&])debug=1/i;\r\n\r\n // dynamic attributes\r\n\r\n this.versionNumber = 'V2.97a.20170601';\r\n this.version = null;\r\n this.movieURL = null;\r\n this.altURL = null;\r\n this.swfLoaded = false;\r\n this.enabled = false;\r\n this.oMC = null;\r\n this.sounds = {};\r\n this.soundIDs = [];\r\n this.muted = false;\r\n this.didFlashBlock = false;\r\n this.filePattern = null;\r\n\r\n this.filePatterns = {\r\n flash8: /\\.mp3(\\?.*)?$/i,\r\n flash9: /\\.mp3(\\?.*)?$/i\r\n };\r\n\r\n // support indicators, set at init\r\n\r\n this.features = {\r\n buffering: false,\r\n peakData: false,\r\n waveformData: false,\r\n eqData: false,\r\n movieStar: false\r\n };\r\n\r\n // flash sandbox info, used primarily in troubleshooting\r\n\r\n this.sandbox = {\r\n // <d>\r\n type: null,\r\n types: {\r\n remote: 'remote (domain-based) rules',\r\n localWithFile: 'local with file access (no internet access)',\r\n localWithNetwork: 'local with network (internet access only, no local access)',\r\n localTrusted: 'local, trusted (local+internet access)'\r\n },\r\n description: null,\r\n noRemote: null,\r\n noLocal: null\r\n // </d>\r\n };\r\n\r\n /**\r\n * format support (html5/flash)\r\n * stores canPlayType() results based on audioFormats.\r\n * eg. { mp3: boolean, mp4: boolean }\r\n * treat as read-only.\r\n */\r\n\r\n this.html5 = {\r\n usingFlash: null // set if/when flash fallback is needed\r\n };\r\n\r\n // file type support hash\r\n this.flash = {};\r\n\r\n // determined at init time\r\n this.html5Only = false;\r\n\r\n // used for special cases (eg. iPad/iPhone/palm OS?)\r\n this.ignoreFlash = false;\r\n\r\n /**\r\n * a few private internals (OK, a lot. :D)\r\n */\r\n\r\n var SMSound,\r\n sm2 = this, globalHTML5Audio = null, flash = null, sm = 'soundManager', smc = sm + ': ', h5 = 'HTML5::', id, ua = navigator.userAgent, wl = window.location.href.toString(), doc = document, doNothing, setProperties, init, fV, on_queue = [], debugOpen = true, debugTS, didAppend = false, appendSuccess = false, didInit = false, disabled = false, windowLoaded = false, _wDS, wdCount = 0, initComplete, mixin, assign, extraOptions, addOnEvent, processOnEvents, initUserOnload, delayWaitForEI, waitForEI, rebootIntoHTML5, setVersionInfo, handleFocus, strings, initMovie, domContentLoaded, winOnLoad, didDCLoaded, getDocument, createMovie, catchError, setPolling, initDebug, debugLevels = ['log', 'info', 'warn', 'error'], defaultFlashVersion = 8, disableObject, failSafely, normalizeMovieURL, oRemoved = null, oRemovedHTML = null, str, flashBlockHandler, getSWFCSS, swfCSS, toggleDebug, loopFix, policyFix, complain, idCheck, waitingForEI = false, initPending = false, startTimer, stopTimer, timerExecute, h5TimerCount = 0, h5IntervalTimer = null, parseURL, messages = [],\r\n canIgnoreFlash, needsFlash = null, featureCheck, html5OK, html5CanPlay, html5ErrorCodes, html5Ext, html5Unload, domContentLoadedIE, testHTML5, event, slice = Array.prototype.slice, useGlobalHTML5Audio = false, lastGlobalHTML5URL, hasFlash, detectFlash, badSafariFix, html5_events, showSupport, flushMessages, wrapCallback, idCounter = 0, didSetup, msecScale = 1000,\r\n is_iDevice = ua.match(/(ipad|iphone|ipod)/i), isAndroid = ua.match(/android/i), isIE = ua.match(/msie|trident/i),\r\n isWebkit = ua.match(/webkit/i),\r\n isSafari = (ua.match(/safari/i) && !ua.match(/chrome/i)),\r\n isOpera = (ua.match(/opera/i)),\r\n mobileHTML5 = (ua.match(/(mobile|pre\\/|xoom)/i) || is_iDevice || isAndroid),\r\n isBadSafari = (!wl.match(/usehtml5audio/i) && !wl.match(/sm2-ignorebadua/i) && isSafari && !ua.match(/silk/i) && ua.match(/OS\\sX\\s10_6_([3-7])/i)), // Safari 4 and 5 (excluding Kindle Fire, \"Silk\") occasionally fail to load/play HTML5 audio on Snow Leopard 10.6.3 through 10.6.7 due to bug(s) in QuickTime X and/or other underlying frameworks. :/ Confirmed bug. https://bugs.webkit.org/show_bug.cgi?id=32159\r\n hasConsole = (window.console !== _undefined && console.log !== _undefined),\r\n isFocused = (doc.hasFocus !== _undefined ? doc.hasFocus() : null),\r\n tryInitOnFocus = (isSafari && (doc.hasFocus === _undefined || !doc.hasFocus())),\r\n okToDisable = !tryInitOnFocus,\r\n flashMIME = /(mp3|mp4|mpa|m4a|m4b)/i,\r\n emptyURL = 'about:blank', // safe URL to unload, or load nothing from (flash 8 + most HTML5 UAs)\r\n emptyWAV = 'data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==', // tiny WAV for HTML5 unloading\r\n overHTTP = (doc.location ? doc.location.protocol.match(/http/i) : null),\r\n http = (!overHTTP ? '//' : ''),\r\n // mp3, mp4, aac etc.\r\n netStreamMimeTypes = /^\\s*audio\\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\\s*(?:$|;)/i,\r\n // Flash v9.0r115+ \"moviestar\" formats\r\n netStreamTypes = ['mpeg4', 'aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'm4b', 'mp4v', '3gp', '3g2'],\r\n netStreamPattern = new RegExp('\\\\.(' + netStreamTypes.join('|') + ')(\\\\?.*)?$', 'i');\r\n\r\n this.mimePattern = /^\\s*audio\\/(?:x-)?(?:mp(?:eg|3))\\s*(?:$|;)/i; // default mp3 set\r\n\r\n // use altURL if not \"online\"\r\n this.useAltURL = !overHTTP;\r\n\r\n swfCSS = {\r\n swfBox: 'sm2-object-box',\r\n swfDefault: 'movieContainer',\r\n swfError: 'swf_error', // SWF loaded, but SM2 couldn't start (other error)\r\n swfTimedout: 'swf_timedout',\r\n swfLoaded: 'swf_loaded',\r\n swfUnblocked: 'swf_unblocked', // or loaded OK\r\n sm2Debug: 'sm2_debug',\r\n highPerf: 'high_performance',\r\n flashDebug: 'flash_debug'\r\n };\r\n\r\n /**\r\n * HTML5 error codes, per W3C\r\n * Error code 1, MEDIA_ERR_ABORTED: Client aborted download at user's request.\r\n * Error code 2, MEDIA_ERR_NETWORK: A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable.\r\n * Error code 3, MEDIA_ERR_DECODE: An error of some description occurred while decoding the media resource, after the resource was established to be usable.\r\n * Error code 4, MEDIA_ERR_SRC_NOT_SUPPORTED: Media (audio file) not supported (\"not usable.\")\r\n * Reference: https://html.spec.whatwg.org/multipage/embedded-content.html#error-codes\r\n */\r\n html5ErrorCodes = [\r\n null,\r\n 'MEDIA_ERR_ABORTED',\r\n 'MEDIA_ERR_NETWORK',\r\n 'MEDIA_ERR_DECODE',\r\n 'MEDIA_ERR_SRC_NOT_SUPPORTED'\r\n ];\r\n\r\n /**\r\n * basic HTML5 Audio() support test\r\n * try...catch because of IE 9 \"not implemented\" nonsense\r\n * https://github.com/Modernizr/Modernizr/issues/224\r\n */\r\n\r\n this.hasHTML5 = (function() {\r\n try {\r\n // new Audio(null) for stupid Opera 9.64 case, which throws not_enough_arguments exception otherwise.\r\n return (Audio !== _undefined && (isOpera && opera !== _undefined && opera.version() < 10 ? new Audio(null) : new Audio()).canPlayType !== _undefined);\r\n } catch(e) {\r\n return false;\r\n }\r\n }());\r\n\r\n /**\r\n * Public SoundManager API\r\n * -----------------------\r\n */\r\n\r\n /**\r\n * Configures top-level soundManager properties.\r\n *\r\n * @param {object} options Option parameters, eg. { flashVersion: 9, url: '/path/to/swfs/' }\r\n * onready and ontimeout are also accepted parameters. call soundManager.setup() to see the full list.\r\n */\r\n\r\n this.setup = function(options) {\r\n\r\n var noURL = (!sm2.url);\r\n\r\n // warn if flash options have already been applied\r\n\r\n if (options !== _undefined && didInit && needsFlash && sm2.ok() && (options.flashVersion !== _undefined || options.url !== _undefined || options.html5Test !== _undefined)) {\r\n complain(str('setupLate'));\r\n }\r\n\r\n // TODO: defer: true?\r\n\r\n assign(options);\r\n\r\n if (!useGlobalHTML5Audio) {\r\n\r\n if (mobileHTML5) {\r\n\r\n // force the singleton HTML5 pattern on mobile, by default.\r\n if (!sm2.setupOptions.ignoreMobileRestrictions || sm2.setupOptions.forceUseGlobalHTML5Audio) {\r\n messages.push(strings.globalHTML5);\r\n useGlobalHTML5Audio = true;\r\n }\r\n\r\n } else if (sm2.setupOptions.forceUseGlobalHTML5Audio) {\r\n\r\n // only apply singleton HTML5 on desktop if forced.\r\n messages.push(strings.globalHTML5);\r\n useGlobalHTML5Audio = true;\r\n\r\n }\r\n\r\n }\r\n\r\n if (!didSetup && mobileHTML5) {\r\n\r\n if (sm2.setupOptions.ignoreMobileRestrictions) {\r\n\r\n messages.push(strings.ignoreMobile);\r\n\r\n } else {\r\n\r\n // prefer HTML5 for mobile + tablet-like devices, probably more reliable vs. flash at this point.\r\n\r\n // <d>\r\n if (!sm2.setupOptions.useHTML5Audio || sm2.setupOptions.preferFlash) {\r\n // notify that defaults are being changed.\r\n sm2._wD(strings.mobileUA);\r\n }\r\n // </d>\r\n\r\n sm2.setupOptions.useHTML5Audio = true;\r\n sm2.setupOptions.preferFlash = false;\r\n\r\n if (is_iDevice) {\r\n\r\n // no flash here.\r\n sm2.ignoreFlash = true;\r\n\r\n } else if ((isAndroid && !ua.match(/android\\s2\\.3/i)) || !isAndroid) {\r\n\r\n /**\r\n * Android devices tend to work better with a single audio instance, specifically for chained playback of sounds in sequence.\r\n * Common use case: exiting sound onfinish() -> createSound() -> play()\r\n * Presuming similar restrictions for other mobile, non-Android, non-iOS devices.\r\n */\r\n\r\n // <d>\r\n sm2._wD(strings.globalHTML5);\r\n // </d>\r\n\r\n useGlobalHTML5Audio = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // special case 1: \"Late setup\". SM2 loaded normally, but user didn't assign flash URL eg., setup({url:...}) before SM2 init. Treat as delayed init.\r\n\r\n if (options) {\r\n\r\n if (noURL && didDCLoaded && options.url !== _undefined) {\r\n sm2.beginDelayedInit();\r\n }\r\n\r\n // special case 2: If lazy-loading SM2 (DOMContentLoaded has already happened) and user calls setup() with url: parameter, try to init ASAP.\r\n\r\n if (!didDCLoaded && options.url !== _undefined && doc.readyState === 'complete') {\r\n setTimeout(domContentLoaded, 1);\r\n }\r\n\r\n }\r\n\r\n didSetup = true;\r\n\r\n return sm2;\r\n\r\n };\r\n\r\n this.ok = function() {\r\n\r\n return (needsFlash ? (didInit && !disabled) : (sm2.useHTML5Audio && sm2.hasHTML5));\r\n\r\n };\r\n\r\n this.supported = this.ok; // legacy\r\n\r\n this.getMovie = function(movie_id) {\r\n\r\n // safety net: some old browsers differ on SWF references, possibly related to ExternalInterface / flash version\r\n return id(movie_id) || doc[movie_id] || window[movie_id];\r\n\r\n };\r\n\r\n /**\r\n * Creates a SMSound sound object instance. Can also be overloaded, e.g., createSound('mySound', '/some.mp3');\r\n *\r\n * @param {object} oOptions Sound options (at minimum, url parameter is required.)\r\n * @return {object} SMSound The new SMSound object.\r\n */\r\n\r\n this.createSound = function(oOptions, _url) {\r\n\r\n var cs, cs_string, options, oSound = null;\r\n\r\n // <d>\r\n cs = sm + '.createSound(): ';\r\n cs_string = cs + str(!didInit ? 'notReady' : 'notOK');\r\n // </d>\r\n\r\n if (!didInit || !sm2.ok()) {\r\n complain(cs_string);\r\n return false;\r\n }\r\n\r\n if (_url !== _undefined) {\r\n // function overloading in JS! :) ... assume simple createSound(id, url) use case.\r\n oOptions = {\r\n id: oOptions,\r\n url: _url\r\n };\r\n }\r\n\r\n // inherit from defaultOptions\r\n options = mixin(oOptions);\r\n\r\n options.url = parseURL(options.url);\r\n\r\n // generate an id, if needed.\r\n if (options.id === _undefined) {\r\n options.id = sm2.setupOptions.idPrefix + (idCounter++);\r\n }\r\n\r\n // <d>\r\n if (options.id.toString().charAt(0).match(/^[0-9]$/)) {\r\n sm2._wD(cs + str('badID', options.id), 2);\r\n }\r\n\r\n sm2._wD(cs + options.id + (options.url ? ' (' + options.url + ')' : ''), 1);\r\n // </d>\r\n\r\n if (idCheck(options.id, true)) {\r\n sm2._wD(cs + options.id + ' exists', 1);\r\n return sm2.sounds[options.id];\r\n }\r\n\r\n function make() {\r\n\r\n options = loopFix(options);\r\n sm2.sounds[options.id] = new SMSound(options);\r\n sm2.soundIDs.push(options.id);\r\n return sm2.sounds[options.id];\r\n\r\n }\r\n\r\n if (html5OK(options)) {\r\n\r\n oSound = make();\r\n // <d>\r\n if (!sm2.html5Only) {\r\n sm2._wD(options.id + ': Using HTML5');\r\n }\r\n // </d>\r\n oSound._setup_html5(options);\r\n\r\n } else {\r\n\r\n if (sm2.html5Only) {\r\n sm2._wD(options.id + ': No HTML5 support for this sound, and no Flash. Exiting.');\r\n return make();\r\n }\r\n\r\n // TODO: Move HTML5/flash checks into generic URL parsing/handling function.\r\n\r\n if (sm2.html5.usingFlash && options.url && options.url.match(/data:/i)) {\r\n // data: URIs not supported by Flash, either.\r\n sm2._wD(options.id + ': data: URIs not supported via Flash. Exiting.');\r\n return make();\r\n }\r\n\r\n if (fV > 8) {\r\n if (options.isMovieStar === null) {\r\n // attempt to detect MPEG-4 formats\r\n options.isMovieStar = !!(options.serverURL || (options.type ? options.type.match(netStreamMimeTypes) : false) || (options.url && options.url.match(netStreamPattern)));\r\n }\r\n // <d>\r\n if (options.isMovieStar) {\r\n sm2._wD(cs + 'using MovieStar handling');\r\n if (options.loops > 1) {\r\n _wDS('noNSLoop');\r\n }\r\n }\r\n // </d>\r\n }\r\n\r\n options = policyFix(options, cs);\r\n oSound = make();\r\n\r\n if (fV === 8) {\r\n flash._createSound(options.id, options.loops || 1, options.usePolicyFile);\r\n } else {\r\n flash._createSound(options.id, options.url, options.usePeakData, options.useWaveformData, options.useEQData, options.isMovieStar, (options.isMovieStar ? options.bufferTime : false), options.loops || 1, options.serverURL, options.duration || null, options.autoPlay, true, options.autoLoad, options.usePolicyFile);\r\n if (!options.serverURL) {\r\n // We are connected immediately\r\n oSound.connected = true;\r\n if (options.onconnect) {\r\n options.onconnect.apply(oSound);\r\n }\r\n }\r\n }\r\n\r\n if (!options.serverURL && (options.autoLoad || options.autoPlay)) {\r\n // call load for non-rtmp streams\r\n oSound.load(options);\r\n }\r\n\r\n }\r\n\r\n // rtmp will play in onconnect\r\n if (!options.serverURL && options.autoPlay) {\r\n oSound.play();\r\n }\r\n\r\n return oSound;\r\n\r\n };\r\n\r\n /**\r\n * Destroys a SMSound sound object instance.\r\n *\r\n * @param {string} sID The ID of the sound to destroy\r\n */\r\n\r\n this.destroySound = function(sID, _bFromSound) {\r\n\r\n // explicitly destroy a sound before normal page unload, etc.\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n var oS = sm2.sounds[sID], i;\r\n\r\n oS.stop();\r\n\r\n // Disable all callbacks after stop(), when the sound is being destroyed\r\n oS._iO = {};\r\n\r\n oS.unload();\r\n\r\n for (i = 0; i < sm2.soundIDs.length; i++) {\r\n if (sm2.soundIDs[i] === sID) {\r\n sm2.soundIDs.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n if (!_bFromSound) {\r\n // ignore if being called from SMSound instance\r\n oS.destruct(true);\r\n }\r\n\r\n oS = null;\r\n delete sm2.sounds[sID];\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Calls the load() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {object} oOptions Optional: Sound options\r\n */\r\n\r\n this.load = function(sID, oOptions) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].load(oOptions);\r\n\r\n };\r\n\r\n /**\r\n * Calls the unload() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n */\r\n\r\n this.unload = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].unload();\r\n\r\n };\r\n\r\n /**\r\n * Calls the onPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod The relevant callback to fire\r\n * @param {object} oScope Optional: The scope to apply the callback to\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.onPosition = function(sID, nPosition, oMethod, oScope) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].onposition(nPosition, oMethod, oScope);\r\n\r\n };\r\n\r\n // legacy/backwards-compability: lower-case method name\r\n this.onposition = this.onPosition;\r\n\r\n /**\r\n * Calls the clearOnPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod Optional: The relevant callback to fire\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.clearOnPosition = function(sID, nPosition, oMethod) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].clearOnPosition(nPosition, oMethod);\r\n\r\n };\r\n\r\n /**\r\n * Calls the play() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {object} oOptions Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.play = function(sID, oOptions) {\r\n\r\n var result = null,\r\n // legacy function-overloading use case: play('mySound', '/path/to/some.mp3');\r\n overloaded = (oOptions && !(oOptions instanceof Object));\r\n\r\n if (!didInit || !sm2.ok()) {\r\n complain(sm + '.play(): ' + str(!didInit ? 'notReady' : 'notOK'));\r\n return false;\r\n }\r\n\r\n if (!idCheck(sID, overloaded)) {\r\n\r\n // no sound found for the given ID. Bail.\r\n if (!overloaded) return false;\r\n\r\n if (overloaded) {\r\n oOptions = {\r\n url: oOptions\r\n };\r\n }\r\n\r\n if (oOptions && oOptions.url) {\r\n // overloading use case, create+play: .play('someID', {url:'/path/to.mp3'});\r\n sm2._wD(sm + '.play(): Attempting to create \"' + sID + '\"', 1);\r\n oOptions.id = sID;\r\n result = sm2.createSound(oOptions).play();\r\n }\r\n\r\n } else if (overloaded) {\r\n\r\n // existing sound object case\r\n oOptions = {\r\n url: oOptions\r\n };\r\n\r\n }\r\n\r\n if (result === null) {\r\n // default case\r\n result = sm2.sounds[sID].play(oOptions);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n // just for convenience\r\n this.start = this.play;\r\n\r\n /**\r\n * Calls the setPlaybackRate() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPlaybackRate = function(sID, rate, allowOverride) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPlaybackRate(rate, allowOverride);\r\n\r\n };\r\n\r\n /**\r\n * Calls the setPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nMsecOffset Position (milliseconds)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPosition = function(sID, nMsecOffset) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPosition(nMsecOffset);\r\n\r\n };\r\n\r\n /**\r\n * Calls the stop() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.stop = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.stop(' + sID + ')', 1);\r\n\r\n return sm2.sounds[sID].stop();\r\n\r\n };\r\n\r\n /**\r\n * Stops all currently-playing sounds.\r\n */\r\n\r\n this.stopAll = function() {\r\n\r\n var oSound;\r\n sm2._wD(sm + '.stopAll()', 1);\r\n\r\n for (oSound in sm2.sounds) {\r\n if (sm2.sounds.hasOwnProperty(oSound)) {\r\n // apply only to sound objects\r\n sm2.sounds[oSound].stop();\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the pause() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.pause = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].pause();\r\n\r\n };\r\n\r\n /**\r\n * Pauses all currently-playing sounds.\r\n */\r\n\r\n this.pauseAll = function() {\r\n\r\n var i;\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].pause();\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the resume() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.resume = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].resume();\r\n\r\n };\r\n\r\n /**\r\n * Resumes all currently-paused sounds.\r\n */\r\n\r\n this.resumeAll = function() {\r\n\r\n var i;\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].resume();\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the togglePause() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.togglePause = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].togglePause();\r\n\r\n };\r\n\r\n /**\r\n * Calls the setPan() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPan The pan value (-100 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPan = function(sID, nPan) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPan(nPan);\r\n\r\n };\r\n\r\n /**\r\n * Calls the setVolume() method of a SMSound object by ID\r\n * Overloaded case: pass only volume argument eg., setVolume(50) to apply to all sounds.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nVol The volume value (0 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setVolume = function(sID, nVol) {\r\n\r\n // setVolume(50) function overloading case - apply to all sounds\r\n\r\n var i, j;\r\n\r\n if (sID !== _undefined && !isNaN(sID) && nVol === _undefined) {\r\n for (i = 0, j = sm2.soundIDs.length; i < j; i++) {\r\n sm2.sounds[sm2.soundIDs[i]].setVolume(sID);\r\n }\r\n return false;\r\n }\r\n\r\n // setVolume('mySound', 50) case\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setVolume(nVol);\r\n\r\n };\r\n\r\n /**\r\n * Calls the mute() method of either a single SMSound object by ID, or all sound objects.\r\n *\r\n * @param {string} sID Optional: The ID of the sound (if omitted, all sounds will be used.)\r\n */\r\n\r\n this.mute = function(sID) {\r\n\r\n var i = 0;\r\n\r\n if (sID instanceof String) {\r\n sID = null;\r\n }\r\n\r\n if (!sID) {\r\n\r\n sm2._wD(sm + '.mute(): Muting all sounds');\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].mute();\r\n }\r\n sm2.muted = true;\r\n\r\n } else {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.mute(): Muting \"' + sID + '\"');\r\n return sm2.sounds[sID].mute();\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Mutes all sounds.\r\n */\r\n\r\n this.muteAll = function() {\r\n\r\n sm2.mute();\r\n\r\n };\r\n\r\n /**\r\n * Calls the unmute() method of either a single SMSound object by ID, or all sound objects.\r\n *\r\n * @param {string} sID Optional: The ID of the sound (if omitted, all sounds will be used.)\r\n */\r\n\r\n this.unmute = function(sID) {\r\n\r\n var i;\r\n\r\n if (sID instanceof String) {\r\n sID = null;\r\n }\r\n\r\n if (!sID) {\r\n\r\n sm2._wD(sm + '.unmute(): Unmuting all sounds');\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].unmute();\r\n }\r\n sm2.muted = false;\r\n\r\n } else {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.unmute(): Unmuting \"' + sID + '\"');\r\n\r\n return sm2.sounds[sID].unmute();\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Unmutes all sounds.\r\n */\r\n\r\n this.unmuteAll = function() {\r\n\r\n sm2.unmute();\r\n\r\n };\r\n\r\n /**\r\n * Calls the toggleMute() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.toggleMute = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].toggleMute();\r\n\r\n };\r\n\r\n /**\r\n * Retrieves the memory used by the flash plugin.\r\n *\r\n * @return {number} The amount of memory in use\r\n */\r\n\r\n this.getMemoryUse = function() {\r\n\r\n // flash-only\r\n var ram = 0;\r\n\r\n if (flash && fV !== 8) {\r\n ram = parseInt(flash._getMemoryUse(), 10);\r\n }\r\n\r\n return ram;\r\n\r\n };\r\n\r\n /**\r\n * Undocumented: NOPs soundManager and all SMSound objects.\r\n */\r\n\r\n this.disable = function(bNoDisable) {\r\n\r\n // destroy all functions\r\n var i;\r\n\r\n if (bNoDisable === _undefined) {\r\n bNoDisable = false;\r\n }\r\n\r\n // already disabled?\r\n if (disabled) return false;\r\n\r\n disabled = true;\r\n\r\n _wDS('shutdown', 1);\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n disableObject(sm2.sounds[sm2.soundIDs[i]]);\r\n }\r\n\r\n disableObject(sm2);\r\n\r\n // fire \"complete\", despite fail\r\n initComplete(bNoDisable);\r\n\r\n event.remove(window, 'load', initUserOnload);\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of a MIME type, eg. 'audio/mp3'.\r\n */\r\n\r\n this.canPlayMIME = function(sMIME) {\r\n\r\n var result;\r\n\r\n if (sm2.hasHTML5) {\r\n result = html5CanPlay({\r\n type: sMIME\r\n });\r\n }\r\n\r\n if (!result && needsFlash) {\r\n // if flash 9, test netStream (movieStar) types as well.\r\n result = (sMIME && sm2.ok() ? !!((fV > 8 ? sMIME.match(netStreamMimeTypes) : null) || sMIME.match(sm2.mimePattern)) : null); // TODO: make less \"weird\" (per JSLint)\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of a URL based on audio support.\r\n *\r\n * @param {string} sURL The URL to test\r\n * @return {boolean} URL playability\r\n */\r\n\r\n this.canPlayURL = function(sURL) {\r\n\r\n var result;\r\n\r\n if (sm2.hasHTML5) {\r\n result = html5CanPlay({\r\n url: sURL\r\n });\r\n }\r\n\r\n if (!result && needsFlash) {\r\n result = (sURL && sm2.ok() ? !!(sURL.match(sm2.filePattern)) : null);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of an HTML DOM &lt;a&gt; object (or similar object literal) based on audio support.\r\n *\r\n * @param {object} oLink an HTML DOM &lt;a&gt; object or object literal including href and/or type attributes\r\n * @return {boolean} URL playability\r\n */\r\n\r\n this.canPlayLink = function(oLink) {\r\n\r\n if (oLink.type !== _undefined && oLink.type && sm2.canPlayMIME(oLink.type)) return true;\r\n\r\n return sm2.canPlayURL(oLink.href);\r\n\r\n };\r\n\r\n /**\r\n * Retrieves a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.getSoundById = function(sID, _suppressDebug) {\r\n\r\n if (!sID) return null;\r\n\r\n var result = sm2.sounds[sID];\r\n\r\n // <d>\r\n if (!result && !_suppressDebug) {\r\n sm2._wD(sm + '.getSoundById(): Sound \"' + sID + '\" not found.', 2);\r\n }\r\n // </d>\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Queues a callback for execution when SoundManager has successfully initialized.\r\n *\r\n * @param {function} oMethod The callback method to fire\r\n * @param {object} oScope Optional: The scope to apply to the callback\r\n */\r\n\r\n this.onready = function(oMethod, oScope) {\r\n\r\n var sType = 'onready',\r\n result = false;\r\n\r\n if (typeof oMethod === 'function') {\r\n\r\n // <d>\r\n if (didInit) {\r\n sm2._wD(str('queue', sType));\r\n }\r\n // </d>\r\n\r\n if (!oScope) {\r\n oScope = window;\r\n }\r\n\r\n addOnEvent(sType, oMethod, oScope);\r\n processOnEvents();\r\n\r\n result = true;\r\n\r\n } else {\r\n\r\n throw str('needFunction', sType);\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Queues a callback for execution when SoundManager has failed to initialize.\r\n *\r\n * @param {function} oMethod The callback method to fire\r\n * @param {object} oScope Optional: The scope to apply to the callback\r\n */\r\n\r\n this.ontimeout = function(oMethod, oScope) {\r\n\r\n var sType = 'ontimeout',\r\n result = false;\r\n\r\n if (typeof oMethod === 'function') {\r\n\r\n // <d>\r\n if (didInit) {\r\n sm2._wD(str('queue', sType));\r\n }\r\n // </d>\r\n\r\n if (!oScope) {\r\n oScope = window;\r\n }\r\n\r\n addOnEvent(sType, oMethod, oScope);\r\n processOnEvents({ type: sType });\r\n\r\n result = true;\r\n\r\n } else {\r\n\r\n throw str('needFunction', sType);\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Writes console.log()-style debug output to a console or in-browser element.\r\n * Applies when debugMode = true\r\n *\r\n * @param {string} sText The console message\r\n * @param {object} nType Optional log level (number), or object. Number case: Log type/style where 0 = 'info', 1 = 'warn', 2 = 'error'. Object case: Object to be dumped.\r\n */\r\n\r\n this._writeDebug = function(sText, sTypeOrObject) {\r\n\r\n // pseudo-private console.log()-style output\r\n // <d>\r\n\r\n var sDID = 'soundmanager-debug', o, oItem;\r\n\r\n if (!sm2.setupOptions.debugMode) return false;\r\n\r\n if (hasConsole && sm2.useConsole) {\r\n if (sTypeOrObject && typeof sTypeOrObject === 'object') {\r\n // object passed; dump to console.\r\n console.log(sText, sTypeOrObject);\r\n } else if (debugLevels[sTypeOrObject] !== _undefined) {\r\n console[debugLevels[sTypeOrObject]](sText);\r\n } else {\r\n console.log(sText);\r\n }\r\n if (sm2.consoleOnly) return true;\r\n }\r\n\r\n o = id(sDID);\r\n\r\n if (!o) return false;\r\n\r\n oItem = doc.createElement('div');\r\n\r\n if (++wdCount % 2 === 0) {\r\n oItem.className = 'sm2-alt';\r\n }\r\n\r\n if (sTypeOrObject === _undefined) {\r\n sTypeOrObject = 0;\r\n } else {\r\n sTypeOrObject = parseInt(sTypeOrObject, 10);\r\n }\r\n\r\n oItem.appendChild(doc.createTextNode(sText));\r\n\r\n if (sTypeOrObject) {\r\n if (sTypeOrObject >= 2) {\r\n oItem.style.fontWeight = 'bold';\r\n }\r\n if (sTypeOrObject === 3) {\r\n oItem.style.color = '#ff3333';\r\n }\r\n }\r\n\r\n // top-to-bottom\r\n // o.appendChild(oItem);\r\n\r\n // bottom-to-top\r\n o.insertBefore(oItem, o.firstChild);\r\n\r\n o = null;\r\n // </d>\r\n\r\n return true;\r\n\r\n };\r\n\r\n // <d>\r\n // last-resort debugging option\r\n if (wl.indexOf('sm2-debug=alert') !== -1) {\r\n this._writeDebug = function(sText) {\r\n window.alert(sText);\r\n };\r\n }\r\n // </d>\r\n\r\n // alias\r\n this._wD = this._writeDebug;\r\n\r\n /**\r\n * Provides debug / state information on all SMSound objects.\r\n */\r\n\r\n this._debug = function() {\r\n\r\n // <d>\r\n var i, j;\r\n _wDS('currentObj', 1);\r\n\r\n for (i = 0, j = sm2.soundIDs.length; i < j; i++) {\r\n sm2.sounds[sm2.soundIDs[i]]._debug();\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n /**\r\n * Restarts and re-initializes the SoundManager instance.\r\n *\r\n * @param {boolean} resetEvents Optional: When true, removes all registered onready and ontimeout event callbacks.\r\n * @param {boolean} excludeInit Options: When true, does not call beginDelayedInit() (which would restart SM2).\r\n * @return {object} soundManager The soundManager instance.\r\n */\r\n\r\n this.reboot = function(resetEvents, excludeInit) {\r\n\r\n // reset some (or all) state, and re-init unless otherwise specified.\r\n\r\n // <d>\r\n if (sm2.soundIDs.length) {\r\n sm2._wD('Destroying ' + sm2.soundIDs.length + ' SMSound object' + (sm2.soundIDs.length !== 1 ? 's' : '') + '...');\r\n }\r\n // </d>\r\n\r\n var i, j, k;\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].destruct();\r\n }\r\n\r\n // trash ze flash (remove from the DOM)\r\n\r\n if (flash) {\r\n\r\n try {\r\n\r\n if (isIE) {\r\n oRemovedHTML = flash.innerHTML;\r\n }\r\n\r\n oRemoved = flash.parentNode.removeChild(flash);\r\n\r\n } catch(e) {\r\n\r\n // Remove failed? May be due to flash blockers silently removing the SWF object/embed node from the DOM. Warn and continue.\r\n\r\n _wDS('badRemove', 2);\r\n\r\n }\r\n\r\n }\r\n\r\n // actually, force recreate of movie.\r\n\r\n oRemovedHTML = oRemoved = needsFlash = flash = null;\r\n\r\n sm2.enabled = didDCLoaded = didInit = waitingForEI = initPending = didAppend = appendSuccess = disabled = useGlobalHTML5Audio = sm2.swfLoaded = false;\r\n\r\n sm2.soundIDs = [];\r\n sm2.sounds = {};\r\n\r\n idCounter = 0;\r\n didSetup = false;\r\n\r\n if (!resetEvents) {\r\n // reset callbacks for onready, ontimeout etc. so that they will fire again on re-init\r\n for (i in on_queue) {\r\n if (on_queue.hasOwnProperty(i)) {\r\n for (j = 0, k = on_queue[i].length; j < k; j++) {\r\n on_queue[i][j].fired = false;\r\n }\r\n }\r\n }\r\n } else {\r\n // remove all callbacks entirely\r\n on_queue = [];\r\n }\r\n\r\n // <d>\r\n if (!excludeInit) {\r\n sm2._wD(sm + ': Rebooting...');\r\n }\r\n // </d>\r\n\r\n // reset HTML5 and flash canPlay test results\r\n\r\n sm2.html5 = {\r\n usingFlash: null\r\n };\r\n\r\n sm2.flash = {};\r\n\r\n // reset device-specific HTML/flash mode switches\r\n\r\n sm2.html5Only = false;\r\n sm2.ignoreFlash = false;\r\n\r\n window.setTimeout(function() {\r\n\r\n // by default, re-init\r\n\r\n if (!excludeInit) {\r\n sm2.beginDelayedInit();\r\n }\r\n\r\n }, 20);\r\n\r\n return sm2;\r\n\r\n };\r\n\r\n this.reset = function() {\r\n\r\n /**\r\n * Shuts down and restores the SoundManager instance to its original loaded state, without an explicit reboot. All onready/ontimeout handlers are removed.\r\n * After this call, SM2 may be re-initialized via soundManager.beginDelayedInit().\r\n * @return {object} soundManager The soundManager instance.\r\n */\r\n\r\n _wDS('reset');\r\n\r\n return sm2.reboot(true, true);\r\n\r\n };\r\n\r\n /**\r\n * Undocumented: Determines the SM2 flash movie's load progress.\r\n *\r\n * @return {number or null} Percent loaded, or if invalid/unsupported, null.\r\n */\r\n\r\n this.getMoviePercent = function() {\r\n\r\n /**\r\n * Interesting syntax notes...\r\n * Flash/ExternalInterface (ActiveX/NPAPI) bridge methods are not typeof \"function\" nor instanceof Function, but are still valid.\r\n * Furthermore, using (flash && flash.PercentLoaded) causes IE to throw \"object doesn't support this property or method\".\r\n * Thus, 'in' syntax must be used.\r\n */\r\n\r\n return (flash && 'PercentLoaded' in flash ? flash.PercentLoaded() : null);\r\n\r\n };\r\n\r\n /**\r\n * Additional helper for manually invoking SM2's init process after DOM Ready / window.onload().\r\n */\r\n\r\n this.beginDelayedInit = function() {\r\n\r\n windowLoaded = true;\r\n domContentLoaded();\r\n\r\n setTimeout(function() {\r\n\r\n if (initPending) return false;\r\n\r\n createMovie();\r\n initMovie();\r\n initPending = true;\r\n\r\n return true;\r\n\r\n }, 20);\r\n\r\n delayWaitForEI();\r\n\r\n };\r\n\r\n /**\r\n * Destroys the SoundManager instance and all SMSound instances.\r\n */\r\n\r\n this.destruct = function() {\r\n\r\n sm2._wD(sm + '.destruct()');\r\n sm2.disable(true);\r\n\r\n };\r\n\r\n /**\r\n * SMSound() (sound object) constructor\r\n * ------------------------------------\r\n *\r\n * @param {object} oOptions Sound options (id and url are required attributes)\r\n * @return {SMSound} The new SMSound object\r\n */\r\n\r\n SMSound = function(oOptions) {\r\n\r\n var s = this, resetProperties, add_html5_events, remove_html5_events, stop_html5_timer, start_html5_timer, attachOnPosition, onplay_called = false, onPositionItems = [], onPositionFired = 0, detachOnPosition, applyFromTo, lastURL = null, lastHTML5State, urlOmitted;\r\n\r\n lastHTML5State = {\r\n // tracks duration + position (time)\r\n duration: null,\r\n time: null\r\n };\r\n\r\n this.id = oOptions.id;\r\n\r\n // legacy\r\n this.sID = this.id;\r\n\r\n this.url = oOptions.url;\r\n this.options = mixin(oOptions);\r\n\r\n // per-play-instance-specific options\r\n this.instanceOptions = this.options;\r\n\r\n // short alias\r\n this._iO = this.instanceOptions;\r\n\r\n // assign property defaults\r\n this.pan = this.options.pan;\r\n this.volume = this.options.volume;\r\n\r\n // whether or not this object is using HTML5\r\n this.isHTML5 = false;\r\n\r\n // internal HTML5 Audio() object reference\r\n this._a = null;\r\n\r\n // for flash 8 special-case createSound() without url, followed by load/play with url case\r\n urlOmitted = (!this.url);\r\n\r\n /**\r\n * SMSound() public methods\r\n * ------------------------\r\n */\r\n\r\n this.id3 = {};\r\n\r\n /**\r\n * Writes SMSound object parameters to debug console\r\n */\r\n\r\n this._debug = function() {\r\n\r\n // <d>\r\n sm2._wD(s.id + ': Merged options:', s.options);\r\n // </d>\r\n\r\n };\r\n\r\n /**\r\n * Begins loading a sound per its *url*.\r\n *\r\n * @param {object} options Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.load = function(options) {\r\n\r\n var oSound = null, instanceOptions;\r\n\r\n if (options !== _undefined) {\r\n s._iO = mixin(options, s.options);\r\n } else {\r\n options = s.options;\r\n s._iO = options;\r\n if (lastURL && lastURL !== s.url) {\r\n _wDS('manURL');\r\n s._iO.url = s.url;\r\n s.url = null;\r\n }\r\n }\r\n\r\n if (!s._iO.url) {\r\n s._iO.url = s.url;\r\n }\r\n\r\n s._iO.url = parseURL(s._iO.url);\r\n\r\n // ensure we're in sync\r\n s.instanceOptions = s._iO;\r\n\r\n // local shortcut\r\n instanceOptions = s._iO;\r\n\r\n sm2._wD(s.id + ': load (' + instanceOptions.url + ')');\r\n\r\n if (!instanceOptions.url && !s.url) {\r\n sm2._wD(s.id + ': load(): url is unassigned. Exiting.', 2);\r\n return s;\r\n }\r\n\r\n // <d>\r\n if (!s.isHTML5 && fV === 8 && !s.url && !instanceOptions.autoPlay) {\r\n // flash 8 load() -> play() won't work before onload has fired.\r\n sm2._wD(s.id + ': Flash 8 load() limitation: Wait for onload() before calling play().', 1);\r\n }\r\n // </d>\r\n\r\n if (instanceOptions.url === s.url && s.readyState !== 0 && s.readyState !== 2) {\r\n _wDS('onURL', 1);\r\n // if loaded and an onload() exists, fire immediately.\r\n if (s.readyState === 3 && instanceOptions.onload) {\r\n // assume success based on truthy duration.\r\n wrapCallback(s, function() {\r\n instanceOptions.onload.apply(s, [(!!s.duration)]);\r\n });\r\n }\r\n return s;\r\n }\r\n\r\n // reset a few state properties\r\n\r\n s.loaded = false;\r\n s.readyState = 1;\r\n s.playState = 0;\r\n s.id3 = {};\r\n\r\n // TODO: If switching from HTML5 -> flash (or vice versa), stop currently-playing audio.\r\n\r\n if (html5OK(instanceOptions)) {\r\n\r\n oSound = s._setup_html5(instanceOptions);\r\n\r\n if (!oSound._called_load) {\r\n\r\n s._html5_canplay = false;\r\n\r\n // TODO: review called_load / html5_canplay logic\r\n\r\n // if url provided directly to load(), assign it here.\r\n\r\n if (s.url !== instanceOptions.url) {\r\n\r\n sm2._wD(_wDS('manURL') + ': ' + instanceOptions.url);\r\n\r\n s._a.src = instanceOptions.url;\r\n\r\n // TODO: review / re-apply all relevant options (volume, loop, onposition etc.)\r\n\r\n // reset position for new URL\r\n s.setPosition(0);\r\n\r\n }\r\n\r\n // given explicit load call, try to preload.\r\n\r\n // early HTML5 implementation (non-standard)\r\n s._a.autobuffer = 'auto';\r\n\r\n // standard property, values: none / metadata / auto\r\n // reference: http://msdn.microsoft.com/en-us/library/ie/ff974759%28v=vs.85%29.aspx\r\n s._a.preload = 'auto';\r\n\r\n s._a._called_load = true;\r\n\r\n } else {\r\n\r\n sm2._wD(s.id + ': Ignoring request to load again');\r\n\r\n }\r\n\r\n } else {\r\n\r\n if (sm2.html5Only) {\r\n sm2._wD(s.id + ': No flash support. Exiting.');\r\n return s;\r\n }\r\n\r\n if (s._iO.url && s._iO.url.match(/data:/i)) {\r\n // data: URIs not supported by Flash, either.\r\n sm2._wD(s.id + ': data: URIs not supported via Flash. Exiting.');\r\n return s;\r\n }\r\n\r\n try {\r\n s.isHTML5 = false;\r\n s._iO = policyFix(loopFix(instanceOptions));\r\n // if we have \"position\", disable auto-play as we'll be seeking to that position at onload().\r\n if (s._iO.autoPlay && (s._iO.position || s._iO.from)) {\r\n sm2._wD(s.id + ': Disabling autoPlay because of non-zero offset case');\r\n s._iO.autoPlay = false;\r\n }\r\n // re-assign local shortcut\r\n instanceOptions = s._iO;\r\n if (fV === 8) {\r\n flash._load(s.id, instanceOptions.url, instanceOptions.stream, instanceOptions.autoPlay, instanceOptions.usePolicyFile);\r\n } else {\r\n flash._load(s.id, instanceOptions.url, !!(instanceOptions.stream), !!(instanceOptions.autoPlay), instanceOptions.loops || 1, !!(instanceOptions.autoLoad), instanceOptions.usePolicyFile);\r\n }\r\n } catch(e) {\r\n _wDS('smError', 2);\r\n debugTS('onload', false);\r\n catchError({\r\n type: 'SMSOUND_LOAD_JS_EXCEPTION',\r\n fatal: true\r\n });\r\n }\r\n\r\n }\r\n\r\n // after all of this, ensure sound url is up to date.\r\n s.url = instanceOptions.url;\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unloads a sound, canceling any open HTTP requests.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.unload = function() {\r\n\r\n // Flash 8/AS2 can't \"close\" a stream - fake it by loading an empty URL\r\n // Flash 9/AS3: Close stream, preventing further load\r\n // HTML5: Most UAs will use empty URL\r\n\r\n if (s.readyState !== 0) {\r\n\r\n sm2._wD(s.id + ': unload()');\r\n\r\n if (!s.isHTML5) {\r\n\r\n if (fV === 8) {\r\n flash._unload(s.id, emptyURL);\r\n } else {\r\n flash._unload(s.id);\r\n }\r\n\r\n } else {\r\n\r\n stop_html5_timer();\r\n\r\n if (s._a) {\r\n\r\n s._a.pause();\r\n\r\n // update empty URL, too\r\n lastURL = html5Unload(s._a);\r\n\r\n }\r\n\r\n }\r\n\r\n // reset load/status flags\r\n resetProperties();\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unloads and destroys a sound.\r\n */\r\n\r\n this.destruct = function(_bFromSM) {\r\n\r\n sm2._wD(s.id + ': Destruct');\r\n\r\n if (!s.isHTML5) {\r\n\r\n // kill sound within Flash\r\n // Disable the onfailure handler\r\n s._iO.onfailure = null;\r\n flash._destroySound(s.id);\r\n\r\n } else {\r\n\r\n stop_html5_timer();\r\n\r\n if (s._a) {\r\n s._a.pause();\r\n html5Unload(s._a);\r\n if (!useGlobalHTML5Audio) {\r\n remove_html5_events();\r\n }\r\n // break obvious circular reference\r\n s._a._s = null;\r\n s._a = null;\r\n }\r\n\r\n }\r\n\r\n if (!_bFromSM) {\r\n // ensure deletion from controller\r\n sm2.destroySound(s.id, true);\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Begins playing a sound.\r\n *\r\n * @param {object} options Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.play = function(options, _updatePlayState) {\r\n\r\n var fN, allowMulti, a, onready,\r\n audioClone, onended, oncanplay,\r\n startOK = true;\r\n\r\n // <d>\r\n fN = s.id + ': play(): ';\r\n // </d>\r\n\r\n // default to true\r\n _updatePlayState = (_updatePlayState === _undefined ? true : _updatePlayState);\r\n\r\n if (!options) {\r\n options = {};\r\n }\r\n\r\n // first, use local URL (if specified)\r\n if (s.url) {\r\n s._iO.url = s.url;\r\n }\r\n\r\n // mix in any options defined at createSound()\r\n s._iO = mixin(s._iO, s.options);\r\n\r\n // mix in any options specific to this method\r\n s._iO = mixin(options, s._iO);\r\n\r\n s._iO.url = parseURL(s._iO.url);\r\n\r\n s.instanceOptions = s._iO;\r\n\r\n // RTMP-only\r\n if (!s.isHTML5 && s._iO.serverURL && !s.connected) {\r\n if (!s.getAutoPlay()) {\r\n sm2._wD(fN + ' Netstream not connected yet - setting autoPlay');\r\n s.setAutoPlay(true);\r\n }\r\n // play will be called in onconnect()\r\n return s;\r\n }\r\n\r\n if (html5OK(s._iO)) {\r\n s._setup_html5(s._iO);\r\n start_html5_timer();\r\n }\r\n\r\n if (s.playState === 1 && !s.paused) {\r\n\r\n allowMulti = s._iO.multiShot;\r\n\r\n if (!allowMulti) {\r\n\r\n sm2._wD(fN + 'Already playing (one-shot)', 1);\r\n\r\n if (s.isHTML5) {\r\n // go back to original position.\r\n s.setPosition(s._iO.position);\r\n }\r\n\r\n return s;\r\n\r\n }\r\n\r\n sm2._wD(fN + 'Already playing (multi-shot)', 1);\r\n\r\n }\r\n\r\n // edge case: play() with explicit URL parameter\r\n if (options.url && options.url !== s.url) {\r\n\r\n // special case for createSound() followed by load() / play() with url; avoid double-load case.\r\n if (!s.readyState && !s.isHTML5 && fV === 8 && urlOmitted) {\r\n\r\n urlOmitted = false;\r\n\r\n } else {\r\n\r\n // load using merged options\r\n s.load(s._iO);\r\n\r\n }\r\n\r\n }\r\n\r\n if (!s.loaded) {\r\n\r\n if (s.readyState === 0) {\r\n\r\n sm2._wD(fN + 'Attempting to load');\r\n\r\n // try to get this sound playing ASAP\r\n if (!s.isHTML5 && !sm2.html5Only) {\r\n\r\n // flash: assign directly because setAutoPlay() increments the instanceCount\r\n s._iO.autoPlay = true;\r\n s.load(s._iO);\r\n\r\n } else if (s.isHTML5) {\r\n\r\n // iOS needs this when recycling sounds, loading a new URL on an existing object.\r\n s.load(s._iO);\r\n\r\n } else {\r\n\r\n sm2._wD(fN + 'Unsupported type. Exiting.');\r\n\r\n return s;\r\n\r\n }\r\n\r\n // HTML5 hack - re-set instanceOptions?\r\n s.instanceOptions = s._iO;\r\n\r\n } else if (s.readyState === 2) {\r\n\r\n sm2._wD(fN + 'Could not load - exiting', 2);\r\n\r\n return s;\r\n\r\n } else {\r\n\r\n sm2._wD(fN + 'Loading - attempting to play...');\r\n\r\n }\r\n\r\n } else {\r\n\r\n // \"play()\"\r\n sm2._wD(fN.substr(0, fN.lastIndexOf(':')));\r\n\r\n }\r\n\r\n if (!s.isHTML5 && fV === 9 && s.position > 0 && s.position === s.duration) {\r\n // flash 9 needs a position reset if play() is called while at the end of a sound.\r\n sm2._wD(fN + 'Sound at end, resetting to position: 0');\r\n options.position = 0;\r\n }\r\n\r\n /**\r\n * Streams will pause when their buffer is full if they are being loaded.\r\n * In this case paused is true, but the song hasn't started playing yet.\r\n * If we just call resume() the onplay() callback will never be called.\r\n * So only call resume() if the position is > 0.\r\n * Another reason is because options like volume won't have been applied yet.\r\n * For normal sounds, just resume.\r\n */\r\n\r\n if (s.paused && s.position >= 0 && (!s._iO.serverURL || s.position > 0)) {\r\n\r\n // https://gist.github.com/37b17df75cc4d7a90bf6\r\n sm2._wD(fN + 'Resuming from paused state', 1);\r\n s.resume();\r\n\r\n } else {\r\n\r\n s._iO = mixin(options, s._iO);\r\n\r\n /**\r\n * Preload in the event of play() with position under Flash,\r\n * or from/to parameters and non-RTMP case\r\n */\r\n if (((!s.isHTML5 && s._iO.position !== null && s._iO.position > 0) || (s._iO.from !== null && s._iO.from > 0) || s._iO.to !== null) && s.instanceCount === 0 && s.playState === 0 && !s._iO.serverURL) {\r\n\r\n onready = function() {\r\n // sound \"canplay\" or onload()\r\n // re-apply position/from/to to instance options, and start playback\r\n s._iO = mixin(options, s._iO);\r\n s.play(s._iO);\r\n };\r\n\r\n // HTML5 needs to at least have \"canplay\" fired before seeking.\r\n if (s.isHTML5 && !s._html5_canplay) {\r\n\r\n // this hasn't been loaded yet. load it first, and then do this again.\r\n sm2._wD(fN + 'Beginning load for non-zero offset case');\r\n\r\n s.load({\r\n // note: custom HTML5-only event added for from/to implementation.\r\n _oncanplay: onready\r\n });\r\n\r\n } else if (!s.isHTML5 && !s.loaded && (!s.readyState || s.readyState !== 2)) {\r\n\r\n // to be safe, preload the whole thing in Flash.\r\n\r\n sm2._wD(fN + 'Preloading for non-zero offset case');\r\n\r\n s.load({\r\n onload: onready\r\n });\r\n\r\n }\r\n\r\n // otherwise, we're ready to go. re-apply local options, and continue\r\n\r\n s._iO = applyFromTo();\r\n\r\n }\r\n\r\n // sm2._wD(fN + 'Starting to play');\r\n\r\n // increment instance counter, where enabled + supported\r\n if (!s.instanceCount || s._iO.multiShotEvents || (s.isHTML5 && s._iO.multiShot && !useGlobalHTML5Audio) || (!s.isHTML5 && fV > 8 && !s.getAutoPlay())) {\r\n s.instanceCount++;\r\n }\r\n\r\n // if first play and onposition parameters exist, apply them now\r\n if (s._iO.onposition && s.playState === 0) {\r\n attachOnPosition(s);\r\n }\r\n\r\n s.playState = 1;\r\n s.paused = false;\r\n\r\n s.position = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position : 0);\r\n\r\n if (!s.isHTML5) {\r\n s._iO = policyFix(loopFix(s._iO));\r\n }\r\n\r\n if (s._iO.onplay && _updatePlayState) {\r\n s._iO.onplay.apply(s);\r\n onplay_called = true;\r\n }\r\n\r\n s.setVolume(s._iO.volume, true);\r\n s.setPan(s._iO.pan, true);\r\n\r\n if (s._iO.playbackRate !== 1) {\r\n s.setPlaybackRate(s._iO.playbackRate);\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n startOK = flash._start(s.id, s._iO.loops || 1, (fV === 9 ? s.position : s.position / msecScale), s._iO.multiShot || false);\r\n\r\n if (fV === 9 && !startOK) {\r\n // edge case: no sound hardware, or 32-channel flash ceiling hit.\r\n // applies only to Flash 9, non-NetStream/MovieStar sounds.\r\n // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#play%28%29\r\n sm2._wD(fN + 'No sound hardware, or 32-sound ceiling hit', 2);\r\n if (s._iO.onplayerror) {\r\n s._iO.onplayerror.apply(s);\r\n }\r\n\r\n }\r\n\r\n } else if (s.instanceCount < 2) {\r\n\r\n // HTML5 single-instance case\r\n\r\n start_html5_timer();\r\n\r\n a = s._setup_html5();\r\n\r\n s.setPosition(s._iO.position);\r\n\r\n a.play();\r\n\r\n } else {\r\n\r\n // HTML5 multi-shot case\r\n\r\n sm2._wD(s.id + ': Cloning Audio() for instance #' + s.instanceCount + '...');\r\n\r\n audioClone = new Audio(s._iO.url);\r\n\r\n onended = function() {\r\n event.remove(audioClone, 'ended', onended);\r\n s._onfinish(s);\r\n // cleanup\r\n html5Unload(audioClone);\r\n audioClone = null;\r\n };\r\n\r\n oncanplay = function() {\r\n event.remove(audioClone, 'canplay', oncanplay);\r\n try {\r\n audioClone.currentTime = s._iO.position / msecScale;\r\n } catch(err) {\r\n complain(s.id + ': multiShot play() failed to apply position of ' + (s._iO.position / msecScale));\r\n }\r\n audioClone.play();\r\n };\r\n\r\n event.add(audioClone, 'ended', onended);\r\n\r\n // apply volume to clones, too\r\n if (s._iO.volume !== _undefined) {\r\n audioClone.volume = Math.max(0, Math.min(1, s._iO.volume / 100));\r\n }\r\n\r\n // playing multiple muted sounds? if you do this, you're weird ;) - but let's cover it.\r\n if (s.muted) {\r\n audioClone.muted = true;\r\n }\r\n\r\n if (s._iO.position) {\r\n // HTML5 audio can't seek before onplay() event has fired.\r\n // wait for canplay, then seek to position and start playback.\r\n event.add(audioClone, 'canplay', oncanplay);\r\n } else {\r\n // begin playback at currentTime: 0\r\n audioClone.play();\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n // just for convenience\r\n this.start = this.play;\r\n\r\n /**\r\n * Stops playing a sound (and optionally, all sounds)\r\n *\r\n * @param {boolean} bAll Optional: Whether to stop all sounds\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.stop = function(bAll) {\r\n\r\n var instanceOptions = s._iO,\r\n originalPosition;\r\n\r\n if (s.playState === 1) {\r\n\r\n sm2._wD(s.id + ': stop()');\r\n\r\n s._onbufferchange(0);\r\n s._resetOnPosition(0);\r\n s.paused = false;\r\n\r\n if (!s.isHTML5) {\r\n s.playState = 0;\r\n }\r\n\r\n // remove onPosition listeners, if any\r\n detachOnPosition();\r\n\r\n // and \"to\" position, if set\r\n if (instanceOptions.to) {\r\n s.clearOnPosition(instanceOptions.to);\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n flash._stop(s.id, bAll);\r\n\r\n // hack for netStream: just unload\r\n if (instanceOptions.serverURL) {\r\n s.unload();\r\n }\r\n\r\n } else if (s._a) {\r\n\r\n originalPosition = s.position;\r\n\r\n // act like Flash, though\r\n s.setPosition(0);\r\n\r\n // hack: reflect old position for onstop() (also like Flash)\r\n s.position = originalPosition;\r\n\r\n // html5 has no stop()\r\n // NOTE: pausing means iOS requires interaction to resume.\r\n s._a.pause();\r\n\r\n s.playState = 0;\r\n\r\n // and update UI\r\n s._onTimer();\r\n\r\n stop_html5_timer();\r\n\r\n }\r\n\r\n s.instanceCount = 0;\r\n s._iO = {};\r\n\r\n if (instanceOptions.onstop) {\r\n instanceOptions.onstop.apply(s);\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Undocumented/internal: Sets autoPlay for RTMP.\r\n *\r\n * @param {boolean} autoPlay state\r\n */\r\n\r\n this.setAutoPlay = function(autoPlay) {\r\n\r\n sm2._wD(s.id + ': Autoplay turned ' + (autoPlay ? 'on' : 'off'));\r\n s._iO.autoPlay = autoPlay;\r\n\r\n if (!s.isHTML5) {\r\n flash._setAutoPlay(s.id, autoPlay);\r\n if (autoPlay) {\r\n // only increment the instanceCount if the sound isn't loaded (TODO: verify RTMP)\r\n if (!s.instanceCount && s.readyState === 1) {\r\n s.instanceCount++;\r\n sm2._wD(s.id + ': Incremented instance count to ' + s.instanceCount);\r\n }\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Undocumented/internal: Returns the autoPlay boolean.\r\n *\r\n * @return {boolean} The current autoPlay value\r\n */\r\n\r\n this.getAutoPlay = function() {\r\n\r\n return s._iO.autoPlay;\r\n\r\n };\r\n\r\n /**\r\n * Sets the playback rate of a sound (HTML5-only.)\r\n *\r\n * @param {number} playbackRate (+/-)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPlaybackRate = function(playbackRate) {\r\n\r\n // Per Mozilla, limit acceptable values to prevent playback from stopping (unless allowOverride is truthy.)\r\n // https://developer.mozilla.org/en-US/Apps/Build/Audio_and_video_delivery/WebAudio_playbackRate_explained\r\n var normalizedRate = Math.max(0.5, Math.min(4, playbackRate));\r\n\r\n // <d>\r\n if (normalizedRate !== playbackRate) {\r\n sm2._wD(s.id + ': setPlaybackRate(' + playbackRate + '): limiting rate to ' + normalizedRate, 2);\r\n }\r\n // </d>\r\n\r\n if (s.isHTML5) {\r\n try {\r\n s._iO.playbackRate = normalizedRate;\r\n s._a.playbackRate = normalizedRate;\r\n } catch(e) {\r\n sm2._wD(s.id + ': setPlaybackRate(' + normalizedRate + ') failed: ' + e.message, 2);\r\n }\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the position of a sound.\r\n *\r\n * @param {number} nMsecOffset Position (milliseconds)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPosition = function(nMsecOffset) {\r\n\r\n if (nMsecOffset === _undefined) {\r\n nMsecOffset = 0;\r\n }\r\n\r\n var position, position1K,\r\n // Use the duration from the instance options, if we don't have a track duration yet.\r\n // position >= 0 and <= current available (loaded) duration\r\n offset = (s.isHTML5 ? Math.max(nMsecOffset, 0) : Math.min(s.duration || s._iO.duration, Math.max(nMsecOffset, 0)));\r\n\r\n s.position = offset;\r\n position1K = s.position / msecScale;\r\n s._resetOnPosition(s.position);\r\n s._iO.position = offset;\r\n\r\n if (!s.isHTML5) {\r\n\r\n position = (fV === 9 ? s.position : position1K);\r\n\r\n if (s.readyState && s.readyState !== 2) {\r\n // if paused or not playing, will not resume (by playing)\r\n flash._setPosition(s.id, position, (s.paused || !s.playState), s._iO.multiShot);\r\n }\r\n\r\n } else if (s._a) {\r\n\r\n // Set the position in the canplay handler if the sound is not ready yet\r\n if (s._html5_canplay) {\r\n\r\n if (s._a.currentTime.toFixed(3) !== position1K.toFixed(3)) {\r\n\r\n /**\r\n * DOM/JS errors/exceptions to watch out for:\r\n * if seek is beyond (loaded?) position, \"DOM exception 11\"\r\n * \"INDEX_SIZE_ERR\": DOM exception 1\r\n */\r\n sm2._wD(s.id + ': setPosition(' + position1K + ')');\r\n\r\n try {\r\n s._a.currentTime = position1K;\r\n if (s.playState === 0 || s.paused) {\r\n // allow seek without auto-play/resume\r\n s._a.pause();\r\n }\r\n } catch(e) {\r\n sm2._wD(s.id + ': setPosition(' + position1K + ') failed: ' + e.message, 2);\r\n }\r\n\r\n }\r\n\r\n } else if (position1K) {\r\n\r\n // warn on non-zero seek attempts\r\n sm2._wD(s.id + ': setPosition(' + position1K + '): Cannot seek yet, sound not ready', 2);\r\n return s;\r\n\r\n }\r\n\r\n if (s.paused) {\r\n\r\n // if paused, refresh UI right away by forcing update\r\n s._onTimer(true);\r\n\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Pauses sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.pause = function(_bCallFlash) {\r\n\r\n if (s.paused || (s.playState === 0 && s.readyState !== 1)) return s;\r\n\r\n sm2._wD(s.id + ': pause()');\r\n s.paused = true;\r\n\r\n if (!s.isHTML5) {\r\n if (_bCallFlash || _bCallFlash === _undefined) {\r\n flash._pause(s.id, s._iO.multiShot);\r\n }\r\n } else {\r\n s._setup_html5().pause();\r\n stop_html5_timer();\r\n }\r\n\r\n if (s._iO.onpause) {\r\n s._iO.onpause.apply(s);\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Resumes sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n /**\r\n * When auto-loaded streams pause on buffer full they have a playState of 0.\r\n * We need to make sure that the playState is set to 1 when these streams \"resume\".\r\n * When a paused stream is resumed, we need to trigger the onplay() callback if it\r\n * hasn't been called already. In this case since the sound is being played for the\r\n * first time, I think it's more appropriate to call onplay() rather than onresume().\r\n */\r\n\r\n this.resume = function() {\r\n\r\n var instanceOptions = s._iO;\r\n\r\n if (!s.paused) return s;\r\n\r\n sm2._wD(s.id + ': resume()');\r\n s.paused = false;\r\n s.playState = 1;\r\n\r\n if (!s.isHTML5) {\r\n\r\n if (instanceOptions.isMovieStar && !instanceOptions.serverURL) {\r\n // Bizarre Webkit bug (Chrome reported via 8tracks.com dudes): AAC content paused for 30+ seconds(?) will not resume without a reposition.\r\n s.setPosition(s.position);\r\n }\r\n\r\n // flash method is toggle-based (pause/resume)\r\n flash._pause(s.id, instanceOptions.multiShot);\r\n\r\n } else {\r\n\r\n s._setup_html5().play();\r\n start_html5_timer();\r\n\r\n }\r\n\r\n if (!onplay_called && instanceOptions.onplay) {\r\n\r\n instanceOptions.onplay.apply(s);\r\n onplay_called = true;\r\n\r\n } else if (instanceOptions.onresume) {\r\n\r\n instanceOptions.onresume.apply(s);\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Toggles sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.togglePause = function() {\r\n\r\n sm2._wD(s.id + ': togglePause()');\r\n\r\n if (s.playState === 0) {\r\n s.play({\r\n position: (fV === 9 && !s.isHTML5 ? s.position : s.position / msecScale)\r\n });\r\n return s;\r\n }\r\n\r\n if (s.paused) {\r\n s.resume();\r\n } else {\r\n s.pause();\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the panning (L-R) effect.\r\n *\r\n * @param {number} nPan The pan value (-100 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPan = function(nPan, bInstanceOnly) {\r\n\r\n if (nPan === _undefined) {\r\n nPan = 0;\r\n }\r\n\r\n if (bInstanceOnly === _undefined) {\r\n bInstanceOnly = false;\r\n }\r\n\r\n if (!s.isHTML5) {\r\n flash._setPan(s.id, nPan);\r\n } // else { no HTML5 pan? }\r\n\r\n s._iO.pan = nPan;\r\n\r\n if (!bInstanceOnly) {\r\n s.pan = nPan;\r\n s.options.pan = nPan;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the volume.\r\n *\r\n * @param {number} nVol The volume value (0 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setVolume = function(nVol, _bInstanceOnly) {\r\n\r\n /**\r\n * Note: Setting volume has no effect on iOS \"special snowflake\" devices.\r\n * Hardware volume control overrides software, and volume\r\n * will always return 1 per Apple docs. (iOS 4 + 5.)\r\n * http://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/HTML-canvas-guide/AddingSoundtoCanvasAnimations/AddingSoundtoCanvasAnimations.html\r\n */\r\n\r\n if (nVol === _undefined) {\r\n nVol = 100;\r\n }\r\n\r\n if (_bInstanceOnly === _undefined) {\r\n _bInstanceOnly = false;\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n flash._setVolume(s.id, (sm2.muted && !s.muted) || s.muted ? 0 : nVol);\r\n\r\n } else if (s._a) {\r\n\r\n if (sm2.muted && !s.muted) {\r\n s.muted = true;\r\n s._a.muted = true;\r\n }\r\n\r\n // valid range for native HTML5 Audio(): 0-1\r\n s._a.volume = Math.max(0, Math.min(1, nVol / 100));\r\n\r\n }\r\n\r\n s._iO.volume = nVol;\r\n\r\n if (!_bInstanceOnly) {\r\n s.volume = nVol;\r\n s.options.volume = nVol;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Mutes the sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.mute = function() {\r\n\r\n s.muted = true;\r\n\r\n if (!s.isHTML5) {\r\n flash._setVolume(s.id, 0);\r\n } else if (s._a) {\r\n s._a.muted = true;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unmutes the sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.unmute = function() {\r\n\r\n s.muted = false;\r\n var hasIO = (s._iO.volume !== _undefined);\r\n\r\n if (!s.isHTML5) {\r\n flash._setVolume(s.id, hasIO ? s._iO.volume : s.options.volume);\r\n } else if (s._a) {\r\n s._a.muted = false;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Toggles the muted state of a sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.toggleMute = function() {\r\n\r\n return (s.muted ? s.unmute() : s.mute());\r\n\r\n };\r\n\r\n /**\r\n * Registers a callback to be fired when a sound reaches a given position during playback.\r\n *\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod The relevant callback to fire\r\n * @param {object} oScope Optional: The scope to apply the callback to\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.onPosition = function(nPosition, oMethod, oScope) {\r\n\r\n // TODO: basic dupe checking?\r\n\r\n onPositionItems.push({\r\n position: parseInt(nPosition, 10),\r\n method: oMethod,\r\n scope: (oScope !== _undefined ? oScope : s),\r\n fired: false\r\n });\r\n\r\n return s;\r\n\r\n };\r\n\r\n // legacy/backwards-compability: lower-case method name\r\n this.onposition = this.onPosition;\r\n\r\n /**\r\n * Removes registered callback(s) from a sound, by position and/or callback.\r\n *\r\n * @param {number} nPosition The position to clear callback(s) for\r\n * @param {function} oMethod Optional: Identify one callback to be removed when multiple listeners exist for one position\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.clearOnPosition = function(nPosition, oMethod) {\r\n\r\n var i;\r\n\r\n nPosition = parseInt(nPosition, 10);\r\n\r\n if (isNaN(nPosition)) {\r\n // safety check\r\n return;\r\n }\r\n\r\n for (i = 0; i < onPositionItems.length; i++) {\r\n\r\n if (nPosition === onPositionItems[i].position) {\r\n // remove this item if no method was specified, or, if the method matches\r\n\r\n if (!oMethod || (oMethod === onPositionItems[i].method)) {\r\n\r\n if (onPositionItems[i].fired) {\r\n // decrement \"fired\" counter, too\r\n onPositionFired--;\r\n }\r\n\r\n onPositionItems.splice(i, 1);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._processOnPosition = function() {\r\n\r\n var i, item, j = onPositionItems.length;\r\n\r\n if (!j || !s.playState || onPositionFired >= j) return false;\r\n\r\n for (i = j - 1; i >= 0; i--) {\r\n\r\n item = onPositionItems[i];\r\n\r\n if (!item.fired && s.position >= item.position) {\r\n\r\n item.fired = true;\r\n onPositionFired++;\r\n item.method.apply(item.scope, [item.position]);\r\n\r\n // reset j -- onPositionItems.length can be changed in the item callback above... occasionally breaking the loop.\r\n j = onPositionItems.length;\r\n\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._resetOnPosition = function(nPosition) {\r\n\r\n // reset \"fired\" for items interested in this position\r\n var i, item, j = onPositionItems.length;\r\n\r\n if (!j) return false;\r\n\r\n for (i = j - 1; i >= 0; i--) {\r\n\r\n item = onPositionItems[i];\r\n\r\n if (item.fired && nPosition <= item.position) {\r\n item.fired = false;\r\n onPositionFired--;\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * SMSound() private internals\r\n * --------------------------------\r\n */\r\n\r\n applyFromTo = function() {\r\n\r\n var instanceOptions = s._iO,\r\n f = instanceOptions.from,\r\n t = instanceOptions.to,\r\n start, end;\r\n\r\n end = function() {\r\n\r\n // end has been reached.\r\n sm2._wD(s.id + ': \"To\" time of ' + t + ' reached.');\r\n\r\n // detach listener\r\n s.clearOnPosition(t, end);\r\n\r\n // stop should clear this, too\r\n s.stop();\r\n\r\n };\r\n\r\n start = function() {\r\n\r\n sm2._wD(s.id + ': Playing \"from\" ' + f);\r\n\r\n // add listener for end\r\n if (t !== null && !isNaN(t)) {\r\n s.onPosition(t, end);\r\n }\r\n\r\n };\r\n\r\n if (f !== null && !isNaN(f)) {\r\n\r\n // apply to instance options, guaranteeing correct start position.\r\n instanceOptions.position = f;\r\n\r\n // multiShot timing can't be tracked, so prevent that.\r\n instanceOptions.multiShot = false;\r\n\r\n start();\r\n\r\n }\r\n\r\n // return updated instanceOptions including starting position\r\n return instanceOptions;\r\n\r\n };\r\n\r\n attachOnPosition = function() {\r\n\r\n var item,\r\n op = s._iO.onposition;\r\n\r\n // attach onposition things, if any, now.\r\n\r\n if (op) {\r\n\r\n for (item in op) {\r\n if (op.hasOwnProperty(item)) {\r\n s.onPosition(parseInt(item, 10), op[item]);\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n detachOnPosition = function() {\r\n\r\n var item,\r\n op = s._iO.onposition;\r\n\r\n // detach any onposition()-style listeners.\r\n\r\n if (op) {\r\n\r\n for (item in op) {\r\n if (op.hasOwnProperty(item)) {\r\n s.clearOnPosition(parseInt(item, 10));\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n start_html5_timer = function() {\r\n\r\n if (s.isHTML5) {\r\n startTimer(s);\r\n }\r\n\r\n };\r\n\r\n stop_html5_timer = function() {\r\n\r\n if (s.isHTML5) {\r\n stopTimer(s);\r\n }\r\n\r\n };\r\n\r\n resetProperties = function(retainPosition) {\r\n\r\n if (!retainPosition) {\r\n onPositionItems = [];\r\n onPositionFired = 0;\r\n }\r\n\r\n onplay_called = false;\r\n\r\n s._hasTimer = null;\r\n s._a = null;\r\n s._html5_canplay = false;\r\n s.bytesLoaded = null;\r\n s.bytesTotal = null;\r\n s.duration = (s._iO && s._iO.duration ? s._iO.duration : null);\r\n s.durationEstimate = null;\r\n s.buffered = [];\r\n\r\n // legacy: 1D array\r\n s.eqData = [];\r\n\r\n s.eqData.left = [];\r\n s.eqData.right = [];\r\n\r\n s.failures = 0;\r\n s.isBuffering = false;\r\n s.instanceOptions = {};\r\n s.instanceCount = 0;\r\n s.loaded = false;\r\n s.metadata = {};\r\n\r\n // 0 = uninitialised, 1 = loading, 2 = failed/error, 3 = loaded/success\r\n s.readyState = 0;\r\n\r\n s.muted = false;\r\n s.paused = false;\r\n\r\n s.peakData = {\r\n left: 0,\r\n right: 0\r\n };\r\n\r\n s.waveformData = {\r\n left: [],\r\n right: []\r\n };\r\n\r\n s.playState = 0;\r\n s.position = null;\r\n\r\n s.id3 = {};\r\n\r\n };\r\n\r\n resetProperties();\r\n\r\n /**\r\n * Pseudo-private SMSound internals\r\n * --------------------------------\r\n */\r\n\r\n this._onTimer = function(bForce) {\r\n\r\n /**\r\n * HTML5-only _whileplaying() etc.\r\n * called from both HTML5 native events, and polling/interval-based timers\r\n * mimics flash and fires only when time/duration change, so as to be polling-friendly\r\n */\r\n\r\n var duration, isNew = false, time, x = {};\r\n\r\n if (s._hasTimer || bForce) {\r\n\r\n // TODO: May not need to track readyState (1 = loading)\r\n\r\n if (s._a && (bForce || ((s.playState > 0 || s.readyState === 1) && !s.paused))) {\r\n\r\n duration = s._get_html5_duration();\r\n\r\n if (duration !== lastHTML5State.duration) {\r\n\r\n lastHTML5State.duration = duration;\r\n s.duration = duration;\r\n isNew = true;\r\n\r\n }\r\n\r\n // TODO: investigate why this goes wack if not set/re-set each time.\r\n s.durationEstimate = s.duration;\r\n\r\n time = (s._a.currentTime * msecScale || 0);\r\n\r\n if (time !== lastHTML5State.time) {\r\n\r\n lastHTML5State.time = time;\r\n isNew = true;\r\n\r\n }\r\n\r\n if (isNew || bForce) {\r\n\r\n s._whileplaying(time, x, x, x, x);\r\n\r\n }\r\n\r\n }/* else {\r\n\r\n // sm2._wD('_onTimer: Warn for \"'+s.id+'\": '+(!s._a?'Could not find element. ':'')+(s.playState === 0?'playState bad, 0?':'playState = '+s.playState+', OK'));\r\n\r\n return false;\r\n\r\n }*/\r\n\r\n }\r\n\r\n return isNew;\r\n\r\n };\r\n\r\n this._get_html5_duration = function() {\r\n\r\n var instanceOptions = s._iO,\r\n // if audio object exists, use its duration - else, instance option duration (if provided - it's a hack, really, and should be retired) OR null\r\n d = (s._a && s._a.duration ? s._a.duration * msecScale : (instanceOptions && instanceOptions.duration ? instanceOptions.duration : null)),\r\n result = (d && !isNaN(d) && d !== Infinity ? d : null);\r\n\r\n return result;\r\n\r\n };\r\n\r\n this._apply_loop = function(a, nLoops) {\r\n\r\n /**\r\n * boolean instead of \"loop\", for webkit? - spec says string. http://www.w3.org/TR/html-markup/audio.html#audio.attrs.loop\r\n * note that loop is either off or infinite under HTML5, unlike Flash which allows arbitrary loop counts to be specified.\r\n */\r\n\r\n // <d>\r\n if (!a.loop && nLoops > 1) {\r\n sm2._wD('Note: Native HTML5 looping is infinite.', 1);\r\n }\r\n // </d>\r\n\r\n a.loop = (nLoops > 1 ? 'loop' : '');\r\n\r\n };\r\n\r\n this._setup_html5 = function(options) {\r\n\r\n var instanceOptions = mixin(s._iO, options),\r\n a = useGlobalHTML5Audio ? globalHTML5Audio : s._a,\r\n dURL = decodeURI(instanceOptions.url),\r\n sameURL;\r\n\r\n /**\r\n * \"First things first, I, Poppa...\" (reset the previous state of the old sound, if playing)\r\n * Fixes case with devices that can only play one sound at a time\r\n * Otherwise, other sounds in mid-play will be terminated without warning and in a stuck state\r\n */\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n if (dURL === decodeURI(lastGlobalHTML5URL)) {\r\n // global HTML5 audio: re-use of URL\r\n sameURL = true;\r\n }\r\n\r\n } else if (dURL === decodeURI(lastURL)) {\r\n\r\n // options URL is the same as the \"last\" URL, and we used (loaded) it\r\n sameURL = true;\r\n\r\n }\r\n\r\n if (a) {\r\n\r\n if (a._s) {\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n if (a._s && a._s.playState && !sameURL) {\r\n\r\n // global HTML5 audio case, and loading a new URL. stop the currently-playing one.\r\n a._s.stop();\r\n\r\n }\r\n\r\n } else if (!useGlobalHTML5Audio && dURL === decodeURI(lastURL)) {\r\n\r\n // non-global HTML5 reuse case: same url, ignore request\r\n s._apply_loop(a, instanceOptions.loops);\r\n\r\n return a;\r\n\r\n }\r\n\r\n }\r\n\r\n if (!sameURL) {\r\n\r\n // don't retain onPosition() stuff with new URLs.\r\n\r\n if (lastURL) {\r\n resetProperties(false);\r\n }\r\n\r\n // assign new HTML5 URL\r\n\r\n a.src = instanceOptions.url;\r\n\r\n s.url = instanceOptions.url;\r\n\r\n lastURL = instanceOptions.url;\r\n\r\n lastGlobalHTML5URL = instanceOptions.url;\r\n\r\n a._called_load = false;\r\n\r\n }\r\n\r\n } else {\r\n\r\n if (instanceOptions.autoLoad || instanceOptions.autoPlay) {\r\n\r\n s._a = new Audio(instanceOptions.url);\r\n s._a.load();\r\n\r\n } else {\r\n\r\n // null for stupid Opera 9.64 case\r\n s._a = (isOpera && opera.version() < 10 ? new Audio(null) : new Audio());\r\n\r\n }\r\n\r\n // assign local reference\r\n a = s._a;\r\n\r\n a._called_load = false;\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n globalHTML5Audio = a;\r\n\r\n }\r\n\r\n }\r\n\r\n s.isHTML5 = true;\r\n\r\n // store a ref on the track\r\n s._a = a;\r\n\r\n // store a ref on the audio\r\n a._s = s;\r\n\r\n add_html5_events();\r\n\r\n s._apply_loop(a, instanceOptions.loops);\r\n\r\n if (instanceOptions.autoLoad || instanceOptions.autoPlay) {\r\n\r\n s.load();\r\n\r\n } else {\r\n\r\n // early HTML5 implementation (non-standard)\r\n a.autobuffer = false;\r\n\r\n // standard ('none' is also an option.)\r\n a.preload = 'auto';\r\n\r\n }\r\n\r\n return a;\r\n\r\n };\r\n\r\n add_html5_events = function() {\r\n\r\n if (s._a._added_events) return false;\r\n\r\n var f;\r\n\r\n function add(oEvt, oFn, bCapture) {\r\n return s._a ? s._a.addEventListener(oEvt, oFn, bCapture || false) : null;\r\n }\r\n\r\n s._a._added_events = true;\r\n\r\n for (f in html5_events) {\r\n if (html5_events.hasOwnProperty(f)) {\r\n add(f, html5_events[f]);\r\n }\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n remove_html5_events = function() {\r\n\r\n // Remove event listeners\r\n\r\n var f;\r\n\r\n function remove(oEvt, oFn, bCapture) {\r\n return (s._a ? s._a.removeEventListener(oEvt, oFn, bCapture || false) : null);\r\n }\r\n\r\n sm2._wD(s.id + ': Removing event listeners');\r\n s._a._added_events = false;\r\n\r\n for (f in html5_events) {\r\n if (html5_events.hasOwnProperty(f)) {\r\n remove(f, html5_events[f]);\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Pseudo-private event internals\r\n * ------------------------------\r\n */\r\n\r\n this._onload = function(nSuccess) {\r\n\r\n var fN,\r\n // check for duration to prevent false positives from flash 8 when loading from cache.\r\n loadOK = !!nSuccess || (!s.isHTML5 && fV === 8 && s.duration);\r\n\r\n // <d>\r\n fN = s.id + ': ';\r\n sm2._wD(fN + (loadOK ? 'onload()' : 'Failed to load / invalid sound?' + (!s.duration ? ' Zero-length duration reported.' : ' -') + ' (' + s.url + ')'), (loadOK ? 1 : 2));\r\n\r\n if (!loadOK && !s.isHTML5) {\r\n if (sm2.sandbox.noRemote === true) {\r\n sm2._wD(fN + str('noNet'), 1);\r\n }\r\n if (sm2.sandbox.noLocal === true) {\r\n sm2._wD(fN + str('noLocal'), 1);\r\n }\r\n }\r\n // </d>\r\n\r\n s.loaded = loadOK;\r\n s.readyState = (loadOK ? 3 : 2);\r\n s._onbufferchange(0);\r\n\r\n if (!loadOK && !s.isHTML5) {\r\n // note: no error code from Flash.\r\n s._onerror();\r\n }\r\n\r\n if (s._iO.onload) {\r\n wrapCallback(s, function() {\r\n s._iO.onload.apply(s, [loadOK]);\r\n });\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._onerror = function(errorCode, description) {\r\n\r\n // https://html.spec.whatwg.org/multipage/embedded-content.html#error-codes\r\n if (s._iO.onerror) {\r\n wrapCallback(s, function() {\r\n s._iO.onerror.apply(s, [errorCode, description]);\r\n });\r\n }\r\n\r\n };\r\n\r\n this._onbufferchange = function(nIsBuffering) {\r\n\r\n // ignore if not playing\r\n if (s.playState === 0) return false;\r\n\r\n if ((nIsBuffering && s.isBuffering) || (!nIsBuffering && !s.isBuffering)) return false;\r\n\r\n s.isBuffering = (nIsBuffering === 1);\r\n\r\n if (s._iO.onbufferchange) {\r\n sm2._wD(s.id + ': Buffer state change: ' + nIsBuffering);\r\n s._iO.onbufferchange.apply(s, [nIsBuffering]);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Playback may have stopped due to buffering, or related reason.\r\n * This state can be encountered on iOS < 6 when auto-play is blocked.\r\n */\r\n\r\n this._onsuspend = function() {\r\n\r\n if (s._iO.onsuspend) {\r\n sm2._wD(s.id + ': Playback suspended');\r\n s._iO.onsuspend.apply(s);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * flash 9/movieStar + RTMP-only method, should fire only once at most\r\n * at this point we just recreate failed sounds rather than trying to reconnect\r\n */\r\n\r\n this._onfailure = function(msg, level, code) {\r\n\r\n s.failures++;\r\n sm2._wD(s.id + ': Failure (' + s.failures + '): ' + msg);\r\n\r\n if (s._iO.onfailure && s.failures === 1) {\r\n s._iO.onfailure(msg, level, code);\r\n } else {\r\n sm2._wD(s.id + ': Ignoring failure');\r\n }\r\n\r\n };\r\n\r\n /**\r\n * flash 9/movieStar + RTMP-only method for unhandled warnings/exceptions from Flash\r\n * e.g., RTMP \"method missing\" warning (non-fatal) for getStreamLength on server\r\n */\r\n\r\n this._onwarning = function(msg, level, code) {\r\n\r\n if (s._iO.onwarning) {\r\n s._iO.onwarning(msg, level, code);\r\n }\r\n\r\n };\r\n\r\n this._onfinish = function() {\r\n\r\n // store local copy before it gets trashed...\r\n var io_onfinish = s._iO.onfinish;\r\n\r\n s._onbufferchange(0);\r\n s._resetOnPosition(0);\r\n\r\n // reset some state items\r\n if (s.instanceCount) {\r\n\r\n s.instanceCount--;\r\n\r\n if (!s.instanceCount) {\r\n\r\n // remove onPosition listeners, if any\r\n detachOnPosition();\r\n\r\n // reset instance options\r\n s.playState = 0;\r\n s.paused = false;\r\n s.instanceCount = 0;\r\n s.instanceOptions = {};\r\n s._iO = {};\r\n stop_html5_timer();\r\n\r\n // reset position, too\r\n if (s.isHTML5) {\r\n s.position = 0;\r\n }\r\n\r\n }\r\n\r\n if (!s.instanceCount || s._iO.multiShotEvents) {\r\n // fire onfinish for last, or every instance\r\n if (io_onfinish) {\r\n sm2._wD(s.id + ': onfinish()');\r\n wrapCallback(s, function() {\r\n io_onfinish.apply(s);\r\n });\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) {\r\n\r\n var instanceOptions = s._iO;\r\n\r\n s.bytesLoaded = nBytesLoaded;\r\n s.bytesTotal = nBytesTotal;\r\n s.duration = Math.floor(nDuration);\r\n s.bufferLength = nBufferLength;\r\n\r\n if (!s.isHTML5 && !instanceOptions.isMovieStar) {\r\n\r\n if (instanceOptions.duration) {\r\n // use duration from options, if specified and larger. nobody should be specifying duration in options, actually, and it should be retired.\r\n s.durationEstimate = (s.duration > instanceOptions.duration) ? s.duration : instanceOptions.duration;\r\n } else {\r\n s.durationEstimate = parseInt((s.bytesTotal / s.bytesLoaded) * s.duration, 10);\r\n }\r\n\r\n } else {\r\n\r\n s.durationEstimate = s.duration;\r\n\r\n }\r\n\r\n // for flash, reflect sequential-load-style buffering\r\n if (!s.isHTML5) {\r\n s.buffered = [{\r\n start: 0,\r\n end: s.duration\r\n }];\r\n }\r\n\r\n // allow whileloading to fire even if \"load\" fired under HTML5, due to HTTP range/partials\r\n if ((s.readyState !== 3 || s.isHTML5) && instanceOptions.whileloading) {\r\n instanceOptions.whileloading.apply(s);\r\n }\r\n\r\n };\r\n\r\n this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) {\r\n\r\n var instanceOptions = s._iO,\r\n eqLeft;\r\n\r\n // flash safety net\r\n if (isNaN(nPosition) || nPosition === null) return false;\r\n\r\n // Safari HTML5 play() may return small -ve values when starting from position: 0, eg. -50.120396875. Unexpected/invalid per W3, I think. Normalize to 0.\r\n s.position = Math.max(0, nPosition);\r\n\r\n s._processOnPosition();\r\n\r\n if (!s.isHTML5 && fV > 8) {\r\n\r\n if (instanceOptions.usePeakData && oPeakData !== _undefined && oPeakData) {\r\n s.peakData = {\r\n left: oPeakData.leftPeak,\r\n right: oPeakData.rightPeak\r\n };\r\n }\r\n\r\n if (instanceOptions.useWaveformData && oWaveformDataLeft !== _undefined && oWaveformDataLeft) {\r\n s.waveformData = {\r\n left: oWaveformDataLeft.split(','),\r\n right: oWaveformDataRight.split(',')\r\n };\r\n }\r\n\r\n if (instanceOptions.useEQData) {\r\n if (oEQData !== _undefined && oEQData && oEQData.leftEQ) {\r\n eqLeft = oEQData.leftEQ.split(',');\r\n s.eqData = eqLeft;\r\n s.eqData.left = eqLeft;\r\n if (oEQData.rightEQ !== _undefined && oEQData.rightEQ) {\r\n s.eqData.right = oEQData.rightEQ.split(',');\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n if (s.playState === 1) {\r\n\r\n // special case/hack: ensure buffering is false if loading from cache (and not yet started)\r\n if (!s.isHTML5 && fV === 8 && !s.position && s.isBuffering) {\r\n s._onbufferchange(0);\r\n }\r\n\r\n if (instanceOptions.whileplaying) {\r\n // flash may call after actual finish\r\n instanceOptions.whileplaying.apply(s);\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._oncaptiondata = function(oData) {\r\n\r\n /**\r\n * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature\r\n *\r\n * @param {object} oData\r\n */\r\n\r\n sm2._wD(s.id + ': Caption data received.');\r\n\r\n s.captiondata = oData;\r\n\r\n if (s._iO.oncaptiondata) {\r\n s._iO.oncaptiondata.apply(s, [oData]);\r\n }\r\n\r\n };\r\n\r\n this._onmetadata = function(oMDProps, oMDData) {\r\n\r\n /**\r\n * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature\r\n * RTMP may include song title, MovieStar content may include encoding info\r\n *\r\n * @param {array} oMDProps (names)\r\n * @param {array} oMDData (values)\r\n */\r\n\r\n sm2._wD(s.id + ': Metadata received.');\r\n\r\n var oData = {}, i, j;\r\n\r\n for (i = 0, j = oMDProps.length; i < j; i++) {\r\n oData[oMDProps[i]] = oMDData[i];\r\n }\r\n\r\n s.metadata = oData;\r\n\r\n if (s._iO.onmetadata) {\r\n s._iO.onmetadata.call(s, s.metadata);\r\n }\r\n\r\n };\r\n\r\n this._onid3 = function(oID3Props, oID3Data) {\r\n\r\n /**\r\n * internal: flash 8 + flash 9 ID3 feature\r\n * may include artist, song title etc.\r\n *\r\n * @param {array} oID3Props (names)\r\n * @param {array} oID3Data (values)\r\n */\r\n\r\n sm2._wD(s.id + ': ID3 data received.');\r\n\r\n var oData = [], i, j;\r\n\r\n for (i = 0, j = oID3Props.length; i < j; i++) {\r\n oData[oID3Props[i]] = oID3Data[i];\r\n }\r\n\r\n s.id3 = mixin(s.id3, oData);\r\n\r\n if (s._iO.onid3) {\r\n s._iO.onid3.apply(s);\r\n }\r\n\r\n };\r\n\r\n // flash/RTMP-only\r\n\r\n this._onconnect = function(bSuccess) {\r\n\r\n bSuccess = (bSuccess === 1);\r\n sm2._wD(s.id + ': ' + (bSuccess ? 'Connected.' : 'Failed to connect? - ' + s.url), (bSuccess ? 1 : 2));\r\n s.connected = bSuccess;\r\n\r\n if (bSuccess) {\r\n\r\n s.failures = 0;\r\n\r\n if (idCheck(s.id)) {\r\n if (s.getAutoPlay()) {\r\n // only update the play state if auto playing\r\n s.play(_undefined, s.getAutoPlay());\r\n } else if (s._iO.autoLoad) {\r\n s.load();\r\n }\r\n }\r\n\r\n if (s._iO.onconnect) {\r\n s._iO.onconnect.apply(s, [bSuccess]);\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._ondataerror = function(sError) {\r\n\r\n // flash 9 wave/eq data handler\r\n // hack: called at start, and end from flash at/after onfinish()\r\n if (s.playState > 0) {\r\n sm2._wD(s.id + ': Data error: ' + sError);\r\n if (s._iO.ondataerror) {\r\n s._iO.ondataerror.apply(s);\r\n }\r\n }\r\n\r\n };\r\n\r\n // <d>\r\n this._debug();\r\n // </d>\r\n\r\n }; // SMSound()\r\n\r\n /**\r\n * Private SoundManager internals\r\n * ------------------------------\r\n */\r\n\r\n getDocument = function() {\r\n\r\n return (doc.body || doc.getElementsByTagName('div')[0]);\r\n\r\n };\r\n\r\n id = function(sID) {\r\n\r\n return doc.getElementById(sID);\r\n\r\n };\r\n\r\n mixin = function(oMain, oAdd) {\r\n\r\n // non-destructive merge\r\n var o1 = (oMain || {}), o2, o;\r\n\r\n // if unspecified, o2 is the default options object\r\n o2 = (oAdd === _undefined ? sm2.defaultOptions : oAdd);\r\n\r\n for (o in o2) {\r\n\r\n if (o2.hasOwnProperty(o) && o1[o] === _undefined) {\r\n\r\n if (typeof o2[o] !== 'object' || o2[o] === null) {\r\n\r\n // assign directly\r\n o1[o] = o2[o];\r\n\r\n } else {\r\n\r\n // recurse through o2\r\n o1[o] = mixin(o1[o], o2[o]);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return o1;\r\n\r\n };\r\n\r\n wrapCallback = function(oSound, callback) {\r\n\r\n /**\r\n * 03/03/2013: Fix for Flash Player 11.6.602.171 + Flash 8 (flashVersion = 8) SWF issue\r\n * setTimeout() fix for certain SMSound callbacks like onload() and onfinish(), where subsequent calls like play() and load() fail when Flash Player 11.6.602.171 is installed, and using soundManager with flashVersion = 8 (which is the default).\r\n * Not sure of exact cause. Suspect race condition and/or invalid (NaN-style) position argument trickling down to the next JS -> Flash _start() call, in the play() case.\r\n * Fix: setTimeout() to yield, plus safer null / NaN checking on position argument provided to Flash.\r\n * https://getsatisfaction.com/schillmania/topics/recent_chrome_update_seems_to_have_broken_my_sm2_audio_player\r\n */\r\n if (!oSound.isHTML5 && fV === 8) {\r\n window.setTimeout(callback, 0);\r\n } else {\r\n callback();\r\n }\r\n\r\n };\r\n\r\n // additional soundManager properties that soundManager.setup() will accept\r\n\r\n extraOptions = {\r\n onready: 1,\r\n ontimeout: 1,\r\n defaultOptions: 1,\r\n flash9Options: 1,\r\n movieStarOptions: 1\r\n };\r\n\r\n assign = function(o, oParent) {\r\n\r\n /**\r\n * recursive assignment of properties, soundManager.setup() helper\r\n * allows property assignment based on whitelist\r\n */\r\n\r\n var i,\r\n result = true,\r\n hasParent = (oParent !== _undefined),\r\n setupOptions = sm2.setupOptions,\r\n bonusOptions = extraOptions;\r\n\r\n // <d>\r\n\r\n // if soundManager.setup() called, show accepted parameters.\r\n\r\n if (o === _undefined) {\r\n\r\n result = [];\r\n\r\n for (i in setupOptions) {\r\n\r\n if (setupOptions.hasOwnProperty(i)) {\r\n result.push(i);\r\n }\r\n\r\n }\r\n\r\n for (i in bonusOptions) {\r\n\r\n if (bonusOptions.hasOwnProperty(i)) {\r\n\r\n if (typeof sm2[i] === 'object') {\r\n result.push(i + ': {...}');\r\n } else if (sm2[i] instanceof Function) {\r\n result.push(i + ': function() {...}');\r\n } else {\r\n result.push(i);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n sm2._wD(str('setup', result.join(', ')));\r\n\r\n return false;\r\n\r\n }\r\n\r\n // </d>\r\n\r\n for (i in o) {\r\n\r\n if (o.hasOwnProperty(i)) {\r\n\r\n // if not an {object} we want to recurse through...\r\n\r\n if (typeof o[i] !== 'object' || o[i] === null || o[i] instanceof Array || o[i] instanceof RegExp) {\r\n\r\n // check \"allowed\" options\r\n\r\n if (hasParent && bonusOptions[oParent] !== _undefined) {\r\n\r\n // valid recursive / nested object option, eg., { defaultOptions: { volume: 50 } }\r\n sm2[oParent][i] = o[i];\r\n\r\n } else if (setupOptions[i] !== _undefined) {\r\n\r\n // special case: assign to setupOptions object, which soundManager property references\r\n sm2.setupOptions[i] = o[i];\r\n\r\n // assign directly to soundManager, too\r\n sm2[i] = o[i];\r\n\r\n } else if (bonusOptions[i] === _undefined) {\r\n\r\n // invalid or disallowed parameter. complain.\r\n complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);\r\n\r\n result = false;\r\n\r\n } else if (sm2[i] instanceof Function) {\r\n\r\n /**\r\n * valid extraOptions (bonusOptions) parameter.\r\n * is it a method, like onready/ontimeout? call it.\r\n * multiple parameters should be in an array, eg. soundManager.setup({onready: [myHandler, myScope]});\r\n */\r\n sm2[i].apply(sm2, (o[i] instanceof Array ? o[i] : [o[i]]));\r\n\r\n } else {\r\n\r\n // good old-fashioned direct assignment\r\n sm2[i] = o[i];\r\n\r\n }\r\n\r\n } else if (bonusOptions[i] === _undefined) {\r\n\r\n // recursion case, eg., { defaultOptions: { ... } }\r\n\r\n // invalid or disallowed parameter. complain.\r\n complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n // recurse through object\r\n return assign(o[i], i);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n function preferFlashCheck(kind) {\r\n\r\n // whether flash should play a given type\r\n return (sm2.preferFlash && hasFlash && !sm2.ignoreFlash && (sm2.flash[kind] !== _undefined && sm2.flash[kind]));\r\n\r\n }\r\n\r\n /**\r\n * Internal DOM2-level event helpers\r\n * ---------------------------------\r\n */\r\n\r\n event = (function() {\r\n\r\n // normalize event methods\r\n var old = (window.attachEvent),\r\n evt = {\r\n add: (old ? 'attachEvent' : 'addEventListener'),\r\n remove: (old ? 'detachEvent' : 'removeEventListener')\r\n };\r\n\r\n // normalize \"on\" event prefix, optional capture argument\r\n function getArgs(oArgs) {\r\n\r\n var args = slice.call(oArgs),\r\n len = args.length;\r\n\r\n if (old) {\r\n // prefix\r\n args[1] = 'on' + args[1];\r\n if (len > 3) {\r\n // no capture\r\n args.pop();\r\n }\r\n } else if (len === 3) {\r\n args.push(false);\r\n }\r\n\r\n return args;\r\n\r\n }\r\n\r\n function apply(args, sType) {\r\n\r\n // normalize and call the event method, with the proper arguments\r\n var element = args.shift(),\r\n method = [evt[sType]];\r\n\r\n if (old) {\r\n // old IE can't do apply().\r\n element[method](args[0], args[1]);\r\n } else {\r\n element[method].apply(element, args);\r\n }\r\n\r\n }\r\n\r\n function add() {\r\n apply(getArgs(arguments), 'add');\r\n }\r\n\r\n function remove() {\r\n apply(getArgs(arguments), 'remove');\r\n }\r\n\r\n return {\r\n add: add,\r\n remove: remove\r\n };\r\n\r\n }());\r\n\r\n /**\r\n * Internal HTML5 event handling\r\n * -----------------------------\r\n */\r\n\r\n function html5_event(oFn) {\r\n\r\n // wrap html5 event handlers so we don't call them on destroyed and/or unloaded sounds\r\n\r\n return function(e) {\r\n\r\n var s = this._s,\r\n result;\r\n\r\n if (!s || !s._a) {\r\n // <d>\r\n if (s && s.id) {\r\n sm2._wD(s.id + ': Ignoring ' + e.type);\r\n } else {\r\n sm2._wD(h5 + 'Ignoring ' + e.type);\r\n }\r\n // </d>\r\n result = null;\r\n } else {\r\n result = oFn.call(this, e);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n }\r\n\r\n html5_events = {\r\n\r\n // HTML5 event-name-to-handler map\r\n\r\n abort: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': abort');\r\n\r\n }),\r\n\r\n // enough has loaded to play\r\n\r\n canplay: html5_event(function() {\r\n\r\n var s = this._s,\r\n position1K;\r\n\r\n if (s._html5_canplay) {\r\n // this event has already fired. ignore.\r\n return;\r\n }\r\n\r\n s._html5_canplay = true;\r\n sm2._wD(s.id + ': canplay');\r\n s._onbufferchange(0);\r\n\r\n // position according to instance options\r\n position1K = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position / msecScale : null);\r\n\r\n // set the position if position was provided before the sound loaded\r\n if (this.currentTime !== position1K) {\r\n sm2._wD(s.id + ': canplay: Setting position to ' + position1K);\r\n try {\r\n this.currentTime = position1K;\r\n } catch(ee) {\r\n sm2._wD(s.id + ': canplay: Setting position of ' + position1K + ' failed: ' + ee.message, 2);\r\n }\r\n }\r\n\r\n // hack for HTML5 from/to case\r\n if (s._iO._oncanplay) {\r\n s._iO._oncanplay();\r\n }\r\n\r\n }),\r\n\r\n canplaythrough: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n if (!s.loaded) {\r\n s._onbufferchange(0);\r\n s._whileloading(s.bytesLoaded, s.bytesTotal, s._get_html5_duration());\r\n s._onload(true);\r\n }\r\n\r\n }),\r\n\r\n durationchange: html5_event(function() {\r\n\r\n // durationchange may fire at various times, probably the safest way to capture accurate/final duration.\r\n\r\n var s = this._s,\r\n duration;\r\n\r\n duration = s._get_html5_duration();\r\n\r\n if (!isNaN(duration) && duration !== s.duration) {\r\n\r\n sm2._wD(this._s.id + ': durationchange (' + duration + ')' + (s.duration ? ', previously ' + s.duration : ''));\r\n\r\n s.durationEstimate = s.duration = duration;\r\n\r\n }\r\n\r\n }),\r\n\r\n // TODO: Reserved for potential use\r\n /*\r\n emptied: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': emptied');\r\n\r\n }),\r\n */\r\n\r\n ended: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n sm2._wD(s.id + ': ended');\r\n\r\n s._onfinish();\r\n\r\n }),\r\n\r\n error: html5_event(function() {\r\n\r\n var description = (html5ErrorCodes[this.error.code] || null);\r\n sm2._wD(this._s.id + ': HTML5 error, code ' + this.error.code + (description ? ' (' + description + ')' : ''));\r\n this._s._onload(false);\r\n this._s._onerror(this.error.code, description);\r\n\r\n }),\r\n\r\n loadeddata: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n sm2._wD(s.id + ': loadeddata');\r\n\r\n // safari seems to nicely report progress events, eventually totalling 100%\r\n if (!s._loaded && !isSafari) {\r\n s.duration = s._get_html5_duration();\r\n }\r\n\r\n }),\r\n\r\n loadedmetadata: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': loadedmetadata');\r\n\r\n }),\r\n\r\n loadstart: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': loadstart');\r\n // assume buffering at first\r\n this._s._onbufferchange(1);\r\n\r\n }),\r\n\r\n play: html5_event(function() {\r\n\r\n // sm2._wD(this._s.id + ': play()');\r\n // once play starts, no buffering\r\n this._s._onbufferchange(0);\r\n\r\n }),\r\n\r\n playing: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': playing ' + String.fromCharCode(9835));\r\n // once play starts, no buffering\r\n this._s._onbufferchange(0);\r\n\r\n }),\r\n\r\n progress: html5_event(function(e) {\r\n\r\n // note: can fire repeatedly after \"loaded\" event, due to use of HTTP range/partials\r\n\r\n var s = this._s,\r\n i, j, progStr, buffered = 0,\r\n isProgress = (e.type === 'progress'),\r\n ranges = e.target.buffered,\r\n // firefox 3.6 implements e.loaded/total (bytes)\r\n loaded = (e.loaded || 0),\r\n total = (e.total || 1);\r\n\r\n // reset the \"buffered\" (loaded byte ranges) array\r\n s.buffered = [];\r\n\r\n if (ranges && ranges.length) {\r\n\r\n // if loaded is 0, try TimeRanges implementation as % of load\r\n // https://developer.mozilla.org/en/DOM/TimeRanges\r\n\r\n // re-build \"buffered\" array\r\n // HTML5 returns seconds. SM2 API uses msec for setPosition() etc., whether Flash or HTML5.\r\n for (i = 0, j = ranges.length; i < j; i++) {\r\n s.buffered.push({\r\n start: ranges.start(i) * msecScale,\r\n end: ranges.end(i) * msecScale\r\n });\r\n }\r\n\r\n // use the last value locally\r\n buffered = (ranges.end(0) - ranges.start(0)) * msecScale;\r\n\r\n // linear case, buffer sum; does not account for seeking and HTTP partials / byte ranges\r\n loaded = Math.min(1, buffered / (e.target.duration * msecScale));\r\n\r\n // <d>\r\n if (isProgress && ranges.length > 1) {\r\n progStr = [];\r\n j = ranges.length;\r\n for (i = 0; i < j; i++) {\r\n progStr.push((e.target.buffered.start(i) * msecScale) + '-' + (e.target.buffered.end(i) * msecScale));\r\n }\r\n sm2._wD(this._s.id + ': progress, timeRanges: ' + progStr.join(', '));\r\n }\r\n\r\n if (isProgress && !isNaN(loaded)) {\r\n sm2._wD(this._s.id + ': progress, ' + Math.floor(loaded * 100) + '% loaded');\r\n }\r\n // </d>\r\n\r\n }\r\n\r\n if (!isNaN(loaded)) {\r\n\r\n // TODO: prevent calls with duplicate values.\r\n s._whileloading(loaded, total, s._get_html5_duration());\r\n if (loaded && total && loaded === total) {\r\n // in case \"onload\" doesn't fire (eg. gecko 1.9.2)\r\n html5_events.canplaythrough.call(this, e);\r\n }\r\n\r\n }\r\n\r\n }),\r\n\r\n ratechange: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': ratechange');\r\n\r\n }),\r\n\r\n suspend: html5_event(function(e) {\r\n\r\n // download paused/stopped, may have finished (eg. onload)\r\n var s = this._s;\r\n\r\n sm2._wD(this._s.id + ': suspend');\r\n html5_events.progress.call(this, e);\r\n s._onsuspend();\r\n\r\n }),\r\n\r\n stalled: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': stalled');\r\n\r\n }),\r\n\r\n timeupdate: html5_event(function() {\r\n\r\n this._s._onTimer();\r\n\r\n }),\r\n\r\n waiting: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n // see also: seeking\r\n sm2._wD(this._s.id + ': waiting');\r\n\r\n // playback faster than download rate, etc.\r\n s._onbufferchange(1);\r\n\r\n })\r\n\r\n };\r\n\r\n html5OK = function(iO) {\r\n\r\n // playability test based on URL or MIME type\r\n\r\n var result;\r\n\r\n if (!iO || (!iO.type && !iO.url && !iO.serverURL)) {\r\n\r\n // nothing to check\r\n result = false;\r\n\r\n } else if (iO.serverURL || (iO.type && preferFlashCheck(iO.type))) {\r\n\r\n // RTMP, or preferring flash\r\n result = false;\r\n\r\n } else {\r\n\r\n // Use type, if specified. Pass data: URIs to HTML5. If HTML5-only mode, no other options, so just give 'er\r\n result = ((iO.type ? html5CanPlay({ type: iO.type }) : html5CanPlay({ url: iO.url }) || sm2.html5Only || iO.url.match(/data:/i)));\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n html5Unload = function(oAudio) {\r\n\r\n /**\r\n * Internal method: Unload media, and cancel any current/pending network requests.\r\n * Firefox can load an empty URL, which allegedly destroys the decoder and stops the download.\r\n * https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox#Stopping_the_download_of_media\r\n * However, Firefox has been seen loading a relative URL from '' and thus requesting the hosting page on unload.\r\n * Other UA behaviour is unclear, so everyone else gets an about:blank-style URL.\r\n */\r\n\r\n var url;\r\n\r\n if (oAudio) {\r\n\r\n // Firefox and Chrome accept short WAVe data: URIs. Chome dislikes audio/wav, but accepts audio/wav for data: MIME.\r\n // Desktop Safari complains / fails on data: URI, so it gets about:blank.\r\n url = (isSafari ? emptyURL : (sm2.html5.canPlayType('audio/wav') ? emptyWAV : emptyURL));\r\n\r\n oAudio.src = url;\r\n\r\n // reset some state, too\r\n if (oAudio._called_unload !== _undefined) {\r\n oAudio._called_load = false;\r\n }\r\n\r\n }\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n // ensure URL state is trashed, also\r\n lastGlobalHTML5URL = null;\r\n\r\n }\r\n\r\n return url;\r\n\r\n };\r\n\r\n html5CanPlay = function(o) {\r\n\r\n /**\r\n * Try to find MIME, test and return truthiness\r\n * o = {\r\n * url: '/path/to/an.mp3',\r\n * type: 'audio/mp3'\r\n * }\r\n */\r\n\r\n if (!sm2.useHTML5Audio || !sm2.hasHTML5) return false;\r\n\r\n var url = (o.url || null),\r\n mime = (o.type || null),\r\n aF = sm2.audioFormats,\r\n result,\r\n offset,\r\n fileExt,\r\n item;\r\n\r\n // account for known cases like audio/mp3\r\n\r\n if (mime && sm2.html5[mime] !== _undefined) return (sm2.html5[mime] && !preferFlashCheck(mime));\r\n\r\n if (!html5Ext) {\r\n\r\n html5Ext = [];\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n html5Ext.push(item);\r\n\r\n if (aF[item].related) {\r\n html5Ext = html5Ext.concat(aF[item].related);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n html5Ext = new RegExp('\\\\.(' + html5Ext.join('|') + ')(\\\\?.*)?$', 'i');\r\n\r\n }\r\n\r\n // TODO: Strip URL queries, etc.\r\n fileExt = (url ? url.toLowerCase().match(html5Ext) : null);\r\n\r\n if (!fileExt || !fileExt.length) {\r\n\r\n if (!mime) {\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n // audio/mp3 -> mp3, result should be known\r\n offset = mime.indexOf(';');\r\n\r\n // strip \"audio/X; codecs...\"\r\n fileExt = (offset !== -1 ? mime.substr(0, offset) : mime).substr(6);\r\n\r\n }\r\n\r\n } else {\r\n\r\n // match the raw extension name - \"mp3\", for example\r\n fileExt = fileExt[1];\r\n\r\n }\r\n\r\n if (fileExt && sm2.html5[fileExt] !== _undefined) {\r\n\r\n // result known\r\n result = (sm2.html5[fileExt] && !preferFlashCheck(fileExt));\r\n\r\n } else {\r\n\r\n mime = 'audio/' + fileExt;\r\n result = sm2.html5.canPlayType({ type: mime });\r\n\r\n sm2.html5[fileExt] = result;\r\n\r\n // sm2._wD('canPlayType, found result: ' + result);\r\n result = (result && sm2.html5[mime] && !preferFlashCheck(mime));\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n testHTML5 = function() {\r\n\r\n /**\r\n * Internal: Iterates over audioFormats, determining support eg. audio/mp3, audio/mpeg and so on\r\n * assigns results to html5[] and flash[].\r\n */\r\n\r\n if (!sm2.useHTML5Audio || !sm2.hasHTML5) {\r\n\r\n // without HTML5, we need Flash.\r\n sm2.html5.usingFlash = true;\r\n needsFlash = true;\r\n\r\n return false;\r\n\r\n }\r\n\r\n // double-whammy: Opera 9.64 throws WRONG_ARGUMENTS_ERR if no parameter passed to Audio(), and Webkit + iOS happily tries to load \"null\" as a URL. :/\r\n var a = (Audio !== _undefined ? (isOpera && opera.version() < 10 ? new Audio(null) : new Audio()) : null),\r\n item, lookup, support = {}, aF, i;\r\n\r\n function cp(m) {\r\n\r\n var canPlay, j,\r\n result = false,\r\n isOK = false;\r\n\r\n if (!a || typeof a.canPlayType !== 'function') return result;\r\n\r\n if (m instanceof Array) {\r\n\r\n // iterate through all mime types, return any successes\r\n\r\n for (i = 0, j = m.length; i < j; i++) {\r\n\r\n if (sm2.html5[m[i]] || a.canPlayType(m[i]).match(sm2.html5Test)) {\r\n\r\n isOK = true;\r\n sm2.html5[m[i]] = true;\r\n\r\n // note flash support, too\r\n sm2.flash[m[i]] = !!(m[i].match(flashMIME));\r\n\r\n }\r\n\r\n }\r\n\r\n result = isOK;\r\n\r\n } else {\r\n\r\n canPlay = (a && typeof a.canPlayType === 'function' ? a.canPlayType(m) : false);\r\n result = !!(canPlay && (canPlay.match(sm2.html5Test)));\r\n\r\n }\r\n\r\n return result;\r\n\r\n }\r\n\r\n // test all registered formats + codecs\r\n\r\n aF = sm2.audioFormats;\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n lookup = 'audio/' + item;\r\n\r\n support[item] = cp(aF[item].type);\r\n\r\n // write back generic type too, eg. audio/mp3\r\n support[lookup] = support[item];\r\n\r\n // assign flash\r\n if (item.match(flashMIME)) {\r\n\r\n sm2.flash[item] = true;\r\n sm2.flash[lookup] = true;\r\n\r\n } else {\r\n\r\n sm2.flash[item] = false;\r\n sm2.flash[lookup] = false;\r\n\r\n }\r\n\r\n // assign result to related formats, too\r\n\r\n if (aF[item] && aF[item].related) {\r\n\r\n for (i = aF[item].related.length - 1; i >= 0; i--) {\r\n\r\n // eg. audio/m4a\r\n support['audio/' + aF[item].related[i]] = support[item];\r\n sm2.html5[aF[item].related[i]] = support[item];\r\n sm2.flash[aF[item].related[i]] = support[item];\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n support.canPlayType = (a ? cp : null);\r\n sm2.html5 = mixin(sm2.html5, support);\r\n\r\n sm2.html5.usingFlash = featureCheck();\r\n needsFlash = sm2.html5.usingFlash;\r\n\r\n return true;\r\n\r\n };\r\n\r\n strings = {\r\n\r\n // <d>\r\n notReady: 'Unavailable - wait until onready() has fired.',\r\n notOK: 'Audio support is not available.',\r\n domError: sm + 'exception caught while appending SWF to DOM.',\r\n spcWmode: 'Removing wmode, preventing known SWF loading issue(s)',\r\n swf404: smc + 'Verify that %s is a valid path.',\r\n tryDebug: 'Try ' + sm + '.debugFlash = true for more security details (output goes to SWF.)',\r\n checkSWF: 'See SWF output for more debug info.',\r\n localFail: smc + 'Non-HTTP page (' + doc.location.protocol + ' URL?) Review Flash player security settings for this special case:\\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/',\r\n waitFocus: smc + 'Special case: Waiting for SWF to load with window focus...',\r\n waitForever: smc + 'Waiting indefinitely for Flash (will recover if unblocked)...',\r\n waitSWF: smc + 'Waiting for 100% SWF load...',\r\n needFunction: smc + 'Function object expected for %s',\r\n badID: 'Sound ID \"%s\" should be a string, starting with a non-numeric character',\r\n currentObj: smc + '_debug(): Current sound objects',\r\n waitOnload: smc + 'Waiting for window.onload()',\r\n docLoaded: smc + 'Document already loaded',\r\n onload: smc + 'initComplete(): calling soundManager.onload()',\r\n onloadOK: sm + '.onload() complete',\r\n didInit: smc + 'init(): Already called?',\r\n secNote: 'Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html',\r\n badRemove: smc + 'Failed to remove Flash node.',\r\n shutdown: sm + '.disable(): Shutting down',\r\n queue: smc + 'Queueing %s handler',\r\n smError: 'SMSound.load(): Exception: JS-Flash communication failed, or JS error.',\r\n fbTimeout: 'No flash response, applying .' + swfCSS.swfTimedout + ' CSS...',\r\n fbLoaded: 'Flash loaded',\r\n fbHandler: smc + 'flashBlockHandler()',\r\n manURL: 'SMSound.load(): Using manually-assigned URL',\r\n onURL: sm + '.load(): current URL already assigned.',\r\n badFV: sm + '.flashVersion must be 8 or 9. \"%s\" is invalid. Reverting to %s.',\r\n as2loop: 'Note: Setting stream:false so looping can work (flash 8 limitation)',\r\n noNSLoop: 'Note: Looping not implemented for MovieStar formats',\r\n needfl9: 'Note: Switching to flash 9, required for MP4 formats.',\r\n mfTimeout: 'Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case',\r\n needFlash: smc + 'Fatal error: Flash is needed to play some required formats, but is not available.',\r\n gotFocus: smc + 'Got window focus.',\r\n policy: 'Enabling usePolicyFile for data access',\r\n setup: sm + '.setup(): allowed parameters: %s',\r\n setupError: sm + '.setup(): \"%s\" cannot be assigned with this method.',\r\n setupUndef: sm + '.setup(): Could not find option \"%s\"',\r\n setupLate: sm + '.setup(): url, flashVersion and html5Test property changes will not take effect until reboot().',\r\n noURL: smc + 'Flash URL required. Call soundManager.setup({url:...}) to get started.',\r\n sm2Loaded: 'SoundManager 2: Ready. ' + String.fromCharCode(10003),\r\n reset: sm + '.reset(): Removing event callbacks',\r\n mobileUA: 'Mobile UA detected, preferring HTML5 by default.',\r\n globalHTML5: 'Using singleton HTML5 Audio() pattern for this device.',\r\n ignoreMobile: 'Ignoring mobile restrictions for this device.'\r\n // </d>\r\n\r\n };\r\n\r\n str = function() {\r\n\r\n // internal string replace helper.\r\n // arguments: o [,items to replace]\r\n // <d>\r\n\r\n var args,\r\n i, j, o,\r\n sstr;\r\n\r\n // real array, please\r\n args = slice.call(arguments);\r\n\r\n // first argument\r\n o = args.shift();\r\n\r\n sstr = (strings && strings[o] ? strings[o] : '');\r\n\r\n if (sstr && args && args.length) {\r\n for (i = 0, j = args.length; i < j; i++) {\r\n sstr = sstr.replace('%s', args[i]);\r\n }\r\n }\r\n\r\n return sstr;\r\n // </d>\r\n\r\n };\r\n\r\n loopFix = function(sOpt) {\r\n\r\n // flash 8 requires stream = false for looping to work\r\n if (fV === 8 && sOpt.loops > 1 && sOpt.stream) {\r\n _wDS('as2loop');\r\n sOpt.stream = false;\r\n }\r\n\r\n return sOpt;\r\n\r\n };\r\n\r\n policyFix = function(sOpt, sPre) {\r\n\r\n if (sOpt && !sOpt.usePolicyFile && (sOpt.onid3 || sOpt.usePeakData || sOpt.useWaveformData || sOpt.useEQData)) {\r\n sm2._wD((sPre || '') + str('policy'));\r\n sOpt.usePolicyFile = true;\r\n }\r\n\r\n return sOpt;\r\n\r\n };\r\n\r\n complain = function(sMsg) {\r\n\r\n // <d>\r\n if (hasConsole && console.warn !== _undefined) {\r\n console.warn(sMsg);\r\n } else {\r\n sm2._wD(sMsg);\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n doNothing = function() {\r\n\r\n return false;\r\n\r\n };\r\n\r\n disableObject = function(o) {\r\n\r\n var oProp;\r\n\r\n for (oProp in o) {\r\n if (o.hasOwnProperty(oProp) && typeof o[oProp] === 'function') {\r\n o[oProp] = doNothing;\r\n }\r\n }\r\n\r\n oProp = null;\r\n\r\n };\r\n\r\n failSafely = function(bNoDisable) {\r\n\r\n // general failure exception handler\r\n\r\n if (bNoDisable === _undefined) {\r\n bNoDisable = false;\r\n }\r\n\r\n if (disabled || bNoDisable) {\r\n sm2.disable(bNoDisable);\r\n }\r\n\r\n };\r\n\r\n normalizeMovieURL = function(movieURL) {\r\n\r\n var urlParams = null, url;\r\n\r\n if (movieURL) {\r\n\r\n if (movieURL.match(/\\.swf(\\?.*)?$/i)) {\r\n\r\n urlParams = movieURL.substr(movieURL.toLowerCase().lastIndexOf('.swf?') + 4);\r\n\r\n // assume user knows what they're doing\r\n if (urlParams) return movieURL;\r\n\r\n } else if (movieURL.lastIndexOf('/') !== movieURL.length - 1) {\r\n\r\n // append trailing slash, if needed\r\n movieURL += '/';\r\n\r\n }\r\n\r\n }\r\n\r\n url = (movieURL && movieURL.lastIndexOf('/') !== -1 ? movieURL.substr(0, movieURL.lastIndexOf('/') + 1) : './') + sm2.movieURL;\r\n\r\n if (sm2.noSWFCache) {\r\n url += ('?ts=' + new Date().getTime());\r\n }\r\n\r\n return url;\r\n\r\n };\r\n\r\n setVersionInfo = function() {\r\n\r\n // short-hand for internal use\r\n\r\n fV = parseInt(sm2.flashVersion, 10);\r\n\r\n if (fV !== 8 && fV !== 9) {\r\n sm2._wD(str('badFV', fV, defaultFlashVersion));\r\n sm2.flashVersion = fV = defaultFlashVersion;\r\n }\r\n\r\n // debug flash movie, if applicable\r\n\r\n var isDebug = (sm2.debugMode || sm2.debugFlash ? '_debug.swf' : '.swf');\r\n\r\n if (sm2.useHTML5Audio && !sm2.html5Only && sm2.audioFormats.mp4.required && fV < 9) {\r\n sm2._wD(str('needfl9'));\r\n sm2.flashVersion = fV = 9;\r\n }\r\n\r\n sm2.version = sm2.versionNumber + (sm2.html5Only ? ' (HTML5-only mode)' : (fV === 9 ? ' (AS3/Flash 9)' : ' (AS2/Flash 8)'));\r\n\r\n // set up default options\r\n if (fV > 8) {\r\n\r\n // +flash 9 base options\r\n sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.flash9Options);\r\n sm2.features.buffering = true;\r\n\r\n // +moviestar support\r\n sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.movieStarOptions);\r\n sm2.filePatterns.flash9 = new RegExp('\\\\.(mp3|' + netStreamTypes.join('|') + ')(\\\\?.*)?$', 'i');\r\n sm2.features.movieStar = true;\r\n\r\n } else {\r\n\r\n sm2.features.movieStar = false;\r\n\r\n }\r\n\r\n // regExp for flash canPlay(), etc.\r\n sm2.filePattern = sm2.filePatterns[(fV !== 8 ? 'flash9' : 'flash8')];\r\n\r\n // if applicable, use _debug versions of SWFs\r\n sm2.movieURL = (fV === 8 ? 'soundmanager2.swf' : 'soundmanager2_flash9.swf').replace('.swf', isDebug);\r\n\r\n sm2.features.peakData = sm2.features.waveformData = sm2.features.eqData = (fV > 8);\r\n\r\n };\r\n\r\n setPolling = function(bPolling, bHighPerformance) {\r\n\r\n if (!flash) {\r\n return;\r\n }\r\n\r\n flash._setPolling(bPolling, bHighPerformance);\r\n\r\n };\r\n\r\n initDebug = function() {\r\n\r\n // starts debug mode, creating output <div> for UAs without console object\r\n\r\n // allow force of debug mode via URL\r\n // <d>\r\n if (sm2.debugURLParam.test(wl)) {\r\n sm2.setupOptions.debugMode = sm2.debugMode = true;\r\n }\r\n\r\n if (id(sm2.debugID)) {\r\n return;\r\n }\r\n\r\n var oD, oDebug, oTarget, oToggle, tmp;\r\n\r\n if (sm2.debugMode && !id(sm2.debugID) && (!hasConsole || !sm2.useConsole || !sm2.consoleOnly)) {\r\n\r\n oD = doc.createElement('div');\r\n oD.id = sm2.debugID + '-toggle';\r\n\r\n oToggle = {\r\n position: 'fixed',\r\n bottom: '0px',\r\n right: '0px',\r\n width: '1.2em',\r\n height: '1.2em',\r\n lineHeight: '1.2em',\r\n margin: '2px',\r\n textAlign: 'center',\r\n border: '1px solid #999',\r\n cursor: 'pointer',\r\n background: '#fff',\r\n color: '#333',\r\n zIndex: 10001\r\n };\r\n\r\n oD.appendChild(doc.createTextNode('-'));\r\n oD.onclick = toggleDebug;\r\n oD.title = 'Toggle SM2 debug console';\r\n\r\n if (ua.match(/msie 6/i)) {\r\n oD.style.position = 'absolute';\r\n oD.style.cursor = 'hand';\r\n }\r\n\r\n for (tmp in oToggle) {\r\n if (oToggle.hasOwnProperty(tmp)) {\r\n oD.style[tmp] = oToggle[tmp];\r\n }\r\n }\r\n\r\n oDebug = doc.createElement('div');\r\n oDebug.id = sm2.debugID;\r\n oDebug.style.display = (sm2.debugMode ? 'block' : 'none');\r\n\r\n if (sm2.debugMode && !id(oD.id)) {\r\n try {\r\n oTarget = getDocument();\r\n oTarget.appendChild(oD);\r\n } catch(e2) {\r\n throw new Error(str('domError') + ' \\n' + e2.toString());\r\n }\r\n oTarget.appendChild(oDebug);\r\n }\r\n\r\n }\r\n\r\n oTarget = null;\r\n // </d>\r\n\r\n };\r\n\r\n idCheck = this.getSoundById;\r\n\r\n // <d>\r\n _wDS = function(o, errorLevel) {\r\n\r\n return (!o ? '' : sm2._wD(str(o), errorLevel));\r\n\r\n };\r\n\r\n toggleDebug = function() {\r\n\r\n var o = id(sm2.debugID),\r\n oT = id(sm2.debugID + '-toggle');\r\n\r\n if (!o) {\r\n return;\r\n }\r\n\r\n if (debugOpen) {\r\n // minimize\r\n oT.innerHTML = '+';\r\n o.style.display = 'none';\r\n } else {\r\n oT.innerHTML = '-';\r\n o.style.display = 'block';\r\n }\r\n\r\n debugOpen = !debugOpen;\r\n\r\n };\r\n\r\n debugTS = function(sEventType, bSuccess, sMessage) {\r\n\r\n // troubleshooter debug hooks\r\n\r\n if (window.sm2Debugger !== _undefined) {\r\n try {\r\n sm2Debugger.handleEvent(sEventType, bSuccess, sMessage);\r\n } catch(e) {\r\n // oh well\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n\r\n };\r\n // </d>\r\n\r\n getSWFCSS = function() {\r\n\r\n var css = [];\r\n\r\n if (sm2.debugMode) {\r\n css.push(swfCSS.sm2Debug);\r\n }\r\n\r\n if (sm2.debugFlash) {\r\n css.push(swfCSS.flashDebug);\r\n }\r\n\r\n if (sm2.useHighPerformance) {\r\n css.push(swfCSS.highPerf);\r\n }\r\n\r\n return css.join(' ');\r\n\r\n };\r\n\r\n flashBlockHandler = function() {\r\n\r\n // *possible* flash block situation.\r\n\r\n var name = str('fbHandler'),\r\n p = sm2.getMoviePercent(),\r\n css = swfCSS,\r\n error = {\r\n type: 'FLASHBLOCK'\r\n };\r\n\r\n if (sm2.html5Only) {\r\n // no flash, or unused\r\n return;\r\n }\r\n\r\n if (!sm2.ok()) {\r\n\r\n if (needsFlash) {\r\n // make the movie more visible, so user can fix\r\n sm2.oMC.className = getSWFCSS() + ' ' + css.swfDefault + ' ' + (p === null ? css.swfTimedout : css.swfError);\r\n sm2._wD(name + ': ' + str('fbTimeout') + (p ? ' (' + str('fbLoaded') + ')' : ''));\r\n }\r\n\r\n sm2.didFlashBlock = true;\r\n\r\n // fire onready(), complain lightly\r\n processOnEvents({\r\n type: 'ontimeout',\r\n ignoreInit: true,\r\n error: error\r\n });\r\n\r\n catchError(error);\r\n\r\n } else {\r\n\r\n // SM2 loaded OK (or recovered)\r\n\r\n // <d>\r\n if (sm2.didFlashBlock) {\r\n sm2._wD(name + ': Unblocked');\r\n }\r\n // </d>\r\n\r\n if (sm2.oMC) {\r\n sm2.oMC.className = [getSWFCSS(), css.swfDefault, css.swfLoaded + (sm2.didFlashBlock ? ' ' + css.swfUnblocked : '')].join(' ');\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n addOnEvent = function(sType, oMethod, oScope) {\r\n\r\n if (on_queue[sType] === _undefined) {\r\n on_queue[sType] = [];\r\n }\r\n\r\n on_queue[sType].push({\r\n method: oMethod,\r\n scope: (oScope || null),\r\n fired: false\r\n });\r\n\r\n };\r\n\r\n processOnEvents = function(oOptions) {\r\n\r\n // if unspecified, assume OK/error\r\n\r\n if (!oOptions) {\r\n oOptions = {\r\n type: (sm2.ok() ? 'onready' : 'ontimeout')\r\n };\r\n }\r\n\r\n // not ready yet.\r\n if (!didInit && oOptions && !oOptions.ignoreInit) return false;\r\n\r\n // invalid case\r\n if (oOptions.type === 'ontimeout' && (sm2.ok() || (disabled && !oOptions.ignoreInit))) return false;\r\n\r\n var status = {\r\n success: (oOptions && oOptions.ignoreInit ? sm2.ok() : !disabled)\r\n },\r\n\r\n // queue specified by type, or none\r\n srcQueue = (oOptions && oOptions.type ? on_queue[oOptions.type] || [] : []),\r\n\r\n queue = [], i, j,\r\n args = [status],\r\n canRetry = (needsFlash && !sm2.ok());\r\n\r\n if (oOptions.error) {\r\n args[0].error = oOptions.error;\r\n }\r\n\r\n for (i = 0, j = srcQueue.length; i < j; i++) {\r\n if (srcQueue[i].fired !== true) {\r\n queue.push(srcQueue[i]);\r\n }\r\n }\r\n\r\n if (queue.length) {\r\n\r\n // sm2._wD(sm + ': Firing ' + queue.length + ' ' + oOptions.type + '() item' + (queue.length === 1 ? '' : 's'));\r\n for (i = 0, j = queue.length; i < j; i++) {\r\n\r\n if (queue[i].scope) {\r\n queue[i].method.apply(queue[i].scope, args);\r\n } else {\r\n queue[i].method.apply(this, args);\r\n }\r\n\r\n if (!canRetry) {\r\n // useFlashBlock and SWF timeout case doesn't count here.\r\n queue[i].fired = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n initUserOnload = function() {\r\n\r\n window.setTimeout(function() {\r\n\r\n if (sm2.useFlashBlock) {\r\n flashBlockHandler();\r\n }\r\n\r\n processOnEvents();\r\n\r\n // call user-defined \"onload\", scoped to window\r\n\r\n if (typeof sm2.onload === 'function') {\r\n _wDS('onload', 1);\r\n sm2.onload.apply(window);\r\n _wDS('onloadOK', 1);\r\n }\r\n\r\n if (sm2.waitForWindowLoad) {\r\n event.add(window, 'load', initUserOnload);\r\n }\r\n\r\n }, 1);\r\n\r\n };\r\n\r\n detectFlash = function() {\r\n\r\n /**\r\n * Hat tip: Flash Detect library (BSD, (C) 2007) by Carl \"DocYes\" S. Yestrau\r\n * http://featureblend.com/javascript-flash-detection-library.html / http://featureblend.com/license.txt\r\n */\r\n\r\n // this work has already been done.\r\n if (hasFlash !== _undefined) return hasFlash;\r\n\r\n var hasPlugin = false, n = navigator, obj, type, types, AX = window.ActiveXObject;\r\n\r\n // MS Edge 14 throws an \"Unspecified Error\" because n.plugins is inaccessible due to permissions\r\n var nP;\r\n\r\n try {\r\n nP = n.plugins;\r\n } catch(e) {\r\n nP = undefined;\r\n }\r\n\r\n if (nP && nP.length) {\r\n\r\n type = 'application/x-shockwave-flash';\r\n types = n.mimeTypes;\r\n\r\n if (types && types[type] && types[type].enabledPlugin && types[type].enabledPlugin.description) {\r\n hasPlugin = true;\r\n }\r\n\r\n } else if (AX !== _undefined && !ua.match(/MSAppHost/i)) {\r\n\r\n // Windows 8 Store Apps (MSAppHost) are weird (compatibility?) and won't complain here, but will barf if Flash/ActiveX object is appended to the DOM.\r\n try {\r\n obj = new AX('ShockwaveFlash.ShockwaveFlash');\r\n } catch(e) {\r\n // oh well\r\n obj = null;\r\n }\r\n\r\n hasPlugin = (!!obj);\r\n\r\n // cleanup, because it is ActiveX after all\r\n obj = null;\r\n\r\n }\r\n\r\n hasFlash = hasPlugin;\r\n\r\n return hasPlugin;\r\n\r\n };\r\n\r\n featureCheck = function() {\r\n\r\n var flashNeeded,\r\n item,\r\n formats = sm2.audioFormats,\r\n // iPhone <= 3.1 has broken HTML5 audio(), but firmware 3.2 (original iPad) + iOS4 works.\r\n isSpecial = (is_iDevice && !!(ua.match(/os (1|2|3_0|3_1)\\s/i)));\r\n\r\n if (isSpecial) {\r\n\r\n // has Audio(), but is broken; let it load links directly.\r\n sm2.hasHTML5 = false;\r\n\r\n // ignore flash case, however\r\n sm2.html5Only = true;\r\n\r\n // hide the SWF, if present\r\n if (sm2.oMC) {\r\n sm2.oMC.style.display = 'none';\r\n }\r\n\r\n } else if (sm2.useHTML5Audio) {\r\n\r\n if (!sm2.html5 || !sm2.html5.canPlayType) {\r\n sm2._wD('SoundManager: No HTML5 Audio() support detected.');\r\n sm2.hasHTML5 = false;\r\n }\r\n\r\n // <d>\r\n if (isBadSafari) {\r\n sm2._wD(smc + 'Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - ' + (!hasFlash ? ' would use flash fallback for MP3/MP4, but none detected.' : 'will use flash fallback for MP3/MP4, if available'), 1);\r\n }\r\n // </d>\r\n\r\n }\r\n\r\n if (sm2.useHTML5Audio && sm2.hasHTML5) {\r\n\r\n // sort out whether flash is optional, required or can be ignored.\r\n\r\n // innocent until proven guilty.\r\n canIgnoreFlash = true;\r\n\r\n for (item in formats) {\r\n\r\n if (formats.hasOwnProperty(item)) {\r\n\r\n if (formats[item].required) {\r\n\r\n if (!sm2.html5.canPlayType(formats[item].type)) {\r\n\r\n // 100% HTML5 mode is not possible.\r\n canIgnoreFlash = false;\r\n flashNeeded = true;\r\n\r\n } else if (sm2.preferFlash && (sm2.flash[item] || sm2.flash[formats[item].type])) {\r\n\r\n // flash may be required, or preferred for this format.\r\n flashNeeded = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // sanity check...\r\n if (sm2.ignoreFlash) {\r\n flashNeeded = false;\r\n canIgnoreFlash = true;\r\n }\r\n\r\n sm2.html5Only = (sm2.hasHTML5 && sm2.useHTML5Audio && !flashNeeded);\r\n\r\n return (!sm2.html5Only);\r\n\r\n };\r\n\r\n parseURL = function(url) {\r\n\r\n /**\r\n * Internal: Finds and returns the first playable URL (or failing that, the first URL.)\r\n * @param {string or array} url A single URL string, OR, an array of URL strings or {url:'/path/to/resource', type:'audio/mp3'} objects.\r\n */\r\n\r\n var i, j, urlResult = 0, result;\r\n\r\n if (url instanceof Array) {\r\n\r\n // find the first good one\r\n for (i = 0, j = url.length; i < j; i++) {\r\n\r\n if (url[i] instanceof Object) {\r\n\r\n // MIME check\r\n if (sm2.canPlayMIME(url[i].type)) {\r\n urlResult = i;\r\n break;\r\n }\r\n\r\n } else if (sm2.canPlayURL(url[i])) {\r\n\r\n // URL string check\r\n urlResult = i;\r\n break;\r\n\r\n }\r\n\r\n }\r\n\r\n // normalize to string\r\n if (url[urlResult].url) {\r\n url[urlResult] = url[urlResult].url;\r\n }\r\n\r\n result = url[urlResult];\r\n\r\n } else {\r\n\r\n // single URL case\r\n result = url;\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n\r\n startTimer = function(oSound) {\r\n\r\n /**\r\n * attach a timer to this sound, and start an interval if needed\r\n */\r\n\r\n if (!oSound._hasTimer) {\r\n\r\n oSound._hasTimer = true;\r\n\r\n if (!mobileHTML5 && sm2.html5PollingInterval) {\r\n\r\n if (h5IntervalTimer === null && h5TimerCount === 0) {\r\n\r\n h5IntervalTimer = setInterval(timerExecute, sm2.html5PollingInterval);\r\n\r\n }\r\n\r\n h5TimerCount++;\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n stopTimer = function(oSound) {\r\n\r\n /**\r\n * detach a timer\r\n */\r\n\r\n if (oSound._hasTimer) {\r\n\r\n oSound._hasTimer = false;\r\n\r\n if (!mobileHTML5 && sm2.html5PollingInterval) {\r\n\r\n // interval will stop itself at next execution.\r\n\r\n h5TimerCount--;\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n timerExecute = function() {\r\n\r\n /**\r\n * manual polling for HTML5 progress events, ie., whileplaying()\r\n * (can achieve greater precision than conservative default HTML5 interval)\r\n */\r\n\r\n var i;\r\n\r\n if (h5IntervalTimer !== null && !h5TimerCount) {\r\n\r\n // no active timers, stop polling interval.\r\n\r\n clearInterval(h5IntervalTimer);\r\n\r\n h5IntervalTimer = null;\r\n\r\n return;\r\n\r\n }\r\n\r\n // check all HTML5 sounds with timers\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n\r\n if (sm2.sounds[sm2.soundIDs[i]].isHTML5 && sm2.sounds[sm2.soundIDs[i]]._hasTimer) {\r\n sm2.sounds[sm2.soundIDs[i]]._onTimer();\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n catchError = function(options) {\r\n\r\n options = (options !== _undefined ? options : {});\r\n\r\n if (typeof sm2.onerror === 'function') {\r\n sm2.onerror.apply(window, [{\r\n type: (options.type !== _undefined ? options.type : null)\r\n }]);\r\n }\r\n\r\n if (options.fatal !== _undefined && options.fatal) {\r\n sm2.disable();\r\n }\r\n\r\n };\r\n\r\n badSafariFix = function() {\r\n\r\n // special case: \"bad\" Safari (OS X 10.3 - 10.7) must fall back to flash for MP3/MP4\r\n if (!isBadSafari || !detectFlash()) {\r\n // doesn't apply\r\n return;\r\n }\r\n\r\n var aF = sm2.audioFormats, i, item;\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n if (item === 'mp3' || item === 'mp4') {\r\n\r\n sm2._wD(sm + ': Using flash fallback for ' + item + ' format');\r\n sm2.html5[item] = false;\r\n\r\n // assign result to related formats, too\r\n if (aF[item] && aF[item].related) {\r\n for (i = aF[item].related.length - 1; i >= 0; i--) {\r\n sm2.html5[aF[item].related[i]] = false;\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Pseudo-private flash/ExternalInterface methods\r\n * ----------------------------------------------\r\n */\r\n\r\n this._setSandboxType = function(sandboxType) {\r\n\r\n // <d>\r\n // Security sandbox according to Flash plugin\r\n var sb = sm2.sandbox;\r\n\r\n sb.type = sandboxType;\r\n sb.description = sb.types[(sb.types[sandboxType] !== _undefined ? sandboxType : 'unknown')];\r\n\r\n if (sb.type === 'localWithFile') {\r\n\r\n sb.noRemote = true;\r\n sb.noLocal = false;\r\n _wDS('secNote', 2);\r\n\r\n } else if (sb.type === 'localWithNetwork') {\r\n\r\n sb.noRemote = false;\r\n sb.noLocal = true;\r\n\r\n } else if (sb.type === 'localTrusted') {\r\n\r\n sb.noRemote = false;\r\n sb.noLocal = false;\r\n\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n this._externalInterfaceOK = function(swfVersion) {\r\n\r\n // flash callback confirming flash loaded, EI working etc.\r\n // swfVersion: SWF build string\r\n\r\n if (sm2.swfLoaded) {\r\n return;\r\n }\r\n\r\n var e;\r\n\r\n debugTS('swf', true);\r\n debugTS('flashtojs', true);\r\n sm2.swfLoaded = true;\r\n tryInitOnFocus = false;\r\n\r\n if (isBadSafari) {\r\n badSafariFix();\r\n }\r\n\r\n // complain if JS + SWF build/version strings don't match, excluding +DEV builds\r\n // <d>\r\n if (!swfVersion || swfVersion.replace(/\\+dev/i, '') !== sm2.versionNumber.replace(/\\+dev/i, '')) {\r\n\r\n e = sm + ': Fatal: JavaScript file build \"' + sm2.versionNumber + '\" does not match Flash SWF build \"' + swfVersion + '\" at ' + sm2.url + '. Ensure both are up-to-date.';\r\n\r\n // escape flash -> JS stack so this error fires in window.\r\n setTimeout(function() {\r\n throw new Error(e);\r\n }, 0);\r\n\r\n // exit, init will fail with timeout\r\n return;\r\n\r\n }\r\n // </d>\r\n\r\n // IE needs a larger timeout\r\n setTimeout(init, isIE ? 100 : 1);\r\n\r\n };\r\n\r\n /**\r\n * Private initialization helpers\r\n * ------------------------------\r\n */\r\n\r\n createMovie = function(movieID, movieURL) {\r\n\r\n // ignore if already connected\r\n if (didAppend && appendSuccess) return false;\r\n\r\n function initMsg() {\r\n\r\n // <d>\r\n\r\n var options = [],\r\n title,\r\n msg = [],\r\n delimiter = ' + ';\r\n\r\n title = 'SoundManager ' + sm2.version + (!sm2.html5Only && sm2.useHTML5Audio ? (sm2.hasHTML5 ? ' + HTML5 audio' : ', no HTML5 audio support') : '');\r\n\r\n if (!sm2.html5Only) {\r\n\r\n if (sm2.preferFlash) {\r\n options.push('preferFlash');\r\n }\r\n\r\n if (sm2.useHighPerformance) {\r\n options.push('useHighPerformance');\r\n }\r\n\r\n if (sm2.flashPollingInterval) {\r\n options.push('flashPollingInterval (' + sm2.flashPollingInterval + 'ms)');\r\n }\r\n\r\n if (sm2.html5PollingInterval) {\r\n options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');\r\n }\r\n\r\n if (sm2.wmode) {\r\n options.push('wmode (' + sm2.wmode + ')');\r\n }\r\n\r\n if (sm2.debugFlash) {\r\n options.push('debugFlash');\r\n }\r\n\r\n if (sm2.useFlashBlock) {\r\n options.push('flashBlock');\r\n }\r\n\r\n } else if (sm2.html5PollingInterval) {\r\n options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');\r\n }\r\n\r\n if (options.length) {\r\n msg = msg.concat([options.join(delimiter)]);\r\n }\r\n\r\n sm2._wD(title + (msg.length ? delimiter + msg.join(', ') : ''), 1);\r\n\r\n showSupport();\r\n\r\n // </d>\r\n\r\n }\r\n\r\n if (sm2.html5Only) {\r\n\r\n // 100% HTML5 mode\r\n setVersionInfo();\r\n\r\n initMsg();\r\n sm2.oMC = id(sm2.movieID);\r\n init();\r\n\r\n // prevent multiple init attempts\r\n didAppend = true;\r\n\r\n appendSuccess = true;\r\n\r\n return false;\r\n\r\n }\r\n\r\n // flash path\r\n var remoteURL = (movieURL || sm2.url),\r\n localURL = (sm2.altURL || remoteURL),\r\n swfTitle = 'JS/Flash audio component (SoundManager 2)',\r\n oTarget = getDocument(),\r\n extraClass = getSWFCSS(),\r\n isRTL = null,\r\n html = doc.getElementsByTagName('html')[0],\r\n oEmbed, oMovie, tmp, movieHTML, oEl, s, x, sClass;\r\n\r\n isRTL = (html && html.dir && html.dir.match(/rtl/i));\r\n movieID = (movieID === _undefined ? sm2.id : movieID);\r\n\r\n function param(name, value) {\r\n return '<param name=\"' + name + '\" value=\"' + value + '\" />';\r\n }\r\n\r\n // safety check for legacy (change to Flash 9 URL)\r\n setVersionInfo();\r\n sm2.url = normalizeMovieURL(overHTTP ? remoteURL : localURL);\r\n movieURL = sm2.url;\r\n\r\n sm2.wmode = (!sm2.wmode && sm2.useHighPerformance ? 'transparent' : sm2.wmode);\r\n\r\n if (sm2.wmode !== null && (ua.match(/msie 8/i) || (!isIE && !sm2.useHighPerformance)) && navigator.platform.match(/win32|win64/i)) {\r\n /**\r\n * extra-special case: movie doesn't load until scrolled into view when using wmode = anything but 'window' here\r\n * does not apply when using high performance (position:fixed means on-screen), OR infinite flash load timeout\r\n * wmode breaks IE 8 on Vista + Win7 too in some cases, as of January 2011 (?)\r\n */\r\n messages.push(strings.spcWmode);\r\n sm2.wmode = null;\r\n }\r\n\r\n oEmbed = {\r\n name: movieID,\r\n id: movieID,\r\n src: movieURL,\r\n quality: 'high',\r\n allowScriptAccess: sm2.allowScriptAccess,\r\n bgcolor: sm2.bgColor,\r\n pluginspage: http + 'www.macromedia.com/go/getflashplayer',\r\n title: swfTitle,\r\n type: 'application/x-shockwave-flash',\r\n wmode: sm2.wmode,\r\n // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html\r\n hasPriority: 'true'\r\n };\r\n\r\n if (sm2.debugFlash) {\r\n oEmbed.FlashVars = 'debug=1';\r\n }\r\n\r\n if (!sm2.wmode) {\r\n // don't write empty attribute\r\n delete oEmbed.wmode;\r\n }\r\n\r\n if (isIE) {\r\n\r\n // IE is \"special\".\r\n oMovie = doc.createElement('div');\r\n movieHTML = [\r\n '<object id=\"' + movieID + '\" data=\"' + movieURL + '\" type=\"' + oEmbed.type + '\" title=\"' + oEmbed.title + '\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\">',\r\n param('movie', movieURL),\r\n param('AllowScriptAccess', sm2.allowScriptAccess),\r\n param('quality', oEmbed.quality),\r\n (sm2.wmode ? param('wmode', sm2.wmode) : ''),\r\n param('bgcolor', sm2.bgColor),\r\n param('hasPriority', 'true'),\r\n (sm2.debugFlash ? param('FlashVars', oEmbed.FlashVars) : ''),\r\n '</object>'\r\n ].join('');\r\n\r\n } else {\r\n\r\n oMovie = doc.createElement('embed');\r\n for (tmp in oEmbed) {\r\n if (oEmbed.hasOwnProperty(tmp)) {\r\n oMovie.setAttribute(tmp, oEmbed[tmp]);\r\n }\r\n }\r\n\r\n }\r\n\r\n initDebug();\r\n extraClass = getSWFCSS();\r\n oTarget = getDocument();\r\n\r\n if (oTarget) {\r\n\r\n sm2.oMC = (id(sm2.movieID) || doc.createElement('div'));\r\n\r\n if (!sm2.oMC.id) {\r\n\r\n sm2.oMC.id = sm2.movieID;\r\n sm2.oMC.className = swfCSS.swfDefault + ' ' + extraClass;\r\n s = null;\r\n oEl = null;\r\n\r\n if (!sm2.useFlashBlock) {\r\n if (sm2.useHighPerformance) {\r\n // on-screen at all times\r\n s = {\r\n position: 'fixed',\r\n width: '8px',\r\n height: '8px',\r\n // >= 6px for flash to run fast, >= 8px to start up under Firefox/win32 in some cases. odd? yes.\r\n bottom: '0px',\r\n left: '0px',\r\n overflow: 'hidden'\r\n };\r\n } else {\r\n // hide off-screen, lower priority\r\n s = {\r\n position: 'absolute',\r\n width: '6px',\r\n height: '6px',\r\n top: '-9999px',\r\n left: '-9999px'\r\n };\r\n if (isRTL) {\r\n s.left = Math.abs(parseInt(s.left, 10)) + 'px';\r\n }\r\n }\r\n }\r\n\r\n if (isWebkit) {\r\n // soundcloud-reported render/crash fix, safari 5\r\n sm2.oMC.style.zIndex = 10000;\r\n }\r\n\r\n if (!sm2.debugFlash) {\r\n for (x in s) {\r\n if (s.hasOwnProperty(x)) {\r\n sm2.oMC.style[x] = s[x];\r\n }\r\n }\r\n }\r\n\r\n try {\r\n\r\n if (!isIE) {\r\n sm2.oMC.appendChild(oMovie);\r\n }\r\n\r\n oTarget.appendChild(sm2.oMC);\r\n\r\n if (isIE) {\r\n oEl = sm2.oMC.appendChild(doc.createElement('div'));\r\n oEl.className = swfCSS.swfBox;\r\n oEl.innerHTML = movieHTML;\r\n }\r\n\r\n appendSuccess = true;\r\n\r\n } catch(e) {\r\n\r\n throw new Error(str('domError') + ' \\n' + e.toString());\r\n\r\n }\r\n\r\n } else {\r\n\r\n // SM2 container is already in the document (eg. flashblock use case)\r\n sClass = sm2.oMC.className;\r\n sm2.oMC.className = (sClass ? sClass + ' ' : swfCSS.swfDefault) + (extraClass ? ' ' + extraClass : '');\r\n sm2.oMC.appendChild(oMovie);\r\n\r\n if (isIE) {\r\n oEl = sm2.oMC.appendChild(doc.createElement('div'));\r\n oEl.className = swfCSS.swfBox;\r\n oEl.innerHTML = movieHTML;\r\n }\r\n\r\n appendSuccess = true;\r\n\r\n }\r\n\r\n }\r\n\r\n didAppend = true;\r\n\r\n initMsg();\r\n\r\n // sm2._wD(sm + ': Trying to load ' + movieURL + (!overHTTP && sm2.altURL ? ' (alternate URL)' : ''), 1);\r\n\r\n return true;\r\n\r\n };\r\n\r\n initMovie = function() {\r\n\r\n if (sm2.html5Only) {\r\n createMovie();\r\n return false;\r\n }\r\n\r\n // attempt to get, or create, movie (may already exist)\r\n if (flash) return false;\r\n\r\n if (!sm2.url) {\r\n\r\n /**\r\n * Something isn't right - we've reached init, but the soundManager url property has not been set.\r\n * User has not called setup({url: ...}), or has not set soundManager.url (legacy use case) directly before init time.\r\n * Notify and exit. If user calls setup() with a url: property, init will be restarted as in the deferred loading case.\r\n */\r\n\r\n _wDS('noURL');\r\n return false;\r\n\r\n }\r\n\r\n // inline markup case\r\n flash = sm2.getMovie(sm2.id);\r\n\r\n if (!flash) {\r\n\r\n if (!oRemoved) {\r\n\r\n // try to create\r\n createMovie(sm2.id, sm2.url);\r\n\r\n } else {\r\n\r\n // try to re-append removed movie after reboot()\r\n if (!isIE) {\r\n sm2.oMC.appendChild(oRemoved);\r\n } else {\r\n sm2.oMC.innerHTML = oRemovedHTML;\r\n }\r\n\r\n oRemoved = null;\r\n didAppend = true;\r\n\r\n }\r\n\r\n flash = sm2.getMovie(sm2.id);\r\n\r\n }\r\n\r\n if (typeof sm2.oninitmovie === 'function') {\r\n setTimeout(sm2.oninitmovie, 1);\r\n }\r\n\r\n // <d>\r\n flushMessages();\r\n // </d>\r\n\r\n return true;\r\n\r\n };\r\n\r\n delayWaitForEI = function() {\r\n\r\n setTimeout(waitForEI, 1000);\r\n\r\n };\r\n\r\n rebootIntoHTML5 = function() {\r\n\r\n // special case: try for a reboot with preferFlash: false, if 100% HTML5 mode is possible and useFlashBlock is not enabled.\r\n\r\n window.setTimeout(function() {\r\n\r\n complain(smc + 'useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false...');\r\n\r\n sm2.setup({\r\n preferFlash: false\r\n }).reboot();\r\n\r\n // if for some reason you want to detect this case, use an ontimeout() callback and look for html5Only and didFlashBlock == true.\r\n sm2.didFlashBlock = true;\r\n\r\n sm2.beginDelayedInit();\r\n\r\n }, 1);\r\n\r\n };\r\n\r\n waitForEI = function() {\r\n\r\n var p,\r\n loadIncomplete = false;\r\n\r\n if (!sm2.url) {\r\n // No SWF url to load (noURL case) - exit for now. Will be retried when url is set.\r\n return;\r\n }\r\n\r\n if (waitingForEI) {\r\n return;\r\n }\r\n\r\n waitingForEI = true;\r\n event.remove(window, 'load', delayWaitForEI);\r\n\r\n if (hasFlash && tryInitOnFocus && !isFocused) {\r\n // Safari won't load flash in background tabs, only when focused.\r\n _wDS('waitFocus');\r\n return;\r\n }\r\n\r\n if (!didInit) {\r\n p = sm2.getMoviePercent();\r\n if (p > 0 && p < 100) {\r\n loadIncomplete = true;\r\n }\r\n }\r\n\r\n setTimeout(function() {\r\n\r\n p = sm2.getMoviePercent();\r\n\r\n if (loadIncomplete) {\r\n // special case: if movie *partially* loaded, retry until it's 100% before assuming failure.\r\n waitingForEI = false;\r\n sm2._wD(str('waitSWF'));\r\n window.setTimeout(delayWaitForEI, 1);\r\n return;\r\n }\r\n\r\n // <d>\r\n if (!didInit) {\r\n\r\n sm2._wD(sm + ': No Flash response within expected time. Likely causes: ' + (p === 0 ? 'SWF load failed, ' : '') + 'Flash blocked or JS-Flash security error.' + (sm2.debugFlash ? ' ' + str('checkSWF') : ''), 2);\r\n\r\n if (!overHTTP && p) {\r\n\r\n _wDS('localFail', 2);\r\n\r\n if (!sm2.debugFlash) {\r\n _wDS('tryDebug', 2);\r\n }\r\n\r\n }\r\n\r\n if (p === 0) {\r\n\r\n // if 0 (not null), probably a 404.\r\n sm2._wD(str('swf404', sm2.url), 1);\r\n\r\n }\r\n\r\n debugTS('flashtojs', false, ': Timed out' + (overHTTP ? ' (Check flash security or flash blockers)' : ' (No plugin/missing SWF?)'));\r\n\r\n }\r\n // </d>\r\n\r\n // give up / time-out, depending\r\n\r\n if (!didInit && okToDisable) {\r\n\r\n if (p === null) {\r\n\r\n // SWF failed to report load progress. Possibly blocked.\r\n\r\n if (sm2.useFlashBlock || sm2.flashLoadTimeout === 0) {\r\n\r\n if (sm2.useFlashBlock) {\r\n\r\n flashBlockHandler();\r\n\r\n }\r\n\r\n _wDS('waitForever');\r\n\r\n } else if (!sm2.useFlashBlock && canIgnoreFlash) {\r\n\r\n // no custom flash block handling, but SWF has timed out. Will recover if user unblocks / allows SWF load.\r\n rebootIntoHTML5();\r\n\r\n } else {\r\n\r\n _wDS('waitForever');\r\n\r\n // fire any regular registered ontimeout() listeners.\r\n processOnEvents({\r\n type: 'ontimeout',\r\n ignoreInit: true,\r\n error: {\r\n type: 'INIT_FLASHBLOCK'\r\n }\r\n });\r\n\r\n }\r\n\r\n } else if (sm2.flashLoadTimeout === 0) {\r\n\r\n // SWF loaded? Shouldn't be a blocking issue, then.\r\n\r\n _wDS('waitForever');\r\n\r\n } else if (!sm2.useFlashBlock && canIgnoreFlash) {\r\n\r\n rebootIntoHTML5();\r\n\r\n } else {\r\n\r\n failSafely(true);\r\n\r\n }\r\n\r\n }\r\n\r\n }, sm2.flashLoadTimeout);\r\n\r\n };\r\n\r\n handleFocus = function() {\r\n\r\n function cleanup() {\r\n event.remove(window, 'focus', handleFocus);\r\n }\r\n\r\n if (isFocused || !tryInitOnFocus) {\r\n // already focused, or not special Safari background tab case\r\n cleanup();\r\n return true;\r\n }\r\n\r\n okToDisable = true;\r\n isFocused = true;\r\n _wDS('gotFocus');\r\n\r\n // allow init to restart\r\n waitingForEI = false;\r\n\r\n // kick off ExternalInterface timeout, now that the SWF has started\r\n delayWaitForEI();\r\n\r\n cleanup();\r\n return true;\r\n\r\n };\r\n\r\n flushMessages = function() {\r\n\r\n // <d>\r\n\r\n // SM2 pre-init debug messages\r\n if (messages.length) {\r\n sm2._wD('SoundManager 2: ' + messages.join(' '), 1);\r\n messages = [];\r\n }\r\n\r\n // </d>\r\n\r\n };\r\n\r\n showSupport = function() {\r\n\r\n // <d>\r\n\r\n flushMessages();\r\n\r\n var item, tests = [];\r\n\r\n if (sm2.useHTML5Audio && sm2.hasHTML5) {\r\n for (item in sm2.audioFormats) {\r\n if (sm2.audioFormats.hasOwnProperty(item)) {\r\n tests.push(item + ' = ' + sm2.html5[item] + (!sm2.html5[item] && needsFlash && sm2.flash[item] ? ' (using flash)' : (sm2.preferFlash && sm2.flash[item] && needsFlash ? ' (preferring flash)' : (!sm2.html5[item] ? ' (' + (sm2.audioFormats[item].required ? 'required, ' : '') + 'and no flash support)' : ''))));\r\n }\r\n }\r\n sm2._wD('SoundManager 2 HTML5 support: ' + tests.join(', '), 1);\r\n }\r\n\r\n // </d>\r\n\r\n };\r\n\r\n initComplete = function(bNoDisable) {\r\n\r\n if (didInit) return false;\r\n\r\n if (sm2.html5Only) {\r\n // all good.\r\n _wDS('sm2Loaded', 1);\r\n didInit = true;\r\n initUserOnload();\r\n debugTS('onload', true);\r\n return true;\r\n }\r\n\r\n var wasTimeout = (sm2.useFlashBlock && sm2.flashLoadTimeout && !sm2.getMoviePercent()),\r\n result = true,\r\n error;\r\n\r\n if (!wasTimeout) {\r\n didInit = true;\r\n }\r\n\r\n error = {\r\n type: (!hasFlash && needsFlash ? 'NO_FLASH' : 'INIT_TIMEOUT')\r\n };\r\n\r\n sm2._wD('SoundManager 2 ' + (disabled ? 'failed to load' : 'loaded') + ' (' + (disabled ? 'Flash security/load error' : 'OK') + ') ' + String.fromCharCode(disabled ? 10006 : 10003), disabled ? 2 : 1);\r\n\r\n if (disabled || bNoDisable) {\r\n\r\n if (sm2.useFlashBlock && sm2.oMC) {\r\n sm2.oMC.className = getSWFCSS() + ' ' + (sm2.getMoviePercent() === null ? swfCSS.swfTimedout : swfCSS.swfError);\r\n }\r\n\r\n processOnEvents({\r\n type: 'ontimeout',\r\n error: error,\r\n ignoreInit: true\r\n });\r\n\r\n debugTS('onload', false);\r\n catchError(error);\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n debugTS('onload', true);\r\n\r\n }\r\n\r\n if (!disabled) {\r\n\r\n if (sm2.waitForWindowLoad && !windowLoaded) {\r\n\r\n _wDS('waitOnload');\r\n event.add(window, 'load', initUserOnload);\r\n\r\n } else {\r\n\r\n // <d>\r\n if (sm2.waitForWindowLoad && windowLoaded) {\r\n _wDS('docLoaded');\r\n }\r\n // </d>\r\n\r\n initUserOnload();\r\n\r\n }\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * apply top-level setupOptions object as local properties, eg., this.setupOptions.flashVersion -> this.flashVersion (soundManager.flashVersion)\r\n * this maintains backward compatibility, and allows properties to be defined separately for use by soundManager.setup().\r\n */\r\n\r\n setProperties = function() {\r\n\r\n var i,\r\n o = sm2.setupOptions;\r\n\r\n for (i in o) {\r\n\r\n if (o.hasOwnProperty(i)) {\r\n\r\n // assign local property if not already defined\r\n\r\n if (sm2[i] === _undefined) {\r\n\r\n sm2[i] = o[i];\r\n\r\n } else if (sm2[i] !== o[i]) {\r\n\r\n // legacy support: write manually-assigned property (eg., soundManager.url) back to setupOptions to keep things in sync\r\n sm2.setupOptions[i] = sm2[i];\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n\r\n init = function() {\r\n\r\n // called after onload()\r\n\r\n if (didInit) {\r\n _wDS('didInit');\r\n return false;\r\n }\r\n\r\n function cleanup() {\r\n event.remove(window, 'load', sm2.beginDelayedInit);\r\n }\r\n\r\n if (sm2.html5Only) {\r\n\r\n if (!didInit) {\r\n // we don't need no steenking flash!\r\n cleanup();\r\n sm2.enabled = true;\r\n initComplete();\r\n }\r\n\r\n return true;\r\n\r\n }\r\n\r\n // flash path\r\n initMovie();\r\n\r\n try {\r\n\r\n // attempt to talk to Flash\r\n flash._externalInterfaceTest(false);\r\n\r\n /**\r\n * Apply user-specified polling interval, OR, if \"high performance\" set, faster vs. default polling\r\n * (determines frequency of whileloading/whileplaying callbacks, effectively driving UI framerates)\r\n */\r\n setPolling(true, (sm2.flashPollingInterval || (sm2.useHighPerformance ? 10 : 50)));\r\n\r\n if (!sm2.debugMode) {\r\n // stop the SWF from making debug output calls to JS\r\n flash._disableDebug();\r\n }\r\n\r\n sm2.enabled = true;\r\n debugTS('jstoflash', true);\r\n\r\n if (!sm2.html5Only) {\r\n // prevent browser from showing cached page state (or rather, restoring \"suspended\" page state) via back button, because flash may be dead\r\n // http://www.webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/\r\n event.add(window, 'unload', doNothing);\r\n }\r\n\r\n } catch(e) {\r\n\r\n sm2._wD('js/flash exception: ' + e.toString());\r\n\r\n debugTS('jstoflash', false);\r\n\r\n catchError({\r\n type: 'JS_TO_FLASH_EXCEPTION',\r\n fatal: true\r\n });\r\n\r\n // don't disable, for reboot()\r\n failSafely(true);\r\n\r\n initComplete();\r\n\r\n return false;\r\n\r\n }\r\n\r\n initComplete();\r\n\r\n // disconnect events\r\n cleanup();\r\n\r\n return true;\r\n\r\n };\r\n\r\n domContentLoaded = function() {\r\n\r\n if (didDCLoaded) return false;\r\n\r\n didDCLoaded = true;\r\n\r\n // assign top-level soundManager properties eg. soundManager.url\r\n setProperties();\r\n\r\n initDebug();\r\n\r\n if (!hasFlash && sm2.hasHTML5) {\r\n\r\n sm2._wD('SoundManager 2: No Flash detected' + (!sm2.useHTML5Audio ? ', enabling HTML5.' : '. Trying HTML5-only mode.'), 1);\r\n\r\n sm2.setup({\r\n useHTML5Audio: true,\r\n // make sure we aren't preferring flash, either\r\n // TODO: preferFlash should not matter if flash is not installed. Currently, stuff breaks without the below tweak.\r\n preferFlash: false\r\n });\r\n\r\n }\r\n\r\n testHTML5();\r\n\r\n if (!hasFlash && needsFlash) {\r\n\r\n messages.push(strings.needFlash);\r\n\r\n // TODO: Fatal here vs. timeout approach, etc.\r\n // hack: fail sooner.\r\n sm2.setup({\r\n flashLoadTimeout: 1\r\n });\r\n\r\n }\r\n\r\n if (doc.removeEventListener) {\r\n doc.removeEventListener('DOMContentLoaded', domContentLoaded, false);\r\n }\r\n\r\n initMovie();\r\n\r\n return true;\r\n\r\n };\r\n\r\n domContentLoadedIE = function() {\r\n\r\n if (doc.readyState === 'complete') {\r\n domContentLoaded();\r\n doc.detachEvent('onreadystatechange', domContentLoadedIE);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n winOnLoad = function() {\r\n\r\n // catch edge case of initComplete() firing after window.load()\r\n windowLoaded = true;\r\n\r\n // catch case where DOMContentLoaded has been sent, but we're still in doc.readyState = 'interactive'\r\n domContentLoaded();\r\n\r\n event.remove(window, 'load', winOnLoad);\r\n\r\n };\r\n\r\n // sniff up-front\r\n detectFlash();\r\n\r\n // focus and window load, init (primarily flash-driven)\r\n event.add(window, 'focus', handleFocus);\r\n event.add(window, 'load', delayWaitForEI);\r\n event.add(window, 'load', winOnLoad);\r\n\r\n if (doc.addEventListener) {\r\n\r\n doc.addEventListener('DOMContentLoaded', domContentLoaded, false);\r\n\r\n } else if (doc.attachEvent) {\r\n\r\n doc.attachEvent('onreadystatechange', domContentLoadedIE);\r\n\r\n } else {\r\n\r\n // no add/attachevent support - safe to assume no JS -> Flash either\r\n debugTS('onload', false);\r\n catchError({\r\n type: 'NO_DOM2_EVENTS',\r\n fatal: true\r\n });\r\n\r\n }\r\n\r\n} // SoundManager()\r\n\r\n// SM2_DEFER details: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading\r\n\r\nif (window.SM2_DEFER === _undefined || !SM2_DEFER) {\r\n soundManager = new SoundManager();\r\n}\r\n\r\n/**\r\n * SoundManager public interfaces\r\n * ------------------------------\r\n */\r\n\r\nif (typeof module === 'object' && module && typeof module.exports === 'object') {\r\n\r\n /**\r\n * commonJS module\r\n */\r\n\r\n module.exports.SoundManager = SoundManager;\r\n module.exports.soundManager = soundManager;\r\n\r\n} else if (typeof define === 'function' && define.amd) {\r\n\r\n /**\r\n * AMD - requireJS\r\n * basic usage:\r\n * require([\"/path/to/soundmanager2.js\"], function(SoundManager) {\r\n * SoundManager.getInstance().setup({\r\n * url: '/swf/',\r\n * onready: function() { ... }\r\n * })\r\n * });\r\n *\r\n * SM2_DEFER usage:\r\n * window.SM2_DEFER = true;\r\n * require([\"/path/to/soundmanager2.js\"], function(SoundManager) {\r\n * SoundManager.getInstance(function() {\r\n * var soundManager = new SoundManager.constructor();\r\n * soundManager.setup({\r\n * url: '/swf/',\r\n * ...\r\n * });\r\n * ...\r\n * soundManager.beginDelayedInit();\r\n * return soundManager;\r\n * })\r\n * });\r\n */\r\n\r\n define(function() {\r\n /**\r\n * Retrieve the global instance of SoundManager.\r\n * If a global instance does not exist it can be created using a callback.\r\n *\r\n * @param {Function} smBuilder Optional: Callback used to create a new SoundManager instance\r\n * @return {SoundManager} The global SoundManager instance\r\n */\r\n function getInstance(smBuilder) {\r\n if (!window.soundManager && smBuilder instanceof Function) {\r\n var instance = smBuilder(SoundManager);\r\n if (instance instanceof SoundManager) {\r\n window.soundManager = instance;\r\n }\r\n }\r\n return window.soundManager;\r\n }\r\n return {\r\n constructor: SoundManager,\r\n getInstance: getInstance\r\n };\r\n });\r\n\r\n}\r\n\r\n// standard browser case\r\n\r\n// constructor\r\nwindow.SoundManager = SoundManager;\r\n\r\n/**\r\n * note: SM2 requires a window global due to Flash, which makes calls to window.soundManager.\r\n * Flash may not always be needed, but this is not known until async init and SM2 may even \"reboot\" into Flash mode.\r\n */\r\n\r\n// public API, flash callbacks etc.\r\nwindow.soundManager = soundManager;\r\n\r\n}(window));\r\n"],"names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","methodName","return","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_defineProperties","target","props","descriptor","input","hint","prim","toPrimitive","res","String","_toPrimitive","PageChunk","leafIndex","chunkIndex","text","lineRects","instance","Constructor","_classCallCheck","this","staticProps","_fetch","_callee","server","bookPath","chunks","_context","$","ajax","url","concat","dataType","cache","data","path","page","_fromTextWrapperResponse","args","arguments","apply","_x","_x2","_x3","chunksResponse","map","c","correctedLineRects","_fixChunkRects","correctedText","_removeDanglingHyphens","rects","_rects","_slicedToArray","firstRect","secondRect","_firstRect","left","bottom","width","secondHeight","secondWidth","secondRight","replace","PageChunkIterator","pageCount","start","opts","assign","DEFAULT_OPTS","_cursor","chunk","_bufferedPages","_bufferingPages","_cursorLock","protoProps","_nextUncontrolled2","_this","_nextUncontrolled","_this2","_decrementUncontrolled","AT_END","_recenterBuffer","_fetchPageChunks","_this3","cursorChangePromise","prevPageChunks","index","Math","max","pageBufferSize","end","min","_removePageFromBuffer","_this4","_fetchPageChunksDirect","fetch","_asyncToGenerator","_toPropertyKey","AbstractTTSEngine","options","voice","getBestBookVoice","getVoices","bookLanguage","playing","paused","_chunkIterator","activeSound","playbackRate","events","on","updateBestVoice","trigger","_step","_jumpBackward","numLeafs","onLoadingStart","step","fireEvent","pause","resume","all","decrement","voiceURI","off","find","setVoice","newRate","setPlaybackRate","_callee2","sound","playPromise","_context2","onDone","createSound","rate","load","onLoadingComplete","beforeChunkPlay","playSound","afterChunkPlay","loaded","play","voices","userLanguages","navigator","languages","bookLangVoices","filter","v","lang","startsWith","matchingUserLangs","language","getMatchingVoice","default","_step2","_iterator","_createForOfIteratorHelper","_loop","matchingVoices","s","n","_ret","e","f","_createClass","_get","Reflect","get","bind","property","receiver","base","_getPrototypeOf","_superPropBase","getOwnPropertyDescriptor","_setPrototypeOf","o","p","FestivalTTSEngine","_AbstractTTSEngine","subClass","superClass","_inherits","_iOSCaptureUserIntentHack","Derived","hasNativeReflectConstruct","_super","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","Super","NewTarget","ReferenceError","_assertThisInitialized","_possibleConstructorReturn","_$$browser","audioFormat","browser","mozilla","localService","soundManager","setup","debugMode","preferFlash","useHTML5Audio","flashVersion","promise","userAgent","match","iOSCaptureUserIntentHack","FestivalTTSSound","getSoundUrl","dataString","encodeURIComponent","SILENCE_1MS","onfinish","destruct","supported","soundUrl","_finishResolver","_play","onload","_onresume","onresume","sleep","_callee3","_context3","mp3","ogg","isChrome","vendor","test","isFirefox","isAndroid","COLUMN_TO_LANG_INDEX","searchForISO6391","columnsToSearch","langs","colI","column","split","x","toLowerCase","indexOf","super_","WebTTSEngine","speechSynthesis","addEventListener","audio","Audio","SILENCE_6S_MP3","loop","src","mediaSession","metadata","MediaMetadata","title","br","bookTitle","artist","m","label","artwork","thumbnail","setActionHandler","jumpBackward","jumpForward","unshift","WebTTSSound","window","started","stopped","utterance","_lastEvents","boundary","_charIndex","_finishPromise","_chromePausingBugFix2","_resume","_pause","_finish","_reload","_this$voice","SpeechSynthesisUtterance","location","toString","console","log","ev","dispatchEvent","CustomEvent","wasPaused","recentEvent","charIndex","cancel","speak","isLocalVoice","_chromePausingBugFix","endPromise","race","promisifyEvent","Event","pausePromise","pauseMightNotWork","timeoutPromise","_callee4","resumeMightNotWork","resumeMightNotFire","resumePromise","_context4","reload","_callee5","_context5","t0","en","jQuery","extend","BookReader","defaultOptions","enableTtsPlugin","_ttsBoxesByIndex","TTSEngine","isSupported","engineName","festival","web","ttsEngine","showProgressPopup","removeProgressPopup","ttsStop","ttsBeforeChunkPlay","ttsSendChunkFinishedAnalyticsEvent","init","eventNames","PostInit","click","ttsToggle","ttsStart","_createPageContainer","pageContainer","pageIndex","renderBoxesInPageContainerLayer","$container","buildMobileDrawerElement","$el","after","imagesBaseURL","initNavbar","refs","$BRReadAloudToolbar","prepend","renderVoiceOption","join","voiceSortOrder","a","b","localeCompare","renderVoicesMenu","voicesMenu","empty","bookLanguages","sort","otherLanguages","append","show","hide","ttsUpdateState","ttsPlayPause","ttsJumpForward","ttsJumpBackward","$rateSelector","parseFloat","tooltips","insertBefore","closest","autoStop","startTTSEngine","constModeThumb","mode","switchMode","constMode1up","addClass","ttsSendAnalyticsEvent","currentIndex","book","getNumLeafs","isPlaying","toggleClass","togglePlayPause","removeClass","ttsRemoveHilites","_ref","ttsMaybeFlipToIndex","ttsHighlightChunk","ttsScrollToChunk","_ref2","constMode2up","jumpToIndex","_modes","mode2Up","mode2UpLit","_ref3","_ref4","l","r","t","_Object$entries$_i","_Object$entries","_i2","pageIndexString","boxes","getPage","getActivePageContainerElementsForIndex","container","entries","_$$last","last","scrollIntoView","block","isFullscreenActive","inline","behavior","getActivePageContainerElements","remove","action","archiveAnalyticsSendEvent","extraValues","mediaLanguage","global","fails","uncurryThis","trim","whitespaces","$parseFloat","ITERATOR","FORCED","module","string","trimmedString","$entries","stat","O","forced","uaMatch","ua","exec","platform_match","matched","version","versionNumber","platform","parseInt","android","bb","blackberry","ipad","iphone","ipod","kindle","playbook","silk","mobile","cros","mac","linux","win","desktop","chrome","opr","safari","webkit","rv","iemobile","ie","edge","msedge","opera","jQBrowser","factory","_undefined","document","SoundManager","smURL","smID","setupOptions","debugFlash","useConsole","consoleOnly","waitForWindowLoad","bgColor","useHighPerformance","flashPollingInterval","html5PollingInterval","flashLoadTimeout","wmode","allowScriptAccess","useFlashBlock","forceUseGlobalHTML5Audio","ignoreMobileRestrictions","html5Test","noSWFCache","idPrefix","autoLoad","autoPlay","from","loops","onid3","onerror","whileloading","onplay","onpause","whileplaying","onposition","onstop","multiShot","multiShotEvents","position","pan","stream","to","usePolicyFile","volume","flash9Options","onfailure","isMovieStar","usePeakData","useWaveformData","useEQData","onbufferchange","ondataerror","movieStarOptions","bufferTime","serverURL","onconnect","duration","audioFormats","required","mp4","related","opus","wav","flac","movieID","id","debugID","debugURLParam","movieURL","altURL","swfLoaded","enabled","oMC","sounds","soundIDs","muted","didFlashBlock","filePattern","filePatterns","flash8","flash9","features","buffering","peakData","waveformData","eqData","movieStar","sandbox","types","remote","localWithFile","localWithNetwork","localTrusted","description","noRemote","noLocal","html5","usingFlash","flash","html5Only","ignoreFlash","SMSound","doNothing","setProperties","fV","debugTS","_wDS","initComplete","mixin","extraOptions","addOnEvent","processOnEvents","initUserOnload","delayWaitForEI","waitForEI","rebootIntoHTML5","setVersionInfo","handleFocus","strings","initMovie","domContentLoaded","winOnLoad","didDCLoaded","getDocument","createMovie","catchError","setPolling","initDebug","disableObject","failSafely","normalizeMovieURL","str","flashBlockHandler","getSWFCSS","swfCSS","toggleDebug","loopFix","policyFix","complain","idCheck","startTimer","stopTimer","timerExecute","parseURL","canIgnoreFlash","featureCheck","html5OK","html5CanPlay","html5ErrorCodes","html5Ext","html5Unload","domContentLoadedIE","testHTML5","event","lastGlobalHTML5URL","hasFlash","detectFlash","badSafariFix","html5_events","showSupport","flushMessages","wrapCallback","didSetup","sm2","globalHTML5Audio","sm","smc","wl","href","doc","on_queue","debugOpen","didAppend","appendSuccess","didInit","disabled","windowLoaded","wdCount","debugLevels","oRemoved","oRemovedHTML","waitingForEI","initPending","h5TimerCount","h5IntervalTimer","messages","needsFlash","Array","useGlobalHTML5Audio","idCounter","msecScale","is_iDevice","isIE","isWebkit","isSafari","isOpera","mobileHTML5","isBadSafari","hasConsole","isFocused","hasFocus","tryInitOnFocus","okToDisable","flashMIME","emptyURL","overHTTP","protocol","http","netStreamMimeTypes","netStreamTypes","netStreamPattern","RegExp","preferFlashCheck","kind","html5_event","oFn","_s","_a","_wD","h5","mimePattern","useAltURL","swfBox","swfDefault","swfError","swfTimedout","swfUnblocked","sm2Debug","highPerf","flashDebug","hasHTML5","canPlayType","noURL","ok","globalHTML5","ignoreMobile","mobileUA","beginDelayedInit","readyState","setTimeout","getMovie","movie_id","oOptions","_url","cs","cs_string","oSound","make","_setup_html5","_createSound","connected","destroySound","sID","_bFromSound","oS","_iO","unload","splice","onPosition","nPosition","oMethod","oScope","clearOnPosition","overloaded","allowOverride","setPosition","nMsecOffset","stopAll","pauseAll","resumeAll","togglePause","setPan","nPan","setVolume","nVol","j","mute","muteAll","unmute","unmuteAll","toggleMute","getMemoryUse","ram","_getMemoryUse","disable","bNoDisable","canPlayMIME","sMIME","canPlayURL","sURL","canPlayLink","oLink","getSoundById","_suppressDebug","onready","sType","ontimeout","_writeDebug","sText","sTypeOrObject","oItem","createElement","className","appendChild","createTextNode","style","fontWeight","color","firstChild","alert","_debug","reboot","resetEvents","excludeInit","k","innerHTML","parentNode","removeChild","fired","getMoviePercent","PercentLoaded","resetProperties","add_html5_events","remove_html5_events","stop_html5_timer","start_html5_timer","attachOnPosition","detachOnPosition","applyFromTo","lastHTML5State","urlOmitted","onplay_called","onPositionItems","onPositionFired","lastURL","time","instanceOptions","isHTML5","id3","playState","_called_load","_html5_canplay","autobuffer","preload","_load","fatal","_unload","_bFromSM","_destroySound","_updatePlayState","fN","audioClone","onended","oncanplay","startOK","getAutoPlay","setAutoPlay","substr","lastIndexOf","instanceCount","_oncanplay","_onfinish","currentTime","add","_start","onplayerror","bAll","originalPosition","_onbufferchange","_resetOnPosition","_onTimer","_stop","_setAutoPlay","normalizedRate","message","position1K","offset","toFixed","_setPosition","_bCallFlash","bInstanceOnly","_setPan","_bInstanceOnly","_setVolume","hasIO","scope","_processOnPosition","item","op","retainPosition","_hasTimer","bytesLoaded","bytesTotal","durationEstimate","buffered","right","failures","isBuffering","bForce","isNew","_get_html5_duration","_whileplaying","d","Infinity","_apply_loop","nLoops","sameURL","dURL","decodeURI","_added_events","oEvt","removeEventListener","_onload","nSuccess","loadOK","_onerror","errorCode","nIsBuffering","_onsuspend","onsuspend","_onfailure","msg","level","code","_onwarning","onwarning","io_onfinish","_whileloading","nBytesLoaded","nBytesTotal","nDuration","nBufferLength","floor","bufferLength","oPeakData","oWaveformDataLeft","oWaveformDataRight","oEQData","eqLeft","leftPeak","rightPeak","leftEQ","rightEQ","_oncaptiondata","oData","captiondata","oncaptiondata","_onmetadata","oMDProps","oMDData","onmetadata","_onid3","oID3Props","oID3Data","_onconnect","bSuccess","_ondataerror","sError","body","getElementsByTagName","getElementById","oMain","oAdd","o2","o1","callback","oParent","hasParent","bonusOptions","Function","old","evt","getArgs","oArgs","len","element","shift","abort","canplay","ee","canplaythrough","durationchange","ended","loadeddata","_loaded","loadedmetadata","loadstart","fromCharCode","progress","progStr","isProgress","ranges","total","ratechange","suspend","stalled","timeupdate","waiting","iO","oAudio","_called_unload","fileExt","mime","aF","lookup","support","cp","canPlay","isOK","notReady","notOK","domError","spcWmode","swf404","tryDebug","checkSWF","localFail","waitFocus","waitForever","waitSWF","needFunction","badID","currentObj","waitOnload","docLoaded","onloadOK","secNote","badRemove","shutdown","queue","smError","fbTimeout","fbLoaded","fbHandler","manURL","onURL","badFV","as2loop","noNSLoop","needfl9","mfTimeout","needFlash","gotFocus","policy","setupError","setupUndef","setupLate","sm2Loaded","sstr","sOpt","sPre","sMsg","warn","oProp","Date","getTime","isDebug","bPolling","bHighPerformance","_setPolling","oD","oDebug","oTarget","oToggle","tmp","height","lineHeight","margin","textAlign","border","cursor","background","zIndex","onclick","display","e2","errorLevel","oT","sEventType","sMessage","sm2Debugger","handleEvent","css","ignoreInit","status","success","srcQueue","canRetry","nP","hasPlugin","AX","ActiveXObject","plugins","mimeTypes","enabledPlugin","flashNeeded","formats","urlResult","setInterval","clearInterval","_setSandboxType","sandboxType","sb","_externalInterfaceOK","swfVersion","initMsg","isRTL","oEmbed","oMovie","movieHTML","oEl","sClass","remoteURL","localURL","extraClass","html","param","dir","quality","bgcolor","pluginspage","hasPriority","FlashVars","setAttribute","overflow","top","abs","oninitmovie","loadIncomplete","cleanup","tests","_externalInterfaceTest","_disableDebug","detachEvent","attachEvent","SM2_DEFER","getInstance","smBuilder"],"sourceRoot":""}