From 69dde761ea3453e139c8ab4076b5f14d46108e7f Mon Sep 17 00:00:00 2001 From: Dan Pastori Date: Thu, 18 Jul 2019 08:33:04 -0700 Subject: [PATCH] Fixed "previous" key down event issue --- dist/amplitude.js | 6 +++--- dist/amplitude.js.map | 2 +- dist/amplitude.min.js | 2 +- package.json | 2 +- src/events/keydown.js | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/amplitude.js b/dist/amplitude.js index 812d2b60..87b57d6c 100644 --- a/dist/amplitude.js +++ b/dist/amplitude.js @@ -7094,9 +7094,9 @@ var KeyDown = function () { or null and set the previous song. */ if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) { - _audioNavigation2.default.setPrev(); + _audioNavigation2.default.setPrevious(); } else { - _audioNavigation2.default.setPrevPlaylist(_config2.default.active_playlist); + _audioNavigation2.default.setPreviousPlaylist(_config2.default.active_playlist); } } @@ -13355,7 +13355,7 @@ module.exports = exports["default"]; /* 59 */ /***/ (function(module, exports) { -module.exports = {"name":"amplitudejs","version":"5.0.1","description":"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs","main":"dist/amplitude.js","devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-add-module-exports":"0.2.1","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.18.0","husky":"^1.3.1","jest":"^23.6.0","prettier":"1.15.1","pretty-quick":"^1.11.1","watch":"^1.0.2","webpack":"^2.7.0"},"directories":{"doc":"docs"},"files":["dist"],"scripts":{"build":"node_modules/.bin/webpack","watch":"watch 'node_modules/.bin/webpack' dist","prettier":"npx pretty-quick","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/521dimensions/amplitudejs.git"},"keywords":["webaudio","html5","javascript","audio-player"],"author":"521 Dimensions (https://521dimensions.com)","license":"MIT","bugs":{"url":"https://github.com/521dimensions/amplitudejs/issues"},"homepage":"https://github.com/521dimensions/amplitudejs#readme"} +module.exports = {"name":"amplitudejs","version":"5.0.2","description":"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs","main":"dist/amplitude.js","devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-add-module-exports":"0.2.1","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.18.0","husky":"^1.3.1","jest":"^23.6.0","prettier":"1.15.1","pretty-quick":"^1.11.1","watch":"^1.0.2","webpack":"^2.7.0"},"directories":{"doc":"docs"},"files":["dist"],"scripts":{"build":"node_modules/.bin/webpack","watch":"watch 'node_modules/.bin/webpack' dist","prettier":"npx pretty-quick","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/521dimensions/amplitudejs.git"},"keywords":["webaudio","html5","javascript","audio-player"],"author":"521 Dimensions (https://521dimensions.com)","license":"MIT","bugs":{"url":"https://github.com/521dimensions/amplitudejs/issues"},"homepage":"https://github.com/521dimensions/amplitudejs#readme"} /***/ }) /******/ ]); diff --git a/dist/amplitude.js.map b/dist/amplitude.js.map index fa97399a..6d7b969b 100644 --- a/dist/amplitude.js.map +++ b/dist/amplitude.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 17c1d40ce75dea4bff13","webpack:///./src/config.js","webpack:///./src/core/core.js","webpack:///./src/visual/playPauseElements.js","webpack:///./src/utilities/audioNavigation.js","webpack:///./src/utilities/debug.js","webpack:///./src/utilities/checks.js","webpack:///./src/utilities/configState.js","webpack:///./src/utilities/callbacks.js","webpack:///./src/visual/metaDataElements.js","webpack:///./src/visual/repeatElements.js","webpack:///./src/visual/muteElements.js","webpack:///./src/visual/volumeSliderElements.js","webpack:///./src/utilities/repeater.js","webpack:///./src/utilities/shuffler.js","webpack:///./src/visual/songSliderElements.js","webpack:///./src/visual/timeElements.js","webpack:///./src/fx/visualizations.js","webpack:///./src/soundcloud/soundcloud.js","webpack:///./src/visual/playbackSpeedElements.js","webpack:///./src/visual/shuffleElements.js","webpack:///./src/visual/songPlayedProgressElements.js","webpack:///./src/init/init.js","webpack:///./src/fx/waveform.js","webpack:///./src/utilities/time.js","webpack:///./src/visual/bufferedProgressElements.js","webpack:///./src/events/ended.js","webpack:///./src/events/events.js","webpack:///./src/events/keydown.js","webpack:///./src/events/mute.js","webpack:///./src/events/next.js","webpack:///./src/events/pause.js","webpack:///./src/events/play.js","webpack:///./src/events/playPause.js","webpack:///./src/events/playbackSpeed.js","webpack:///./src/events/prev.js","webpack:///./src/events/progress.js","webpack:///./src/events/repeat.js","webpack:///./src/events/repeatSong.js","webpack:///./src/events/shuffle.js","webpack:///./src/events/skipTo.js","webpack:///./src/events/songSlider.js","webpack:///./src/events/stop.js","webpack:///./src/events/timeUpdate.js","webpack:///./src/events/volumeDown.js","webpack:///./src/events/volumeSlider.js","webpack:///./src/events/volumeUp.js","webpack:///./src/fx/fx.js","webpack:///./src/index.js","webpack:///./src/init/playlists.js","webpack:///./src/visual/containerElements.js","webpack:///./src/visual/time/currentHourElements.js","webpack:///./src/visual/time/currentMinuteElements.js","webpack:///./src/visual/time/currentSecondElements.js","webpack:///./src/visual/time/currentTimeElements.js","webpack:///./src/visual/time/durationCountDownTimeElements.js","webpack:///./src/visual/time/durationHourElements.js","webpack:///./src/visual/time/durationMinuteElements.js","webpack:///./src/visual/time/durationSecondElements.js","webpack:///./src/visual/time/durationTimeElements.js","webpack:///./package.json"],"names":["module","exports","version","audio","Audio","active_metadata","active_album","active_index","active_playlist","playback_speed","callbacks","songs","playlists","start_song","starting_playlist","starting_playlist_song","repeat","repeat_song","shuffle_list","shuffle_on","default_album_art","default_playlist_art","debug","volume","pre_mute_volume","volume_increment","volume_decrement","soundcloud_client","soundcloud_use_art","soundcloud_song_count","soundcloud_songs_ready","is_touch_moving","buffered","bindings","continue_next","delay","player_state","web_audio_api_available","context","source","analyser","visualizations","available","active","backup","waveforms","sample_rate","built","Core","play","Visualizations","stop","run","config","live","reconnectStream","test","navigator","userAgent","paused","playPromise","undefined","then","catch","playbackRate","pause","disconnectStream","currentTime","Callbacks","setVolume","volumeLevel","muted","setSongLocation","songPercentage","duration","skipToLocation","seconds","addEventListener","Debug","writeMessage","once","src","load","url","setPlaybackSpeed","playbackSpeed","PlayPauseElements","sync","syncGlobal","syncPlaylist","syncSong","syncSongInPlaylist","state","playPauseElements","document","querySelectorAll","i","length","playlist","getAttribute","song","setElementPlay","setElementPause","playlistPlayPauseElements","songPlayPauseElements","activePlaylistIndex","songInPlaylistPlayPauseElements","syncToPause","element","classList","add","remove","AudioNavigation","setNext","songEnded","nextIndex","nextSong","endOfList","index","parseInt","changeSong","setNextPlaylist","shuffle","setActivePlaylist","changeSongPlaylist","setPrevious","previousIndex","previousSong","setPreviousPlaylist","prepareSongChange","album","afterSongChange","SongSliderElements","resetElements","SongPlayedProgressElements","TimeElements","resetCurrentTimes","Checks","newAlbum","MetaDataElements","displayMetaData","ContainerElements","setActive","resetDurationTimes","message","console","log","newSong","songIndex","newPlaylist","isURL","pattern","isInt","int","isNaN","Number","ConfigState","resetConfig","setPlayerState","initialize","callbackName","callbackFunction","error","imageMetaDataKeys","songInfoElements","info","val","indexOf","setAttribute","innerHTML","displayPlaylistMetaData","playlistInfoElements","setFirstSongInPlaylist","elementPlaylist","syncMetaData","RepeatElements","syncRepeat","repeatClasses","getElementsByClassName","syncRepeatPlaylist","repeatButtons","syncRepeatSong","repeatSongClasses","MuteElements","setMuted","muteClasses","VolumeSliderElements","volumeSliders","value","Repeater","setRepeat","setRepeatPlaylist","setRepeatSong","Shuffler","setShuffle","shuffleSongs","toggleShuffle","setShufflePlaylist","shufflePlaylistSongs","toggleShufflePlaylist","shuffleTemp","Array","randNum","Math","floor","random","shuffleSwap","shuffleList","original","temp","location","syncMain","mainSongSliders","playlistSongSliders","playlistAttribute","songAttribute","songSliders","songInPlaylistSliders","CurrentTimeElements","resetTimes","CurrentHourElements","CurrentMinuteElements","CurrentSecondElements","syncCurrentTimes","hours","minutes","DurationCountDownTimeElements","DurationHourElements","DurationMinuteElements","DurationSecondElements","DurationTimeElements","syncDurationTimes","songDuration","visualizationElements","Object","keys","runGlobalVisualization","runPlaylistVisualization","runSongVisualization","runSongInPlaylistVisualization","displayBackups","globalVisualizationIndex","visualization","activeSongVisualizationIndex","addToActiveVisualizations","firstVisualization","activePlaylistVisualizationIndex","key","setPreferences","startVisualization","push","stopVisualization","register","preferences","newVisualization","getID","x","displayGlobalBackup","displayPlaylistBackup","displaySongBackup","displaySongInPlaylistBackup","style","backgroundImage","cover_art_url","SoundCloud","tempUserConfig","loadSoundCloud","userConfig","head","getElementsByTagName","script","createElement","type","onreadystatechange","initSoundcloud","onload","appendChild","SC","client_id","getStreamableURLs","soundcloud_regex","match","resolveStreamable","resolveIndividualStreamableURL","addToShuffleList","get","sound","streamable","stream_url","artwork_url","soundcloud_data","AmplitudeHelpers","writeDebugMessage","name","artist","AmplitudeInitializer","setConfig","isSoundCloudURL","PlaybackSpeedElements","playbackSpeedClasses","ShuffleElements","shuffleButtons","songPlayedPercentage","percentage","songPlayedProgressBars","max","Initializer","ready","Events","setArt","Fx","webAudioAPIAvailable","determineUsingAnyFX","configureWebAudioAPI","documentElement","resume","WaveForm","init","object","params","initializeDefaultLiveSettings","initializeDefaultSongIndexes","rebindDisplay","countPlaylists","PlaylistsInitializer","preload","initializeElements","size","hasOwnProperty","buffer","sampleRate","peaks","svg","createElementNS","g","path","build","abs","split","reduce","a","b","charCodeAt","req","XMLHttpRequest","open","responseType","e","readyState","status","decodeAudioData","response","bufferedAudio","getPeaks","process","send","displayWaveForms","totalPeaks","d","peakNumber","shift","sampleSize","sampleStep","numberOfChannels","mergedPeaks","channelNumber","channelData","getChannelData","start","end","min","sampleIndex","waveformElements","displayGlobalWaveform","displayPlaylistWaveform","displaySongWaveform","displaySongInPlaylistWaveform","waveformPath","querySelector","determineIfUsingWaveforms","Time","computeCurrentTimes","currentSeconds","currentMinutes","currentHours","computeSongDuration","songDurationSeconds","songDurationMinutes","songDurationHours","toString","computeSongCompletionPercentage","setCurrentTime","time","isFinite","BufferedProgressElements","songBufferedProgressBars","parseFloat","songBufferedProgressBarsPlaylist","songBufferedProgressBarsSongs","songBufferedProgressBarsSongsInPlaylist","reset","Ended","handle","setTimeout","AmplitudeCore","bindTimeUpdate","bindKeyDownEventHandlers","bindSongEnded","bindProgress","bindPlay","bindPause","bindPlayPause","bindStop","bindMute","bindVolumeUp","bindVolumeDown","bindSongSlider","bindVolumeSlider","bindNext","bindPrev","bindShuffle","bindRepeat","bindRepeatSong","bindPlaybackSpeed","bindSkipTo","bindCanPlayThrough","removeEventListener","TimeUpdate","KeyDown","Progress","play_classes","Play","pause_classes","Pause","play_pause_classes","PlayPause","stop_classes","Stop","mute_classes","Mute","volume_up_classes","VolumeUp","volume_down_classes","VolumeDown","ua","window","msie","song_sliders","SongSlider","volume_sliders","VolumeSlider","next_classes","Next","prev_classes","Prev","shuffle_classes","Shuffle","repeat_classes","Repeat","repeat_song_classes","RepeatSong","playback_speed_classes","PlaybackSpeed","skipToClasses","SkipTo","event","runKeyEvent","which","runPlayPauseKeyDownEvent","runNextKeyDownEvent","runPrevKeyDownEvent","runStopKeyDownEvent","runShuffleKeyDownEvent","runRepeatKeyDownEvent","setPrev","setPrevPlaylist","handleGlobalNext","handlePlaylistNext","songIndexAttribute","handleGlobalPause","handlePlaylistPause","handleSongPause","handleSongInPlaylistPause","handleGlobalPlay","handlePlaylistPlay","handleSongPlay","handleSongInPlaylistPlay","handleGlobalPlayPause","handlePlaylistPlayPause","handleSongPlayPause","handleSongInPlaylistPlayPause","handleGlobalPrev","handlePlaylistPrev","bufferedEnd","handleGlobalRepeat","handlePlaylistRepeat","handleGlobalShuffle","handlePlaylistShuffle","handleSkipToSong","handleSkipToPlaylist","locationPercentage","computedTime","handleGlobalSongSlider","handlePlaylistSongSlider","handleSongSongSlider","handleSongInPlaylistSongSlider","computeBufferedTime","updateTimeInformation","runTimeCallbacks","songCompletionPercentage","time_callbacks","browserContext","AudioContext","webkitAudioContext","mozAudioContext","oAudioContext","msAudioContext","createAnalyser","crossOrigin","createMediaElementSource","connect","destination","Amplitude","getConfig","bindNewElements","getActivePlaylist","getPlaybackSpeed","speed","getRepeat","getRepeatPlaylist","playlistKey","getShuffle","getShufflePlaylist","repeatState","getDefaultAlbumArt","getDefaultPlaylistArt","setDefaultAlbumArt","setDefaultPlaylistArt","default_plalist_art","getSongPlayedPercentage","getSongPlayedSeconds","getSongDuration","setSongPlayedPercentage","setDebug","getActiveSongMetadata","getActivePlaylistMetadata","getSongAtIndex","getSongAtPlaylistIndex","addSong","addSongToPlaylist","addPlaylist","data","ignoredKeys","dataKey","removeSong","splice","removeSongFromPlaylist","playNow","playSongAtIndex","playPlaylistSongAtIndex","getAudio","getAnalyser","next","nextData","prev","prevData","getSongs","getSongsInPlaylist","getSongsState","getSongsStatePlaylist","getActiveIndex","getVersion","getBuffered","skipTo","setSongMetaData","metaData","setPlaylistMetaData","setDelay","getDelay","getPlayerState","registerVisualization","setPlaylistVisualization","visualizationKey","setSongVisualization","setSongInPlaylistVisualization","setGlobalVisualization","getVolume","copySongsToPlaylists","grabSoundCloudData","initializePlaylistActiveIndexes","initializePlaylistShuffleStatuses","initializePlaylistsRepeatStatuses","initializePlaylistShuffleLists","initializeFirstSongInPlaylistMetaData","songContainers","activeIndex","hasAttribute","currentHourSelectors","currentHourPlaylistSelectors","currentHourSongSelectors","currentHourPlaylistSongSelectors","hourSelectors","currentMinuteSelectors","currentMinutePlaylistSelectors","currentMinuteSongSelectors","currentMinutePlaylistSongSelectors","minuteSelectors","currentSecondSelectors","currentSecondPlaylistSelectors","currentSecondSongSelectors","currentSecondPlaylistSongSelectors","secondSelectors","currentTimeSelectors","timeText","timeSelectors","countDownTime","timeRemaining","computeTimeRemaining","durationTimeRemainingSelectors","totalCurrentSeconds","totalDurationSeconds","timeRemainingTotalSeconds","remainingHours","remainingMinutes","remainingSeconds","durationHourSelectors","durationMinuteSelectors","durationSecondSelectors","durationTime","durationText","computeDurationText","durationTimeSelectors"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;ACdA;;AAEAA,OAAOC,OAAP,GAAiB;AACfC,WAASA,gBADM;;AAGfC,SAAO,IAAIC,KAAJ,EAHQ;;AAKfC,mBAAiB,EALF;;AAOfC,gBAAc,EAPC;;AASfC,gBAAc,CATC;;AAWfC,mBAAiB,IAXF;;AAafC,kBAAgB,GAbD;;AAefC,aAAW,EAfI;;AAiBfC,SAAO,EAjBQ;;AAmBfC,aAAW,EAnBI;;AAqBfC,cAAY,EArBG;;AAuBfC,qBAAmB,EAvBJ;;AAyBfC,0BAAwB,EAzBT;;AA2BfC,UAAQ,KA3BO;;AA6BfC,eAAa,KA7BE;;AA+BfC,gBAAc,EA/BC;;AAiCfC,cAAY,KAjCG;;AAmCfC,qBAAmB,EAnCJ;;AAqCfC,wBAAsB,EArCP;;AAuCfC,SAAO,KAvCQ;;AAyCfC,UAAQ,GAzCO;;AA2CfC,mBAAiB,GA3CF;;AA6CfC,oBAAkB,CA7CH;;AA+CfC,oBAAkB,CA/CH;;AAiDfC,qBAAmB,EAjDJ;;AAmDfC,sBAAoB,KAnDL;;AAqDfC,yBAAuB,CArDR;;AAuDfC,0BAAwB,CAvDT;;AAyDfC,mBAAiB,KAzDF;;AA2DfC,YAAU,CA3DK;;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WAAOA,YAAP;AACD;;AAED;;;AAGA,SAAO;AACL9hB,UAAMA,IADD;AAELoI,gBAAYA;AAFP,GAAP;AAID,CArJ0B,EAA3B,C,CAXA;;;;kBAkKeW,oB;;;;;;;AClKf,kBAAkB,mTAAmT,uQAAuQ,gBAAgB,aAAa,6BAA6B,iIAAiI,eAAe,0EAA0E,2IAA2I,4DAA4D,kE","file":"amplitude.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Amplitude\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Amplitude\"] = factory();\n\telse\n\t\troot[\"Amplitude\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 47);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 17c1d40ce75dea4bff13","/**\n * These variables make Amplitude run. The config is the most important\n * containing active settings and parameters.\n *\n * The config JSON is the global settings for ALL of Amplitude functions.\n * This is global and contains all of the user preferences. The default\n * settings are set, and the user overwrites them when they initialize\n * Amplitude.\n *\n * @module config\n * @type {object}\n * @property {string} \tconfig.version \t\t\t\t- The current version of AmplitudeJS.\n * @property {object} \tconfig.audio \t\t \t\t\t\t\t\t\t\t-\tHandles all of the audio.\n * @property {object} \tconfig.active_metadata\t\t\t\t\t- Contains the active metadata for the song.\n * @property {string} \tconfig.active_album\t\t\t\t\t\t\t- Holds the active album name. Used to check and see if the album changed and run the album changed callback.\n * @property {number} \tconfig.active_index\t\t\t\t\t\t\t- Contains the index of the actively playing song.\n * @property {string} \tconfig.active_playlist\t\t\t\t\t- Contains the key to the active playlist index.\n * @property {number} \tconfig.playback_speed\t\t\t\t\t\t- Sets the initial playback speed of the song. The values for this can be 1.0, 1.5, 2.0\n * @property {object} \tconfig.callbacks\t\t\t\t\t\t\t\t- The user can pass a JSON object with a key => value store of callbacks to be run at certain events.\n * @property {array} \t\tconfig.songs\t\t\t\t\t\t\t\t\t\t- Contains all of the songs the user has passed to Amplitude to use.\n * @property {object} \tconfig.playlists\t\t\t\t\t\t\t\t- Contains all of the playlists the user created.\n * @property {object} \tconfig.start_song \t\t\t\t\t\t\t- The index of the song that AmplitudeJS should start with.\n * @property {string} \tconfig.starting_playlist \t\t\t\t- The starting playlist the player will intiialize to.\n * @property {string} \tconfig.starting_playlist_song \t- The index of the song in the playlist that should be started.\n * @property {boolean} \tconfig.repeat \t\t\t\t\t\t\t\t\t- When repeat is on, when the song ends the song will replay itself.\n * @property {object} \tconfig.shuffle_list\t\t\t\t\t\t\t- When shuffled, gets populated with the songs the user provided in a random order.\n * @property {boolean} \tconfig.shuffle_on\t\t\t\t\t\t\t\t- When on, gets set to true so when traversing through songs, AmplitudeJS knows whether or not to use the songs object or the shuffle_list\n * @property {string}\t\tconfig.default_album_art \t\t\t\t- The user can set default album art to be displayed if the song they set doesn't contain album art.\n * @property {string} \tconfig.default_playlist_art \t\t- The user can set default playlist art to be displayed if the playlist they are setting meta data for doesn't contain an art picture.\n * @property {boolean} \tconfig.debug\t\t\t\t\t\t\t\t\t\t- When set to true, AmplitudeJS will print to the console any errors providing helpful feedback to the user.\n * @property {number} \tconfig.volume \t\t\t\t\t\t\t\t\t- The user can set the initial volume to a number between 0 and 1 over-riding the default of .5\n * @property {number} \tconfig.pre_mute_volume \t\t\t\t\t- This is set on mute so that when a user un-mutes AmplitudeJS knows what to restore the volume to.\n * @property {number}\t\tconfig.volume_increment \t\t\t\t- The default values are an integer between 1 and 100 for how much the volume should increase when the user presses the volume up button.\n * @property {number}\t\tconfig.volume_decrement \t\t\t\t- The default values are an integer between 1 and 100 for how much the volume should decrease when the user presses the volume down button.\n * @property {string} \tconfig.soundcloud_client \t\t\t\t- When using SoundCloud, the user will have to provide their API Client ID\n * @property {boolean} \tconfig.soundcloud_use_art \t\t\t- The user can set this to true and AmplitudeJS will use the album art for the song returned from the Soundcloud API\n * @property {number} \tconfig.soundcloud_song_count \t\t- Used on config to count how many songs are from Soundcloud and compare it to how many are ready for when to move to the rest of the configuration\n * @property {number} \tconfig.soundcloud_songs_ready \t- Used on config to count how many songs are ready so when we get all of the data from the SoundCloud API that we need this should match the SoundCloud song count meaning we can move to the rest of the config.\n * @property {integer}\tconfig.is_touch_moving \t\t\t\t\t- Flag for if the user is moving the screen.\n * @property {boolean}\tconfig.buffered\t\t\t\t\t\t\t\t\t- How much of the song is buffered.\n * @property {object} \tconfig.bindings\t\t\t\t\t\t\t\t\t- Array of bindings to certain key events.\n * @property {boolean} \tconfig.continue_next \t\t\t\t\t\t- Determines when a song ends, we should continue to the next song.\n * @property {number} config.delay \t\t\t\t\t\t\t\t\t\t- Sets the delay between songs in MS.\n * @property {boolean} config.use_web_audio_api \t\t\t\t- Flag that determines if the user wants to use Web Audio API Components.\n * @property {boolean} config.web_audio_api_available - Flag that determines if the Web Audio API is available.\n * @property {object} \tconfig.context \t\t\t\t\t\t\t\t\t- Web Audio API Context\n * @property {object}\t\tconfig.source \t\t\t\t\t\t\t\t\t- Web Audio API Source\n * @property {object} \tconfig.analyser \t\t\t\t\t\t\t\t- Web Audio API Analyser\n * @property {string}\t\tconfig.player_state \t\t\t\t\t\t- The current state of the player.\n */\nimport { version } from \"../package.json\";\n\nmodule.exports = {\n version: version,\n\n audio: new Audio(),\n\n active_metadata: {},\n\n active_album: \"\",\n\n active_index: 0,\n\n active_playlist: null,\n\n playback_speed: 1.0,\n\n callbacks: {},\n\n songs: [],\n\n playlists: {},\n\n start_song: \"\",\n\n starting_playlist: \"\",\n\n starting_playlist_song: \"\",\n\n repeat: false,\n\n repeat_song: false,\n\n shuffle_list: {},\n\n shuffle_on: false,\n\n default_album_art: \"\",\n\n default_playlist_art: \"\",\n\n debug: false,\n\n volume: 0.5,\n\n pre_mute_volume: 0.5,\n\n volume_increment: 5,\n\n volume_decrement: 5,\n\n soundcloud_client: \"\",\n\n soundcloud_use_art: false,\n\n soundcloud_song_count: 0,\n\n soundcloud_songs_ready: 0,\n\n is_touch_moving: false,\n\n buffered: 0,\n\n bindings: {},\n\n continue_next: true,\n\n delay: 0,\n\n player_state: \"stopped\",\n\n web_audio_api_available: false,\n\n context: null,\n\n source: null,\n\n analyser: null,\n\n visualizations: {\n available: [],\n\n active: [],\n\n backup: \"\"\n },\n\n waveforms: {\n sample_rate: 100,\n\n built: []\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/config.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Checks module.\n * @module utilities/checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the Audio Navigation module.\n * @module utilities/audioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the Play/Pause Visual Elements module.\n * @module visual/playPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Meta Data Visual Elements module.\n * @module visual/metaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Imports AmplitudeJS Callback Utility\n * @module utilities/callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports AmplitudeJS Debug Utility\n * @module utilities/debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Import the Visualizations from the FX module.\n * @module fx/visualizations\n */\nimport Visualizations from \"../fx/visualizations.js\";\n\n/**\n * Interacts directly with native functions of the Audio element. Logic\n * leading up to these methods are handled by click handlers which call\n * helpers and visual synchronizers. These are the core functions of AmplitudeJS.\n * Every other function that leads to these prepare the information to be\n * acted upon by these functions.\n *\n * @module core/Core\n */\nlet Core = (function() {\n /**\n * Plays the active song. If the current song is live, it reconnects\n * the stream before playing.\n *\n * Public Accessor: Amplitude.play()\n *\n * @access public\n */\n function play() {\n Visualizations.stop();\n Visualizations.run();\n\n /*\n\t\t\tIf the audio is live we re-conenct the stream.\n\t\t*/\n if (config.active_metadata.live) {\n reconnectStream();\n }\n\n /*\n\t\t\tMobile remote sources need to be reconnected on play. I think this is\n\t\t\tbecause mobile browsers are optimized not to load all resources\n\t\t\tfor speed reasons. We only do this if mobile and the paused button\n\t\t\tis not clicked. If the pause button was clicked then we don't reconnect\n\t\t\tor the user will lose their place in the stream.\n\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n ) &&\n !config.paused\n ) {\n reconnectStream();\n }\n\n /*\n\t\t\tPlay the song and set the playback rate to the playback\n\t\t\tspeed.\n */\n let playPromise = config.audio.play();\n\n if( playPromise !== undefined ){\n playPromise.then( _ => {\n\n })\n .catch( error => {\n\n });\n }\n config.audio.play();\n config.audio.playbackRate = config.playback_speed;\n }\n\n /**\n * Pauses the active song. If it's live, it disconnects the stream.\n *\n * Public Accessor: Amplitude.pause()\n *\n * @access public\n */\n function pause() {\n Visualizations.stop();\n\n /*\n\t\t\tPause the active song.\n\t\t*/\n config.audio.pause();\n\n /*\n\t\t\tFlag that pause button was clicked.\n\t\t*/\n config.paused = true;\n\n /*\n\t\t\tIf the song is live, we disconnect the stream so we aren't\n\t\t\tsaving it to memory.\n\t\t*/\n if (config.active_metadata.live) {\n disconnectStream();\n }\n }\n\n /**\n * Stops the active song by setting the current song time to 0.\n * When the user resumes, it will be from the beginning.\n * If it's a live stream it disconnects.\n *\n * Public Accessor: Amplitude.stop()\n *\n * @access public\n */\n function stop() {\n Visualizations.stop();\n\n /*\n\t\t\tSet the current time of the song to 0 which will reset the song.\n\t\t*/\n if (config.audio.currentTime != 0) {\n config.audio.currentTime = 0;\n }\n\n /*\n\t\t\tRun pause so the song will stop\n\t\t*/\n config.audio.pause();\n\n /*\n\t\t\tIf the song is live, disconnect the stream.\n\t\t*/\n if (config.active_metadata.live) {\n disconnectStream();\n }\n\n /*\n\t\t\tRun the stop callback\n\t\t*/\n Callbacks.run(\"stop\");\n }\n\n /**\n * Sets the song volume.\n *\n * Public Accessor: Amplitude.setVolume( volumeLevel )\n *\n * @access public\n * @param {number} volumeLevel - A number between 1 and 100 as a percentage of\n * min to max for a volume level.\n */\n function setVolume(volumeLevel) {\n /*\n\t\t\tIf the volume is set to mute somewhere else, we sync the display.\n\t\t*/\n if (volumeLevel == 0) {\n config.audio.muted = true;\n } else {\n config.audio.muted = false;\n }\n\n /*\n\t\t\tSets the volume in the config so we can reference it later on.\n\t\t*/\n config.volume = volumeLevel;\n\n /*\n\t\t\tSet the volume of the active song.\n\t\t*/\n config.audio.volume = volumeLevel / 100;\n }\n\n /**\n * Sets the song percentage. If it's a live song, we ignore this because\n * we can't skip ahead. This is an issue if you have a playlist with\n * a live source.\n *\n * Public Accessor: Amplitude.setSongLocation( songPercentage )\n *\n * @access public\n * @param {number} songPercentage - A number between 1 and 100 as a percentage of song completion.\n */\n function setSongLocation(songPercentage) {\n /*\n\t\t\tAs long as the song is not live, we can set the current time of the\n\t\t\tsong to the percentage the user passed in.\n\t\t*/\n if (!config.active_metadata.live) {\n config.audio.currentTime = config.audio.duration * (songPercentage / 100);\n }\n }\n\n /**\n * Skips to a location in a song\n *\n * Public Accessor: Amplitude.skipToLocation( seconds )\n *\n * @access public\n * @param {number} seconds - An integer containing the seconds to skip to\n */\n function skipToLocation(seconds) {\n /*\n\t\t\tWhen the active song can be played through, we can check to\n\t\t\tsee if the seconds will work. We only bind the event handler\n\t\t\tonce and remove it once it's fired.\n\t\t*/\n config.audio.addEventListener(\n \"canplaythrough\",\n function() {\n /*\n\t\t\t\tIf the active song duration is greater than or equal to the\n\t\t\t\tamount of seconds the user wants to skip to and the seconds\n\t\t\t\tis greater than 0, we skip to the seconds defined.\n\t\t\t*/\n if (config.audio.duration >= seconds && seconds > 0) {\n config.audio.currentTime = seconds;\n } else {\n Debug.writeMessage(\n \"Amplitude can't skip to a location greater than the duration of the audio or less than 0\"\n );\n }\n },\n { once: true }\n );\n }\n\n /**\n * Disconnects the live stream\n *\n * Public Accessor: Amplitude.disconnectStream()\n *\n * @access public\n */\n function disconnectStream() {\n config.audio.src = \"\";\n config.audio.load();\n }\n\n /**\n * Reconnects the live stream\n *\n * Public Accessor: Amplitude.reconnectStream()\n *\n * @access public\\\n */\n function reconnectStream() {\n config.audio.src = config.active_metadata.url;\n config.audio.load();\n }\n\n /**\n * Sets the playback speed for the song.\n *\n * @param {number} playbackSpeed The speed we want the song to play back at.\n */\n function setPlaybackSpeed(playbackSpeed) {\n /*\n\t\t\tSet the config playback speed.\n\t\t*/\n config.playback_speed = playbackSpeed;\n\n /*\n\t\t\tSet the active song playback rate.\n\t\t*/\n config.audio.playbackRate = config.playback_speed;\n }\n\n /*\n\t\tReturn publically facing functions\n\t*/\n return {\n play: play,\n pause: pause,\n stop: stop,\n setVolume: setVolume,\n setSongLocation: setSongLocation,\n skipToLocation: skipToLocation,\n disconnectStream: disconnectStream,\n reconnectStream: reconnectStream,\n setPlaybackSpeed: setPlaybackSpeed\n };\n})();\n\nexport default Core;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/core.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the visual representation of AmplitudeJS play pause elements.\n * @module visual/PlayPauseElements\n */\nlet PlayPauseElements = (function() {\n /**\n * Syncs all play pause elements.\n *\n * @access public\n */\n function sync() {\n syncGlobal();\n syncPlaylist();\n syncSong();\n syncSongInPlaylist();\n }\n\n /**\n * Syncs the global play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncGlobal() {\n /*\n Get the active song state.\n */\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all play pause buttons.\n */\n const playPauseElements = document.querySelectorAll(\n \".amplitude-play-pause\"\n );\n\n /*\n Iterate over all of the play pause elements syncing the\n display visually.\n */\n for (let i = 0; i < playPauseElements.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlist = playPauseElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = playPauseElements[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n This method is responsible for only the global elements,\n so we make sure there are no playlist or songs defined on\n the element.\n */\n if (playlist == null && song == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(playPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(playPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the main playlist play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncPlaylist() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all of the main playlist play pause elements\n */\n const playlistPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n Iterate over the play pause elements, syncing the state accordingly.\n */\n for (let i = 0; i < playlistPlayPauseElements.length; i++) {\n /*\n Grab the song attributes from the element.\n */\n let song = playlistPlayPauseElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n We want only the play pause elements for the main on a\n playlist nothing else. We have another method for the\n song in playlist play pause method.\n */\n if (song == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(playlistPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(playlistPlayPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the song play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncSong() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all of the individual song play pause buttons. These have an\n amplitude-song-index that matches the active index attribute.\n */\n let songPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n Iterate over all of the song play pause elements\n */\n for (let i = 0; i < songPlayPauseElements.length; i++) {\n /*\n Grab the playlist attributes from the element.\n */\n let playlist = songPlayPauseElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n We want only the song play pause buttons, not ones scoped in a playlist.\n */\n if (playlist == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(songPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(songPlayPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist play pause buttons to the state of\n * the active song.\n *\n * @access public\n */\n function syncSongInPlaylist() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n Get all of the individual song play pause buttons. These have an\n amplitude-song-index attribute. Some have amplitude-playlist which\n means they are individual songs within a playlist.\n */\n let songInPlaylistPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n Iterate over all of the individual play pause elements for songs inspect\n a playlist.\n */\n for (let i = 0; i < songInPlaylistPlayPauseElements.length; i++) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(songInPlaylistPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(songInPlaylistPlayPauseElements[i]);\n break;\n }\n }\n }\n\n /**\n * Sets all of the play pause buttons to paused.\n *\n * @access public\n */\n function syncToPause() {\n /*\n Gets all of the play pause elements\n */\n let playPauseElements = document.querySelectorAll(\".amplitude-play-pause\");\n\n /*\n Sets all of the elements to pause\n */\n for (let i = 0; i < playPauseElements.length; i++) {\n setElementPause(playPauseElements[i]);\n }\n }\n\n /**\n * Sets an element to be playing by removing the 'amplitude-paused' class\n * and adding the 'amplitude-playing' class\n *\n * @access public\n * @param {element} element \t- The element getting the playing class added.\n */\n function setElementPlay(element) {\n element.classList.add(\"amplitude-playing\");\n element.classList.remove(\"amplitude-paused\");\n }\n\n /**\n * Sets an element to be paused by adding the 'amplitude-paused' class\n * and removing the 'amplitude-playing' class\n *\n * @access public\n * @param {element} element \t- The element getting the paused class added.\n */\n function setElementPause(element) {\n element.classList.remove(\"amplitude-playing\");\n element.classList.add(\"amplitude-paused\");\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n syncGlobal: syncGlobal,\n syncPlaylist: syncPlaylist,\n syncSong: syncSong,\n syncSongInPlaylist: syncSongInPlaylist,\n syncToPause: syncToPause\n };\n})();\n\nexport default PlayPauseElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/playPauseElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Core Module\n *\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Callbacks Module\n *\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports the Checks Module\n *\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the Play Pause Elements Module\n *\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Song Slider Elements Module\n *\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Imports the Song Played Progress Elements Module\n *\n * @module visual/SongPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"../visual/songPlayedProgressElements.js\";\n\n/**\n * Imports the Time Elements Module\n *\n * @module visual/TimeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Meta Data Elements Module\n *\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Container Elements Module\n *\n * @module visual/ContainerElements\n */\nimport ContainerElements from \"../visual/containerElements.js\";\n\n/**\n * AmplitudeJS Audio Navigation Utility.\n *\n * @module utilities/AudioNavigation\n */\nlet AudioNavigation = (function() {\n /**\n * Sets the next song\n *\n * @access public\n * @param {boolean} [songEnded=false] If the song ended, this is set to true\n * so we take into effect the repeat setting.\n */\n function setNext(songEnded = false) {\n /*\n Initializes the next index variable. This will be the\n index of the song that is next.\n */\n let nextIndex = null;\n let nextSong = {};\n\n /*\n Ensure we don't loop in the playlist if config.repeat is not true\n */\n let endOfList = false;\n\n /*\n Determines if we are repeating the song or not. If we are repeating,\n the next song will be the same song index.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.shuffle_on) {\n nextIndex = config.shuffle_list[ config.active_index ].index;\n nextSong = config.shuffle_list[nextIndex];\n } else {\n nextIndex = config.active_index;\n nextSong = config.songs[nextIndex];\n }\n } else {\n /*\n If the shuffle is on, we use the shuffled list of\n songs to determine our next song.\n */\n if (config.shuffle_on) {\n /*\n If the active shuffle index + 1 is less than the length, then\n we use the next shuffle otherwise we go to the beginning\n of the shuffle list.\n */\n if (parseInt(config.active_index) + 1 < config.shuffle_list.length) {\n /*\n Set the next index to be the index of the song in the shuffle list.\n */\n nextIndex = parseInt( config.active_index ) + 1;\n } else {\n nextIndex = 0\n endOfList = true;\n }\n\n nextSong = config.shuffle_list[ nextIndex ];\n } else {\n /*\n If the active index + 1 is less than the length of the songs, then\n we use the next song otherwise we go to the beginning of the\n song list.\n */\n if (parseInt(config.active_index) + 1 < config.songs.length) {\n nextIndex = parseInt(config.active_index) + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n /*\n Sets the next index.\n */\n nextSong = config.songs[nextIndex];\n }\n }\n\n /*\n Change the song after the next button has been pressed.\n */\n changeSong(nextSong, nextIndex);\n\n /*\n \t\tIf it's the end of the list and repeat is not on, do nothing.\n \t*/\n if (endOfList && !config.repeat) {\n } else {\n /*\n \t\t\tIf the song has ended and repeat is on, play the song.\n \t\t*/\n if (!(songEnded && !config.repeat && endOfList)) {\n Core.play();\n }\n }\n\n /*\n Sync the play pause elements and run the\n after next callback.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"next\");\n\n /*\n If we repeated the song, run the repeat song callback.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the next song in a playlist\n *\n * @param {string} playlist - The playlist being shuffled\n * @param {boolean} [songEnded=false] - If the song ended, this is set to true\n * so we take into effect the repeat setting.\n */\n function setNextPlaylist(playlist, songEnded = false) {\n /*\n Initializes the next index\n */\n let nextIndex = null;\n let nextSong = {};\n\n /*\n Ensure we don't loop in the playlist if config.repeat is not true\n */\n let endOfList = false;\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.playlists[playlist].shuffle) {\n nextIndex = config.playlists[playlist].active_index;\n nextSong = config.playlists[playlist].shuffle_list[nextIndex];\n } else {\n nextIndex = config.playlists[playlist].active_index;\n nextSong = config.playlists[playlist].songs[nextIndex];\n }\n } else {\n /*\n If the playlist is shuffled we get the next index of the playlist.\n */\n if (config.playlists[playlist].shuffle) {\n /*\n If the active shuffle index + 1 is less than the length of the shuffle list,\n then we use the next shuffle otherwise we go to the beginning of the shuffle list.\n */\n if (\n parseInt(config.playlists[playlist].active_index) + 1 <\n config.playlists[playlist].shuffle_list.length\n ) {\n /*\n Set the next index to be the index of the song in the shuffle list.\n */\n nextIndex = config.playlists[playlist].active_index + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n nextSong = config.playlists[playlist].shuffle_list[nextIndex];\n } else {\n /*\n If the active index +1 is less than the length of the songs in the playlist,\n then we use the next song otherwise we go to the beginning of the playlist.\n */\n if (\n parseInt(config.playlists[playlist].active_index) + 1 <\n config.playlists[playlist].songs.length\n ) {\n nextIndex = parseInt(config.playlists[playlist].active_index) + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n /*\n Sets the next song.\n */\n nextSong = config.playlists[playlist].songs[nextIndex];\n }\n }\n\n /*\n Sets the active playlist to the playlist we are on.\n */\n setActivePlaylist(playlist);\n\n /*\n Change the song within the playlist.\n */\n changeSongPlaylist(playlist, nextSong, nextIndex);\n\n /*\n If it's the end of the playlist and we aren't repeating, do nothing.\n */\n if (endOfList && !config.repeat) {\n } else {\n if (!(songEnded && !config.repeat && endOfList)) {\n Core.play();\n }\n }\n\n /*\n Sync the play pause buttons.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"next\");\n\n /*\n Repeat the song.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the previous song on the global songs array.\n *\n * @access private\n */\n function setPrevious() {\n /*\n Initializes the previous index\n */\n let previousIndex = null;\n let previousSong = {};\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the config is shuffled, get the now playing index.\n */\n if (config.shuffle_on) {\n previousIndex = config.active_index;\n previousSong = config.shuffle_list[previousIndex];\n } else {\n previousIndex = config.active_index;\n previousSong = config.songs[previousIndex];\n }\n } else {\n /*\n Get the previous index. If the previous index will be less than 0, get the\n last song of the array and continue.\n */\n if (parseInt(config.active_index) - 1 >= 0) {\n previousIndex = parseInt(config.active_index - 1);\n } else {\n previousIndex = parseInt(config.songs.length - 1);\n }\n\n /*\n If the config is shuffled, we grab the song from the shuffle list\n */\n if (config.shuffle_on) {\n /*\n Grab song from the shuffle list\n */\n previousSong = config.shuffle_list[previousIndex];\n } else {\n /*\n Grab song from the songs array\n */\n previousSong = config.songs[previousIndex];\n }\n }\n /*\n Change the song after the next button has been pressed.\n */\n changeSong(previousSong, previousIndex);\n\n /*\n Play the newest song.\n */\n Core.play();\n\n /*\n Sync the play pause elements and run the\n after next callback.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"prev\");\n\n /*\n If we repeated the song, run the repeat song callback.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the previous playlist song.\n *\n * @access private\n *\n * @prop {string} playlist - The playlist we are navigating in.\n */\n function setPreviousPlaylist(playlist) {\n /*\n Initializes the previous index\n */\n let previousIndex = null;\n let previousSong = {};\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.playlists[playlist].shuffle) {\n previousIndex = config.playlists[playlist].active_index;\n previousSong = config.playlists[playlist].shuffle_list[previousIndex];\n } else {\n previousIndex = config.playlists[playlist].active_index;\n previousSong = config.playlists[playlist].songs[previousIndex];\n }\n } else {\n /*\n Get the previous index. If the previous index will be less than 0, get the\n last song of the array and continue.\n */\n if (parseInt(config.playlists[playlist].active_index) - 1 >= 0) {\n previousIndex = parseInt(config.playlists[playlist].active_index - 1);\n } else {\n previousIndex = parseInt(config.playlists[playlist].songs.length - 1);\n }\n\n /*\n If the playlist is shuffled, we grab the song from the shuffle list\n */\n if (config.playlists[playlist].shuffle) {\n /*\n Grab song from the shuffle list\n */\n previousSong = config.playlists[playlist].shuffle_list[previousIndex];\n } else {\n /*\n Grab song from the songs array\n */\n previousSong = config.playlists[playlist].songs[previousIndex];\n }\n }\n\n /*\n Sets the active playlist to the playlist we are on.\n */\n setActivePlaylist(playlist);\n\n /*\n Change the song within the playlist.\n */\n changeSongPlaylist(playlist, previousSong, previousIndex);\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Sync the play pause buttons.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"prev\");\n\n /*\n Repeat the song.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Change song in the songs array.\n *\n * @access private\n * @prop {object} song - The song we are changing to.\n * @prop {number} index - The index we are changing to.\n */\n function changeSong(song, index) {\n /*\n Prepare the song change.\n */\n prepareSongChange(song);\n\n /*\n Change the song.\n */\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n \n config.active_index = parseInt(index);\n\n /*\n Set new information now that the song has changed.\n */\n afterSongChange();\n }\n\n /**\n * Handles a song change in the playlist\n *\n * @access private\n * @prop {string} playlist - The playlist we are changing the song on.\n * @prop {object} song - The song we are changing to in the playlist.\n * @prop {number} index - The inded of the song we are changing to in the playlist.\n */\n function changeSongPlaylist(playlist, song, index) {\n /*\n Prepare the song change.\n */\n prepareSongChange(song);\n\n /*\n Change the song.\n */\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n config.active_index = null;\n\n config.playlists[playlist].active_index = parseInt(index);\n\n /*\n Set new information now that the song has changed.\n */\n afterSongChange();\n }\n\n /**\n * Prepares a song change\n *\n * @access private\n * @prop {object} song - The song we change to.\n */\n function prepareSongChange(song) {\n /*\n Stop the current song.\n */\n Core.stop();\n\n /*\n Sync all of the elements to a stopped song.\n */\n PlayPauseElements.syncToPause();\n SongSliderElements.resetElements();\n SongPlayedProgressElements.resetElements();\n TimeElements.resetCurrentTimes();\n\n /*\n If an album changes, fire an album change.\n */\n if (Checks.newAlbum(song)) {\n Callbacks.run(\"album_change\");\n }\n }\n\n /**\n * Updates data on the display after a song has changed.\n *\n * @access private\n */\n function afterSongChange() {\n MetaDataElements.displayMetaData();\n ContainerElements.setActive();\n TimeElements.resetDurationTimes();\n\n /*\n Run the song change callback.\n */\n Callbacks.run(\"song_change\");\n }\n\n /**\n * Sets the active playlist\n *\n * @access public\n * @param {string} playlist - The string of the playlist being set to active.\n */\n function setActivePlaylist(playlist) {\n /*\n If the active playlist is different than the playlist being set,\n we run the `playlist_changed` callback.\n */\n if (config.active_playlist != playlist) {\n Callbacks.run(\"playlist_changed\");\n /*\n Set the active playlist to the playlist parameter. Only need to\n set if it's different.\n */\n config.active_playlist = playlist;\n\n if (playlist != null) {\n config.playlists[playlist].active_index = 0;\n }\n }\n }\n\n /*\n Return the publically facing methods\n */\n return {\n setNext: setNext,\n setNextPlaylist: setNextPlaylist,\n setPrevious: setPrevious,\n setPreviousPlaylist: setPreviousPlaylist,\n changeSong: changeSong,\n changeSongPlaylist: changeSongPlaylist,\n setActivePlaylist: setActivePlaylist\n };\n})();\n\nexport default AudioNavigation;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/audioNavigation.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the debugging of AmplitudeJS\n * @module utilities/Debug\n */\nlet Debug = (function() {\n /**\n * Writes out debug message to the console if enabled.\n *\n * Public Accessor: Debug.writeMessage( message )\n *\n * @access public\n * @param {string} message - The string that gets printed to alert the user of a debugging error.\n */\n function writeMessage(message) {\n /*\n If the user has flagged AmplitudeJS to debug, we print out a message\n to the console.\n */\n if (config.debug) {\n console.log(message);\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n writeMessage: writeMessage\n };\n})();\n\nexport default Debug;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/debug.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Checks Module. Checks for new songs, albums, and playlists\n *\n * @module utilities/Checks\n */\nlet Checks = (function() {\n /**\n * Checks to see if the new song to be played is different than the song\n * that is currently playing. To be true, the user would have selected\n * play on a new song with a new index. To be false, the user would have\n * clicked play/pause on the song that was playing.\n *\n * Public Accessor: Checks.newSong( playlist, songIndex )\n * @access public\n * @param {string} playlist - The playlist we are checking the new song for. Could be null\n * @param {number} songIndex - The index of the new song to be played.\n * @returns {boolean} True if we are setting a new song, false if we are not setting a new song.\n */\n function newSong(playlist, songIndex) {\n /*\n If the playlists don't match, then it's definitely a new song.\n */\n if (config.active_playlist != playlist) {\n return true;\n } else {\n /*\n If we aren't in a playlist, we check the active index.\n */\n if (config.active_playlist == null && playlist == null) {\n /*\n If the active indexes don't match, then it's a new song.\n */\n if (config.active_index != songIndex) {\n return true;\n } else {\n return false;\n }\n } else {\n /*\n If we are in a playlist, then we check to see if the\n new song index matches the active index.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[playlist].active_index != songIndex\n ) {\n return true;\n } else {\n return false;\n }\n }\n }\n }\n\n /**\n * Checks to see if there is a new album\n *\n * Public Accessor: Checks.newAlbum( album )\n *\n * @access public\n * @param {string} album - Checks to see if the new song will have a new album.\n * @returns {boolean} True if there is a new album, false if there is not a new ablum.\n */\n function newAlbum(album) {\n if (config.active_album != album) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Checks to see if there is a new playlist\n *\n * Public Accessor: Checks.newPlaylist( playlist )\n *\n * @access public\n * @param {string} playlist - The playlist passed in to check against the active playlist.\n * @returns {boolean} True if there is a new playlist, false if there is not a new playlist.\n */\n function newPlaylist(playlist) {\n if (config.active_playlist != playlist) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Determines if the string passed in is a URL or not\n *\n * Public Accessor: AmplitudeHelpers.isURL( url )\n *\n * @access public\n * @param {string} url - The string we are testing to see if it's a URL.\n * @returns {boolean} True if the string is a url, false if it is not.\n */\n function isURL(url) {\n /*\n\t\t\tTest the string against the URL pattern and return if it matches\n\t\t*/\n let pattern = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;\n\n return pattern.test(url);\n }\n\n /**\n * Determines if what is passed in is an integer or not.\n *\n * Public Accessor: AmplitudeHelpers.isInt( int )\n *\n * @access public\n * @param {string|number} int - The variable we are testing to see is an integer or not.\n * @returns {boolean} If the variable is an integer or not.\n */\n function isInt(int) {\n return (\n !isNaN(int) && parseInt(Number(int)) == int && !isNaN(parseInt(int, 10))\n );\n }\n\n /**\n * Returns public facing methods\n */\n return {\n newSong: newSong,\n newAlbum: newAlbum,\n newPlaylist: newPlaylist,\n isURL: isURL,\n isInt: isInt\n };\n})();\n\nexport default Checks;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/checks.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the state of the config object.\n *\n * @module utilities/ConfigState\n */\nlet ConfigState = (function() {\n /**\n * Resets the config to the default state. This is called on initialize\n * to ensure the user's config is what matters.\n *\n * Public Accessor: AmplitudeHelpers.resetConfig()\n *\n * @access public\n */\n function resetConfig() {\n config.audio = new Audio();\n config.active_metadata = {};\n config.active_album = \"\";\n config.active_index = 0;\n config.active_playlist = null;\n config.playback_speed = 1.0;\n config.callbacks = {};\n config.songs = [];\n config.playlists = {};\n config.start_song = \"\";\n config.starting_playlist = \"\";\n config.starting_playlist_song = \"\";\n config.repeat = false;\n config.shuffle_list = {};\n config.shuffle_on = false;\n config.default_album_art = \"\";\n config.default_playlist_art = \"\";\n config.debug = false;\n config.volume = 0.5;\n config.pre_mute_volume = 0.5;\n config.volume_increment = 5;\n config.volume_decrement = 5;\n config.soundcloud_client = \"\";\n config.soundcloud_use_art = false;\n config.soundcloud_song_count = 0;\n config.soundcloud_songs_ready = 0;\n config.continue_next = true;\n }\n\n /**\n * Sets the state of the player.\n */\n function setPlayerState() {\n /*\n If paused and the current time is 0 the player is stopped.\n */\n if (config.audio.paused && config.audio.currentTime == 0) {\n config.player_state = \"stopped\";\n }\n\n /*\n If paused and the current time is greater than 0 the player is\n paused.\n */\n if (config.audio.paused && config.audio.currentTime > 0) {\n config.player_state = \"paused\";\n }\n\n /*\n If playing, the current state is playing.\n */\n if (!config.audio.paused) {\n config.player_state = \"playing\";\n }\n }\n\n /*\n\t\tReturns the public facing methods\n\t*/\n return {\n resetConfig: resetConfig,\n setPlayerState: setPlayerState\n };\n})();\n\nexport default ConfigState;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/configState.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the debug module\n * @module utilities/debug\n */\nimport Debug from \"./debug.js\";\n\n/**\n * AmplitudeJS Callback Utility\n *\n * @module utilities/callbacks\n */\nlet Callbacks = (function() {\n /**\n * Initializes the callbacks for the player.\n */\n function initialize() {\n /*\n Event: abort\n https://www.w3schools.com/tags/av_event_abort.asp\n */\n config.audio.addEventListener(\"abort\", function() {\n run(\"abort\");\n });\n\n /*\n Event: error\n https://www.w3schools.com/tags/av_event_error.asp\n */\n config.audio.addEventListener(\"error\", function() {\n run(\"error\");\n });\n\n /*\n Event: loadeddata\n https://www.w3schools.com/tags/av_event_loadeddata.asp\n */\n config.audio.addEventListener(\"loadeddata\", function() {\n run(\"loadeddata\");\n });\n\n /*\n Event: loadedmetadata\n https://www.w3schools.com/tags/av_event_loadedmetadata.asp\n */\n config.audio.addEventListener(\"loadedmetadata\", function() {\n run(\"loadedmetadata\");\n });\n\n /*\n Event: loadstart\n https://www.w3schools.com/tags/av_event_loadstart.asp\n */\n config.audio.addEventListener(\"loadstart\", function() {\n run(\"loadstart\");\n });\n\n /*\n Event: pause\n https://www.w3schools.com/tags/av_event_pause.asp\n */\n config.audio.addEventListener(\"pause\", function() {\n run(\"pause\");\n });\n\n /*\n Event: playing\n https://www.w3schools.com/tags/av_event_playing.asp\n */\n config.audio.addEventListener(\"playing\", function() {\n run(\"playing\");\n });\n\n /*\n Event: play\n https://www.w3schools.com/tags/av_event_play.asp\n */\n config.audio.addEventListener(\"play\", function() {\n run(\"play\");\n });\n\n /*\n Event: progress\n https://www.w3schools.com/tags/av_event_progress.asp\n */\n config.audio.addEventListener(\"progress\", function() {\n run(\"progress\");\n });\n\n /*\n Event: ratechange\n https://www.w3schools.com/tags/av_event_ratechange.asp\n */\n config.audio.addEventListener(\"ratechange\", function() {\n run(\"ratechange\");\n });\n\n /*\n Event: seeked\n https://www.w3schools.com/tags/av_event_seeked.asp\n */\n config.audio.addEventListener(\"seeked\", function() {\n run(\"seeked\");\n });\n\n /*\n Event: seeking\n https://www.w3schools.com/tags/av_event_seeking.asp\n */\n config.audio.addEventListener(\"seeking\", function() {\n run(\"seeking\");\n });\n\n /*\n Event: stalled\n https://www.w3schools.com/tags/av_event_stalled.asp\n */\n config.audio.addEventListener(\"stalled\", function() {\n run(\"stalled\");\n });\n\n /*\n Event: suspend\n https://www.w3schools.com/tags/av_event_suspend.asp\n */\n config.audio.addEventListener(\"suspend\", function() {\n run(\"suspend\");\n });\n\n /*\n Event: timeupdate\n https://www.w3schools.com/tags/av_event_timeupdate.asp\n */\n config.audio.addEventListener(\"timeupdate\", function() {\n run(\"timeupdate\");\n });\n\n /*\n Event: volumechange\n https://www.w3schools.com/tags/av_event_volumechange.asp\n */\n config.audio.addEventListener(\"volumechange\", function() {\n run(\"volumechange\");\n });\n\n /*\n Event: waiting\n https://www.w3schools.com/tags/av_event_waiting.asp\n */\n config.audio.addEventListener(\"waiting\", function() {\n run(\"waiting\");\n });\n\n /*\n Event: canplay\n https://www.w3schools.com/tags/av_event_canplay.asp\n */\n config.audio.addEventListener(\"canplay\", function() {\n run(\"canplay\");\n });\n\n /*\n Event: canplaythrough\n https://www.w3schools.com/tags/av_event_canplaythrough.asp\n */\n config.audio.addEventListener(\"canplaythrough\", function() {\n run(\"canplaythrough\");\n });\n\n /*\n Event: durationchange\n https://www.w3schools.com/tags/av_event_durationchange.asp\n */\n config.audio.addEventListener(\"durationchange\", function() {\n run(\"durationchange\");\n });\n\n /*\n Event: ended\n https://www.w3schools.com/tags/av_event_ended.asp\n */\n config.audio.addEventListener(\"ended\", function() {\n run(\"ended\");\n });\n }\n\n /**\n * Runs a user defined callback method\n *\n * Public Accessor: Callbacks.run( callbackName )\n *\n * @access public\n * @param {string} callbackName - The name of the callback we are going to run.\n */\n function run(callbackName) {\n /*\n Checks to see if a user defined a callback method for the\n callback we are running.\n */\n if (config.callbacks[callbackName]) {\n /*\n Build the callback function\n */\n let callbackFunction = config.callbacks[callbackName];\n\n /*\n Write a debug message stating the callback we are running\n */\n Debug.writeMessage(\"Running Callback: \" + callbackName);\n\n /*\n Run the callback function and catch any errors\n */\n try {\n callbackFunction();\n } catch (error) {\n if (error.message == \"CANCEL EVENT\") {\n throw error;\n } else {\n Debug.writeMessage(\"Callback error: \" + error.message);\n }\n }\n }\n }\n\n return {\n initialize: initialize,\n run: run\n };\n})();\n\nexport default Callbacks;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/callbacks.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * These methods help display the audio's meta data\n *\n * @module visual/MetaDataElements\n */\nlet MetaDataElements = (function() {\n /**\n * Displays the active song's metadata. This is called after a song has\n * been changed. This method takes the active song and displays the\n * metadata. So once the new active song is set, we update all of the\n * screen elements.\n *\n * @access public\n */\n function displayMetaData() {\n /*\n\t\t\tDefine the image meta data keys. These are managed separately\n\t\t\tsince we aren't actually changing the inner HTML of these elements.\n\t\t*/\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n\t\t\tGet all of the song info elements\n\t\t*/\n let songInfoElements = document.querySelectorAll(\n \"[data-amplitude-song-info]\"\n );\n\n /*\n\t\t\tIterate over all of the song info elements. We will either\n\t\t\tset these to the new values, or clear them if the active song\n\t\t\tdoesn't have the info set.\n\t\t*/\n for (let i = 0; i < songInfoElements.length; i++) {\n /*\n\t\t\t\tGet the info so we can check if the active meta data has the\n\t\t\t\tkey.\n\t\t\t*/\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n\t\t\t\tGrab the playlist and song index.\n\t\t\t*/\n let playlist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songInfoElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\tEnsure that we don't set any individual elements now. We set this with the\n\t\t\t\tsync meta data method. The reason we don't set them here is because\n\t\t\t\tall individual songs would get the now playing artwork. If the playlists\n\t\t\t\tmatch or the element is a main element meaning it doesn't\n\t\t\t\tbelong to a playlist or a song, then we set the song info.\n\t\t\t*/\n if (\n songIndex == null &&\n (config.active_playlist == playlist ||\n (playlist == null && songIndex == null))\n ) {\n /*\n\t\t\t\t\tIf the active metadata has the key, then we set it,\n\t\t\t\t\totherwise we clear it. If it's an image element then\n\t\t\t\t\twe default it to the default info if needed.\n\t\t\t\t*/\n let val = (config.active_metadata[info] != undefined) ? config.active_metadata[info] : null;\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n val = val || config.default_album_art\n songInfoElements[i].setAttribute(\n \"src\",\n val\n );\n } else {\n val = val || \"\"\n songInfoElements[i].innerHTML = val;\n }\n }\n }\n }\n\n /**\n * Displays the playlist meta data.\n */\n function displayPlaylistMetaData() {\n /*\n\t\t\tDefine the image meta data keys. These are managed separately\n\t\t\tsince we aren't actually changing the inner HTML of these elements.\n\t\t*/\n let imageMetaDataKeys = [\"image_url\"];\n\n /*\n\t\t\tGet all of the playlist info elements\n\t\t*/\n let playlistInfoElements = document.querySelectorAll(\n \"[data-amplitude-playlist-info]\"\n );\n\n /*\n\t\t\tIterate over all of the playlist info elements. We will either\n\t\t\tset these to the new values, or clear them if the active song\n\t\t\tdoesn't have the info set.\n\t\t*/\n for (let i = 0; i < playlistInfoElements.length; i++) {\n /*\n\t\t\t\tGet the info so we can check if the active meta data has the\n\t\t\t\tkey.\n\t\t\t*/\n let info = playlistInfoElements[i].getAttribute(\n \"data-amplitude-playlist-info\"\n );\n let playlist = playlistInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (config.playlists[playlist][info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n playlistInfoElements[i].setAttribute(\n \"src\",\n config.playlists[playlist][info]\n );\n } else {\n playlistInfoElements[i].innerHTML = config.playlists[playlist][info];\n }\n } else {\n /*\n\t\t\t\t\tWe look for the default album art because\n\t\t\t\t\tthe actual key didn't exist. If the default album\n\t\t\t\t\tart doesn't exist then we set the src attribute\n\t\t\t\t\tto null.\n\t\t\t\t*/\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n if (config.default_playlist_art != \"\") {\n playlistInfoElements[i].setAttribute(\n \"src\",\n config.default_playlist_art\n );\n } else {\n playlistInfoElements[i].setAttribute(\"src\", \"\");\n }\n } else {\n playlistInfoElements[i].innerHTML = \"\";\n }\n }\n }\n }\n\n /**\n * Sets the first song in the playlist. This is used to fill in the meta\n * data in the playlist\n *\n * @param {object} song \t\t\t- The song we are setting to be the first song in the playlist\n * @param {string} playlist \t- Key of the playlist we are setting the first song in\n */\n function setFirstSongInPlaylist(song, playlist) {\n /*\n Define the image meta data keys. These are managed separately\n since we aren't actually changing the inner HTML of these elements.\n */\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n Get all of the song info elements\n */\n let songInfoElements = document.querySelectorAll(\n '[data-amplitude-song-info][data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n Iterate over all of the song info elements. We will either\n set these to the new values, or clear them if the active song\n doesn't have the info set.\n */\n for (let i = 0; i < songInfoElements.length; i++) {\n /*\n Get the info so we can check if the active meta data has the\n key.\n */\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Get the song info element playlist.\n */\n let elementPlaylist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n If the playlists match or the element is a main element, then\n we set the song info.\n */\n if (elementPlaylist == playlist) {\n /*\n If the active metadata has the key, then we set it,\n otherwise we clear it. If it's an image element then\n we default it to the default info if needed.\n */\n if (song[info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n songInfoElements[i].setAttribute(\"src\", song[info]);\n } else {\n songInfoElements[i].innerHTML = song[info];\n }\n } else {\n /*\n We look for the default album art because\n the actual key didn't exist. If the default album\n art doesn't exist then we set the src attribute\n to null.\n */\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n if (song.default_album_art != \"\") {\n songInfoElements[i].setAttribute(\"src\", song.default_album_art);\n } else {\n songInfoElements[i].setAttribute(\"src\", \"\");\n }\n } else {\n songInfoElements[i].innerHTML = \"\";\n }\n }\n }\n }\n }\n\n /**\n * Sets the meta data for songs loaded in the songs array\n */\n function syncMetaData() {\n /*\n\t\t Define the image meta data keys. These are managed separately\n\t\t since we aren't actually changing the inner HTML of these elements.\n\t */\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n\t\t Get all of the song info elements\n\t */\n let songInfoElements = document.querySelectorAll(\n \"[data-amplitude-song-info]\"\n );\n\n /*\n\t\t Iterate over all of the song info elements. We will either\n\t\t set these to the new values, or clear them if the active song\n\t\t doesn't have the info set.\n\t */\n for (let i = 0; i < songInfoElements.length; i++) {\n let songIndex = songInfoElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n let playlist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (songIndex != null && playlist == null) {\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Get the song info value referenced on the element. Depending on the type of\n element, we may need to fallback to another value when the direct value\n we want isn't found.\n i.e.\n data-amplitude-song-info=\"cover_art_url\" defaults to using the value\n of \"default_album_art\" when \"cover_art_url\" is missing on the song.\n */\n let val = config.songs[songIndex][info] != undefined ? config.songs[songIndex][info] : null;\n /*\n If it's an image meta data key, then we set the src attribute of\n the element. Otherwise we set the inner HTML of the element.\n */\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n /*\n If this is an image meta data key and the individual song doesn't\n have the key, use the default_album_art\n */\n val = val || config.default_album_art\n songInfoElements[i].setAttribute(\n \"src\",\n val\n );\n } else {\n songInfoElements[i].innerHTML = val;\n }\n }\n\n /*\n If the song index and playlist are not null, continue.\n */\n if (songIndex != null && playlist != null) {\n /*\n Get the info we are displaying.\n */\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Set the meta data accordingly.\n */\n if (config.playlists[playlist].songs[songIndex][info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n songInfoElements[i].setAttribute(\n \"src\",\n config.playlists[playlist].songs[songIndex][info]\n );\n } else {\n songInfoElements[i].innerHTML =\n config.playlists[playlist].songs[songIndex][info];\n }\n }\n }\n }\n\n /*\n Display the playlist meta data.\n */\n displayPlaylistMetaData();\n }\n\n /**\n * Returns publically facing methods\n */\n return {\n displayMetaData: displayMetaData,\n setFirstSongInPlaylist: setFirstSongInPlaylist,\n syncMetaData: syncMetaData,\n displayPlaylistMetaData: displayPlaylistMetaData\n };\n})();\n\nexport default MetaDataElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/metaDataElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the visual syncing to the state of the config for the repeat\n * elements.\n *\n * @module visual/RepeatElements\n */\nlet RepeatElements = (function() {\n /**\n * Syncs repeat for all of the repeat buttons. Users\n * can apply styles to the 'amplitude-repeat-on' and\n * 'amplitude-repeat-off' classes. They represent the state\n * of the player.\n */\n function syncRepeat() {\n /*\n\t\t\tGets all of the repeat classes\n\t\t*/\n let repeatClasses = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\tIterate over all of the repeat classes. If repeat is on,\n\t\t\tthen add the 'amplitude-repeat-on' class and remove the\n\t\t\t'amplitude-repeat-off' class. If it's off, then do the\n\t\t\topposite.\n\t\t*/\n for (let i = 0; i < repeatClasses.length; i++) {\n if (config.repeat) {\n repeatClasses[i].classList.add(\"amplitude-repeat-on\");\n repeatClasses[i].classList.remove(\"amplitude-repeat-off\");\n } else {\n repeatClasses[i].classList.remove(\"amplitude-repeat-on\");\n repeatClasses[i].classList.add(\"amplitude-repeat-off\");\n }\n }\n }\n\n /**\n * Syncs repeat for all of the playlist repeat buttons. Users\n * can apply styles to the `amplitude-repeat-on` and `amplitude-repeat-off`\n * classes. They repreent the state of the playlist in the player.\n */\n function syncRepeatPlaylist(playlist) {\n /*\n\t\t\t Gets all of the repeat buttons.\n\t\t */\n let repeatButtons = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\t Iterate over all of the repeat buttons\n\t\t */\n for (let i = 0; i < repeatButtons.length; i++) {\n /*\n\t\t\t\t Ensure that the repeat button belongs to matches the\n\t\t\t\t playlist we are syncing the state for.\n\t\t\t */\n if (\n repeatButtons[i].getAttribute(\"data-amplitude-playlist\") == playlist\n ) {\n /*\n\t\t\t\t\t If the state of the playlist is shuffled on, true, then\n\t\t\t\t\t we add the 'amplitude-repeat-on' class and remove the\n\t\t\t\t\t 'amplitude-repeat-off' class. If the player is not shuffled\n\t\t\t\t\t then we do the opposite.\n\t\t\t\t */\n if (config.playlists[playlist].repeat) {\n repeatButtons[i].classList.add(\"amplitude-repeat-on\");\n repeatButtons[i].classList.remove(\"amplitude-repeat-off\");\n } else {\n repeatButtons[i].classList.add(\"amplitude-repeat-off\");\n repeatButtons[i].classList.remove(\"amplitude-repeat-on\");\n }\n }\n }\n }\n\n /**\n * Syncs repeat for all of the repeat song buttons. Users\n * can apply styles to the 'amplitude-repeat-song-on' and\n * 'amplitude-repeat-song-off' classes. They represent the state\n * of the player.\n */\n function syncRepeatSong() {\n /*\n\t\t\tGets all of the repeat song classes\n\t\t*/\n let repeatSongClasses = document.getElementsByClassName(\n \"amplitude-repeat-song\"\n );\n\n /*\n\t\t\tIterate over all of the repeat song classes. If repeat is on,\n\t\t\tthen add the 'amplitude-repeat-song-on' class and remove the\n\t\t\t'amplitude-repeat-song-off' class. If it's off, then do the\n\t\t\topposite.\n\t\t*/\n for (let i = 0; i < repeatSongClasses.length; i++) {\n if (config.repeat_song) {\n repeatSongClasses[i].classList.add(\"amplitude-repeat-song-on\");\n repeatSongClasses[i].classList.remove(\"amplitude-repeat-song-off\");\n } else {\n repeatSongClasses[i].classList.remove(\"amplitude-repeat-song-on\");\n repeatSongClasses[i].classList.add(\"amplitude-repeat-song-off\");\n }\n }\n }\n\n /*\n Returns the publically available methods.\n */\n return {\n syncRepeat: syncRepeat,\n syncRepeatPlaylist: syncRepeatPlaylist,\n syncRepeatSong: syncRepeatSong\n };\n})();\n\nexport default RepeatElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/repeatElements.js","/**\n * Handles the visual state for all of the mute elements.\n *\n * @module visual/MuteElements\n */\nlet MuteElements = (function() {\n /**\n * Syncs mute for all of the mute buttons. This represents the\n * state of the player if it's muted or not.\n *\n * @access public\n * @param {string} state \t- The muted state of the player.\n */\n function setMuted(state) {\n /*\n\t\t\tGet all of the mute buttons.\n\t\t*/\n let muteClasses = document.getElementsByClassName(\"amplitude-mute\");\n\n /*\n\t\t\tIterate over all of the mute classes. If the state of the player\n\t\t\tis not-muted then we add the amplitude-not-muted classe and remove\n\t\t\tthe amplitude muted class otherwise we do the opposite.\n\t\t*/\n for (let i = 0; i < muteClasses.length; i++) {\n if (!state) {\n muteClasses[i].classList.add(\"amplitude-not-muted\");\n muteClasses[i].classList.remove(\"amplitude-muted\");\n } else {\n muteClasses[i].classList.remove(\"amplitude-not-muted\");\n muteClasses[i].classList.add(\"amplitude-muted\");\n }\n }\n }\n\n return {\n setMuted: setMuted\n };\n})();\n\nexport default MuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/muteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Keeps the volume slider elements in sync.\n * @module visual/VolumeSliderElements\n */\nlet VolumeSliderElements = (function() {\n /**\n * Visually syncs the volume sliders so they are all the same if there\n * are more than one.\n *\n * @access public\n */\n function sync() {\n let volumeSliders = document.getElementsByClassName(\n \"amplitude-volume-slider\"\n );\n\n /*\n\t\t\tIterates over all of the volume sliders for the song, setting the value\n\t\t\tto the config value.\n\t\t*/\n for (let i = 0; i < volumeSliders.length; i++) {\n volumeSliders[i].value = config.audio.volume * 100;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync\n };\n})();\n\nexport default VolumeSliderElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/volumeSliderElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Repeater utility. Handles setting the repeat for all scenarios.\n *\n * @module utilities/Repeater\n */\nlet Repeater = (function() {\n /**\n * Sets the state of the repeat for a song.\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat should be on or off\n */\n function setRepeat(repeat) {\n /*\n Set the global repeat to be toggled\n */\n config.repeat = repeat;\n }\n\n /**\n * Sets the state of the repeat for a playlist.\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat should be on or off\n * @param {string} playlist - The key of the playlist for repeating\n */\n function setRepeatPlaylist(repeat, playlist) {\n /*\n Set the playlist repeat to be toggled.\n */\n config.playlists[playlist].repeat = repeat;\n }\n\n /**\n * Sets the state of the repeat song\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat shoudl be on or off for the song.\n */\n function setRepeatSong(repeat) {\n config.repeat_song = repeat;\n }\n\n /*\n Returns the public facing methods\n */\n return {\n setRepeat: setRepeat,\n setRepeatPlaylist: setRepeatPlaylist,\n setRepeatSong: setRepeatSong\n };\n})();\n\nexport default Repeater;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/repeater.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Shuffle Module. Handles all of the shuffling functionality for\n * AmplitudeJS\n *\n * @module utilities/Shuffler\n */\nlet Shuffler = (function() {\n /**\n * Sets the shuffle state globally\n *\n * @access public\n * @param {boolean} shuffle - True when we are shuffling, false when we turn it off.\n */\n function setShuffle(shuffle) {\n config.shuffle_on = shuffle;\n\n if (shuffle) {\n shuffleSongs();\n } else {\n config.shuffle_list = [];\n }\n }\n\n /**\n * Toggles the shuffle status globally.\n *\n * @access public\n */\n function toggleShuffle() {\n /*\n If shuffle is on, we toggle it off. If shuffle is off, we\n toggle on.\n */\n if (config.shuffle_on) {\n config.shuffle_on = false;\n config.shuffle_list = [];\n } else {\n config.shuffle_on = true;\n shuffleSongs();\n }\n }\n\n /**\n * Sets the shuffle state for a playlist\n *\n * @access public\n * @param {string} playlist The key of the playlist we are shuffling.\n * @param {boolean} shuffle True when we are shuffling the playlist, false when we turn off shuffle.\n */\n function setShufflePlaylist(playlist, shuffle) {\n config.playlists[playlist].shuffle = shuffle;\n\n if (config.playlists[playlist].shuffle) {\n shufflePlaylistSongs(playlist);\n } else {\n config.playlists[playlist].shuffle_list = [];\n }\n }\n\n /**\n * Sets the shuffle state for a playlist\n *\n * @access public\n * @param {string} playlist The key of the playlist we are shuffling.\n */\n function toggleShufflePlaylist(playlist) {\n /*\n If the playlist shuffled is on, we toggle it off. If the\n playlist shuffled is off, we toggle it on.\n */\n if (config.playlists[playlist].shuffle) {\n config.playlists[playlist].shuffle = false;\n config.playlists[playlist].shuffle_list = [];\n } else {\n config.playlists[playlist].shuffle = true;\n shufflePlaylistSongs(playlist);\n }\n }\n\n /**\n * Shuffles individual songs in the config\n * Based off of: http://www.codinghorror.com/blog/2007/12/the-danger-of-naivete.html\n *\n * Public Accessor: Shuffle.shuffleSongs()\n *\n * @access public\n */\n function shuffleSongs() {\n /*\n\t\t\tBuilds a temporary array with the length of the config.\n\t\t*/\n let shuffleTemp = new Array(config.songs.length);\n\n /*\n\t\t\tSet the temporary array equal to the songs array.\n\t\t*/\n for (let i = 0; i < config.songs.length; i++) {\n shuffleTemp[i] = config.songs[i];\n }\n\n /*\n\t\t\tIterate ove rthe songs and generate random numbers to\n\t\t\tswap the indexes of the shuffle array.\n\t\t*/\n for (let i = config.songs.length - 1; i > 0; i--) {\n let randNum = Math.floor(Math.random() * config.songs.length + 1);\n shuffleSwap(shuffleTemp, i, randNum - 1);\n }\n\n /*\n\t\t\tSet the shuffle list to the shuffle temp.\n\t\t*/\n config.shuffle_list = shuffleTemp;\n }\n\n /**\n * Shuffle songs in a playlist\n *\n * Public Accessor: Shuffle.shufflePlaylistSongs( playlist )\n *\n * @access public\n * @param {string} playlist - The playlist we are shuffling.\n */\n function shufflePlaylistSongs(playlist) {\n /*\n Builds a temporary array with the length of the playlist songs.\n */\n let shuffleTemp = new Array(config.playlists[playlist].songs.length);\n\n /*\n Set the temporary array equal to the playlist array.\n */\n for (let i = 0; i < config.playlists[playlist].songs.length; i++) {\n shuffleTemp[i] = config.playlists[playlist].songs[i];\n }\n\n /*\n Iterate ove rthe songs and generate random numbers to\n swap the indexes of the shuffle array.\n */\n for (let i = config.playlists[playlist].songs.length - 1; i > 0; i--) {\n let randNum = Math.floor(\n Math.random() * config.playlists[playlist].songs.length + 1\n );\n shuffleSwap(shuffleTemp, i, randNum - 1);\n }\n\n /*\n Set the shuffle list to the shuffle temp.\n */\n config.playlists[playlist].shuffle_list = shuffleTemp;\n }\n\n /**\n * Swaps and randomizes the song shuffle.\n *\n * @access private\n * @param {object} shuffleList \t- The list of songs that is going to be shuffled\n * @param {number} original \t\t- The original index of he song in the songs array\n * @param {number} random \t\t\t- The randomized index that will be the new index of the song in the shuffle array.\n */\n function shuffleSwap(shuffleList, original, random) {\n let temp = shuffleList[original];\n shuffleList[original] = shuffleList[random];\n shuffleList[random] = temp;\n }\n\n /**\n * Returns public facing methods\n */\n return {\n setShuffle: setShuffle,\n toggleShuffle: toggleShuffle,\n setShufflePlaylist: setShufflePlaylist,\n toggleShufflePlaylist: toggleShufflePlaylist,\n shuffleSongs: shuffleSongs,\n shufflePlaylistSongs: shufflePlaylistSongs\n };\n})();\n\nexport default Shuffler;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/shuffler.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the visual representation of AmplitudeJS song slider elements.\n * @module visual/SongSliderElements\n */\nlet SongSliderElements = (function() {\n /**\n * Syncs all of the song slider elements.\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n * @param {number} songIndex \t- The index of the song we are adjusting the song slider for.\n */\n function sync(location, playlist, songIndex) {\n syncMain(location);\n syncPlaylist(location, playlist);\n syncSong(location, songIndex);\n syncSongInPlaylist(location, playlist);\n }\n\n /**\n * Syncs the main slider location\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n */\n function syncMain(location) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\tGets the main song sliders\n\t\t*/\n const mainSongSliders = document.querySelectorAll(\".amplitude-song-slider\");\n\n /*\n\t\t\tIterates over all of the main sliders and sets the value to the\n\t\t\tpercentage of the song played.\n\t\t*/\n for (let i = 0; i < mainSongSliders.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlist = mainSongSliders[i].getAttribute(\"data-amplitude-playlist\");\n let song = mainSongSliders[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n This method is responsible for only the global elements,\n so we make sure there are no playlist or songs defined on\n the element.\n */\n if (playlist == null && song == null) {\n mainSongSliders[i].value = location;\n }\n }\n }\n\n /**\n * Syncs playlist song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n */\n function syncPlaylist(location, playlist) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\tGets the playlist song sliders\n\t\t*/\n const playlistSongSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n\t\t\tIterates over all of the playlist sliders and sets the value to the\n\t\t\tpercentage of the song played.\n\t\t*/\n for (let i = 0; i < playlistSongSliders.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlistAttribute = playlistSongSliders[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songAttribute = playlistSongSliders[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\tThis method is responsible for only the playlist elements,\n\t\t\t\tso we make sure the playlist attribute matches what is passed\n\t\t\t\tin.\n\t\t\t*/\n if (playlistAttribute == playlist && songAttribute == null) {\n playlistSongSliders[i].value = location;\n }\n }\n }\n\n /**\n * Syncs individual song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {number} songIndex \t- The index of the song we are adjusting the song slider for.\n */\n function syncSong(location, songIndex) {\n /*\n\t\t\tWe only want to sync song sliders if the playlist is null.\n\t\t*/\n if (config.active_playlist == null) {\n /*\n\t\t\t\tEnsure we have a location that's a number\n\t\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\t\tGets the individual song sliders\n\t\t\t*/\n const songSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-song-index=\"' + songIndex + '\"]'\n );\n\n /*\n\t\t\t\tIterates over all of the individual song sliders and sets the value\n\t\t\t\tto the percentage of the song played.\n\t\t\t*/\n for (let i = 0; i < songSliders.length; i++) {\n /*\n\t Grab the playlist and song attributes from the element.\n\t */\n let playlistAttribute = songSliders[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songAttribute = songSliders[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\t\tThis method is responsible for only the playlist elements,\n\t\t\t\t\tso we make sure the playlist attribute matches what is passed\n\t\t\t\t\tin.\n\t\t\t\t*/\n if (playlistAttribute == null && songAttribute == songIndex) {\n songSliders[i].value = location;\n }\n }\n }\n }\n\n /**\n * Syncs individual song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n */\n function syncSongInPlaylist(location, playlist) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGets the song in playlist sliders\n\t\t*/\n const songInPlaylistSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-playlist=\"' +\n playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tIterates over all of the song in playlist sliders and sets the value\n\t\t\tto the percentage of the song played.\n\t\t*/\n for (let i = 0; i < songInPlaylistSliders.length; i++) {\n songInPlaylistSliders[i].value = location;\n }\n }\n\n /**\n * Visually syncs the song sliders back to 0. This usually happens when\n * a song has changed, we ensure that all song sliders get reset.\n *\n * @access public\n */\n function resetElements() {\n let songSliders = document.getElementsByClassName(\"amplitude-song-slider\");\n\n /*\n\t\t\tIterate over all of the song sliders and set them to\n\t\t\t0 essentially resetting them.\n\t\t*/\n for (let i = 0; i < songSliders.length; i++) {\n songSliders[i].value = 0;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n syncMain: syncMain,\n syncPlaylist: syncPlaylist,\n syncSong: syncSong,\n syncSongInPlaylist: syncSongInPlaylist,\n resetElements: resetElements\n };\n})();\n\nexport default SongSliderElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/songSliderElements.js","/**\n * Imports the AmplitudeJS Current Time\n * @module visual/time/CurrentTimeElements\n */\nimport CurrentTimeElements from \"./time/currentTimeElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Hour Elements\n * @module visual/time/CurrentHourElements\n */\nimport CurrentHourElements from \"./time/currentHourElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Minute Elements\n * @module visual/time/CurrentMinuteElements\n */\nimport CurrentMinuteElements from \"./time/currentMinuteElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Second Elements\n * @module visual/time/CurrentTimeElements\n */\nimport CurrentSecondElements from \"./time/currentSecondElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Count Down Time Elements\n * @module visual/time/DurationCountDownTimeElements\n */\nimport DurationCountDownTimeElements from \"./time/durationCountDownTimeElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Hour Elements\n * @module visual/time/DurationHourElements\n */\nimport DurationHourElements from \"./time/durationHourElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Minute Elements\n * @module visual/time/DurationMinuteElements\n */\nimport DurationMinuteElements from \"./time/durationMinuteElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Second Elements\n * @module visual/time/DurationSecondElements\n */\nimport DurationSecondElements from \"./time/durationSecondElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Time Elements\n * @module visual/time/DurationTimeElements\n */\nimport DurationTimeElements from \"./time/durationTimeElements.js\";\n\n/**\n * Time Elements Interface. This allows us to update all of the sub time elements\n * through one central point.\n * @module visual/TimeElements\n */\nlet TimeElements = (function() {\n /**\n * Resets the current times.\n */\n function resetCurrentTimes() {\n CurrentTimeElements.resetTimes();\n CurrentHourElements.resetTimes();\n CurrentMinuteElements.resetTimes();\n CurrentSecondElements.resetTimes();\n }\n\n /**\n * Syncs the current time elements to the time provided.\n *\n * @param {Object} currentTime - An object representing the current time of the audio.\n */\n function syncCurrentTimes(currentTime) {\n CurrentTimeElements.sync(currentTime);\n CurrentHourElements.sync(currentTime.hours);\n CurrentMinuteElements.sync(currentTime.minutes);\n CurrentSecondElements.sync(currentTime.seconds);\n }\n\n /**\n * Resets the duration times.\n */\n function resetDurationTimes() {\n DurationCountDownTimeElements.resetTimes();\n DurationHourElements.resetTimes();\n DurationMinuteElements.resetTimes();\n DurationSecondElements.resetTimes();\n DurationTimeElements.resetTimes();\n }\n\n /**\n * Syncs the duration times to the times provided.\n *\n * @param {Object} currentTime - An object representing the current time of the audio.\n * @param {Object} songDuration - An object representing the duration of the audio\n */\n function syncDurationTimes(currentTime, songDuration) {\n DurationCountDownTimeElements.sync(currentTime, songDuration);\n DurationTimeElements.sync(songDuration);\n DurationHourElements.sync(songDuration.hours);\n DurationMinuteElements.sync(songDuration.minutes);\n DurationSecondElements.sync(songDuration.seconds);\n }\n\n /**\n * Returns the publically accessible methods.\n */\n return {\n resetCurrentTimes: resetCurrentTimes,\n syncCurrentTimes: syncCurrentTimes,\n resetDurationTimes: resetDurationTimes,\n syncDurationTimes: syncDurationTimes\n };\n})();\n\nexport default TimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/timeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the debug module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Handles the visualizations elements.\n *\n * @module Visualizations\n */\nlet Visualizations = (function() {\n /**\n * Runs all of the visualizations on the screen.\n */\n function run() {\n /*\n Get all of the visualization elements on the page\n */\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n /*\n If the web audio API is available, we display the visualizations.\n */\n if (config.web_audio_api_available) {\n /*\n If the visualization has not started, there are visualizations available,\n and we have at least one visualization element, then we continue.\n */\n if (\n Object.keys(config.visualizations.available).length > 0 &&\n visualizationElements.length > 0\n ) {\n /*\n Iterate over all of the visualizations on the page and activate the\n ones we need.\n */\n for (let i = 0; i < visualizationElements.length; i++) {\n /*\n Grab the playlist and song attributes from the visualization to\n determine which one we run.\n */\n let playlist = visualizationElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = visualizationElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n If the playlist and song are null, it's a global visualization element.\n */\n if (playlist == null && song == null) {\n runGlobalVisualization(visualizationElements[i]);\n }\n\n /*\n if the playlist is not null and the song is null it's a playlist visualization\n element.\n */\n if (playlist != null && song == null) {\n runPlaylistVisualization(visualizationElements[i], playlist);\n }\n\n /*\n If the playlist is null and the song is not null it's a song visualization element.\n */\n if (playlist == null && song != null) {\n runSongVisualization(visualizationElements[i], song);\n }\n\n /*\n If the playlist and song are not null then it's a song in playlist visualization\n element.\n */\n if (playlist != null && song != null) {\n runSongInPlaylistVisualization(\n visualizationElements[i],\n playlist,\n song\n );\n }\n }\n }\n } else {\n displayBackups();\n }\n }\n\n /**\n * Runs a global visualization\n *\n * @param {Node} element The container element that handles the visualization.\n */\n function runGlobalVisualization(element) {\n /*\n Gets the global visualization index and the active song visualization indexes\n so we know which visualization to use. The song will override the global\n */\n let globalVisualizationIndex = config.visualization;\n let activeSongVisualizationIndex =\n config.active_index != null\n ? config.songs[config.active_index].visualization\n : config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n\n /*\n If the active song visualization is defined and the visualization exists,\n use that visualization.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the user defined a global visualization, use that one.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n\n /*\n If the user didn't define a global visualization, use the first visualization\n registered if there is one.\n */\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n\n /**\n * Run a specific playlist visualization.\n *\n * @param {Node} element The container element that handles the visualization.\n * @param {string} playlist The key of the playlist we are running the visualization for.\n */\n function runPlaylistVisualization(element, playlist) {\n /*\n If the playlist is equal to the active playlist, then we continue.\n */\n if (playlist == config.active_playlist) {\n /*\n Checks if the song has a visualization and that visualization exists,\n run that visualization.\n */\n let activeSongVisualizationIndex =\n config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n let activePlaylistVisualizationIndex =\n config.playlists[config.active_playlist].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the actual song has a visualization, we run that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the actual playlist has a visualization, run that.\n */\n } else if (\n activePlaylistVisualizationIndex != undefined &&\n config.visualizations.available[activePlaylistVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activePlaylistVisualizationIndex, element);\n\n /*\n If a global visualization is defined, run that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Run a song specific visualization.\n *\n * @param {Node} element The container element that handles the visualization.\n * @param {string} song The song index that we are running the visualization for.\n */\n function runSongVisualization(element, song) {\n /*\n If the song is equal to the active song, then we continue.\n */\n if (song == config.active_index) {\n /*\n Get the indexes of the song\n */\n let activeSongVisualizationIndex =\n config.songs[config.active_index].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the song has a visualization, run that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the global visualization is set, use that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Run a song in playlist visualization.\n *\n * @param {Node} element - The element containing the visualization.\n * @param {string} playlist - The string of the playlist key.\n * @param {index} song - The index of the song in the playlist.\n */\n function runSongInPlaylistVisualization(element, playlist, song) {\n /*\n If the playlist is the same as the active playlist and the active\n index of the song is the same as the song, then we continue.\n */\n if (\n playlist == config.active_playlist &&\n config.playlists[playlist].active_index == song\n ) {\n /*\n Checks if the song has a visualization and that visualization exists,\n run that visualization.\n */\n let activeSongVisualizationIndex =\n config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n let activePlaylistVisualizationIndex =\n config.playlists[config.active_playlist].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the active song has a visualization, we use that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the active playlist has a visualization, we use that.\n */\n } else if (\n activePlaylistVisualizationIndex != undefined &&\n config.visualizations.available[activePlaylistVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activePlaylistVisualizationIndex, element);\n\n /*\n If the global visualization has been set, we use that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Add a visualization to the array of active visualizations.\n *\n * @param {string} key - The key of the active visualization.\n * @param {Node} element - The element that the visualization will be applied to.\n */\n function addToActiveVisualizations(key, element) {\n let visualization = new config.visualizations.available[key][\"object\"]();\n visualization.setPreferences(\n config.visualizations.available[key][\"preferences\"]\n );\n visualization.startVisualization(element);\n config.visualizations.active.push(visualization);\n }\n\n /**\n * Stops all active visualizations.\n */\n function stop() {\n /*\n Iterates over all of the visualizations and stop the visualization.\n */\n for (let i = 0; i < config.visualizations.active.length; i++) {\n config.visualizations.active[i].stopVisualization();\n }\n\n /*\n Clear the active visualizations.\n */\n config.visualizations.active = [];\n }\n\n /**\n * Registers any visualization we can use.\n *\n * @param {object} visualization The visualization object itself\n * @param {object} preferences User preferences overrides.\n */\n function register(visualization, preferences) {\n /*\n Initialize the new visualization.\n */\n let newVisualization = new visualization();\n\n /*\n\t Adds the visualization to the global config so it knows\n\t it can be used when playing songs.\n\n\t getID is a public function for getting a visualization's id.\n\t It becomes the key to access the visualization.\n\t */\n config.visualizations.available[newVisualization.getID()] = new Array();\n config.visualizations.available[newVisualization.getID()][\n \"object\"\n ] = visualization;\n config.visualizations.available[newVisualization.getID()][\n \"preferences\"\n ] = preferences;\n }\n\n /**\n * Displays the backups for the visualizations.\n */\n function displayBackups() {\n /*\n Get all of the visualization elements on the page\n */\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n if (visualizationElements.length > 0) {\n for (let x = 0; x < visualizationElements.length; x++) {\n /*\n Grab the playlist and song attributes from the visualization to\n determine which one we run.\n */\n let playlist = visualizationElements[x].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = visualizationElements[x].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n If the playlist and song are null, it's a global visualization element.\n */\n if (playlist == null && song == null) {\n displayGlobalBackup(visualizationElements[x]);\n }\n\n /*\n if the playlist is not null and the song is null it's a playlist visualization\n element.\n */\n if (playlist != null && song == null) {\n displayPlaylistBackup(visualizationElements[x], playlist);\n }\n\n /*\n If the playlist is null and the song is not null it's a song visualization element.\n */\n if (playlist == null && song != null) {\n displaySongBackup(visualizationElements[x], song);\n }\n\n /*\n If the playlist and song are not null then it's a song in playlist visualization\n element.\n */\n if (playlist != null && song != null) {\n displaySongInPlaylistBackup(visualizationElements[x], playlist, song);\n }\n }\n }\n }\n\n /**\n * Displays the global backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displayGlobalBackup(element) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n\n /**\n * Displays the playlist backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displayPlaylistBackup(element, playlist) {\n if (config.active_playlist == playlist) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /**\n * Displays the song backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displaySongBackup(element, song) {\n if (config.active_index == song) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /**\n * Displays the song in playlist backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displaySongInPlaylistBackup(element, playlist, song) {\n if (\n config.active_playlist == playlist &&\n config.playlists[active_playlist].active_index == song\n ) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n run: run,\n stop: stop,\n register: register\n };\n})();\n\nexport default Visualizations;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/visualizations.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the initializer\n * @module init/AmplitudeInitializer\n */\nimport AmplitudeInitializer from \"../init/init.js\";\n\n/**\n * These helpers wrap around the basic methods of the Soundcloud API\n * and get the information we need from SoundCloud to make the songs\n * streamable through Amplitude\n *\n * @module soundcloud/SoundCloud\n */\nlet SoundCloud = (function() {\n /**\n * Defines the temporary user config used while we configure soundcloud\n * @type {object}\n */\n let tempUserConfig = {};\n\n /**\n * Loads the soundcloud SDK for use with Amplitude so the user doesn't have\n * to load it themselves.\n * With help from: http://stackoverflow.com/questions/950087/include-a-javascript-file-in-another-javascript-file\n *\n * @access public\n * @param {object} userConfig \t- The config defined by the user for AmplitudeJS\n */\n function loadSoundCloud(userConfig) {\n /*\n\t\t\tSets the temporary config to the config passed by the user so we can make changes\n\t\t\tand not break the actual config.\n\t\t*/\n tempUserConfig = userConfig;\n\n /*\n\t\t\tGets the head tag for the document and create a script element.\n\t\t*/\n let head = document.getElementsByTagName(\"head\")[0];\n let script = document.createElement(\"script\");\n\n script.type = \"text/javascript\";\n\n /*\n\t\t\tURL to the remote soundcloud SDK\n\t\t*/\n script.src = \"https://connect.soundcloud.com/sdk.js\";\n script.onreadystatechange = initSoundcloud;\n script.onload = initSoundcloud;\n\n /*\n\t\t\tAdd the script to the head of the document.\n\t\t*/\n head.appendChild(script);\n }\n\n /**\n * Initializes soundcloud with the key provided.\n *\n * @access private\n */\n function initSoundcloud() {\n /*\n\t\t\tCalls the SoundCloud initialize function\n\t\t\tfrom their API and sends it the client_id\n\t\t\tthat the user passed in.\n\t\t*/\n SC.initialize({\n client_id: config.soundcloud_client\n });\n\n /*\n\t\t\tGets the streamable URLs to run through Amplitue. This is\n\t\t\tVERY important since Amplitude can't stream the copy and pasted\n\t\t\tlink from the SoundCloud page, but can resolve the streaming\n\t\t\tURLs from the link.\n\t\t*/\n getStreamableURLs();\n }\n\n /**\n * Gets the streamable URL from the URL provided for\n * all of the soundcloud links. This will loop through\n * and set all of the information for the soundcloud\n * urls.\n *\n * @access private\n */\n function getStreamableURLs() {\n /*\n\t\t\tDefine the regex to find the soundcloud URLs\n\t\t*/\n let soundcloud_regex = /^https?:\\/\\/(soundcloud.com|snd.sc)\\/(.*)$/;\n\n for (let i = 0; i < config.songs.length; i++) {\n /*\n\t\t\t\tIf the URL matches soundcloud, we grab\n\t\t\t\tthat url and get the streamable link\n\t\t\t\tif there is one.\n\t\t\t*/\n if (config.songs[i].url.match(soundcloud_regex)) {\n config.soundcloud_song_count++;\n resolveStreamable(config.songs[i].url, i);\n }\n }\n }\n\n /**\n * Resolves an individual streamable URL.\n *\n * @param {string} url - The URL of the SoundCloud song to get the streamable URL from.\n * @param {string} playlist - The playlist we are getting the streamable URL for.\n * @param {Integer} index - The index of the song in the playlist or the songs array.\n * @param {boolean} addToShuffleList - Whether we add to the shuffle list for the songs or playlist.\n *\n */\n function resolveIndividualStreamableURL(\n url,\n playlist,\n index,\n addToShuffleList = false\n ) {\n SC.get(\"/resolve/?url=\" + url, function(sound) {\n /*\n If streamable we get the url and bind the client ID to the end\n so Amplitude can just stream the song normally. We then overwrite\n the url the user provided with the streamable URL.\n */\n if (sound.streamable) {\n if (playlist != null) {\n config.playlists[playlist].songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n }\n /*\n If the user want's to use soundcloud art, we overwrite the\n cover_art_url with the soundcloud artwork url.\n */\n if (config.soundcloud_use_art) {\n config.playlists[playlist].songs[index].cover_art_url =\n sound.artwork_url;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[index].cover_art_url =\n sound.artwork_url;\n }\n }\n\n /*\n Grab the extra metadata from soundcloud and bind it to the\n song. The user can get this through the public function:\n getActiveSongMetadata\n */\n config.playlists[playlist].songs[index].soundcloud_data = sound;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[\n index\n ].soundcloud_data = sound;\n }\n } else {\n config.songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n if (addToShuffleList) {\n config.shuffle_list[index].stream_url +\n \"?client_id=\" +\n config.soundcloud_client;\n }\n\n /*\n If the user want's to use soundcloud art, we overwrite the\n cover_art_url with the soundcloud artwork url.\n */\n if (config.soundcloud_use_art) {\n config.songs[index].cover_art_url = sound.artwork_url;\n\n if (addToShuffleList) {\n config.shuffle_list[index].cover_art_url = sound.artwork_url;\n }\n }\n\n /*\n Grab the extra metadata from soundcloud and bind it to the\n song. The user can get this through the public function:\n getActiveSongMetadata\n */\n config.songs[index].soundcloud_data = sound;\n\n if (addToShuffleList) {\n config.shuffle_list[index].soundcloud_data = sound;\n }\n }\n } else {\n if (playlist != null) {\n AmplitudeHelpers.writeDebugMessage(\n config.playlists[playlist].songs[index].name +\n \" by \" +\n config.playlists[playlist].songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n } else {\n /*\n If not streamable, then we print a message to the user stating\n that the song with name X and artist X is not streamable. This\n gets printed ONLY if they have debug turned on.\n */\n AmplitudeHelpers.writeDebugMessage(\n config.songs[index].name +\n \" by \" +\n config.songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n }\n }\n });\n }\n\n /**\n * Due to Soundcloud SDK being asynchronous, we need to scope the\n * index of the song in another function. The privateGetSoundcloudStreamableURLs\n * function does the actual iteration and scoping.\n *\n * @access private\n * @param {string} url \t\t- URL of the soundcloud song\n * @param {number} index \t- The index of the soundcloud song in the songs array.\n */\n function resolveStreamable(url, index) {\n SC.get(\"/resolve/?url=\" + url, function(sound) {\n /*\n\t\t\t\tIf streamable we get the url and bind the client ID to the end\n\t\t\t\tso Amplitude can just stream the song normally. We then overwrite\n\t\t\t\tthe url the user provided with the streamable URL.\n\t\t\t*/\n if (sound.streamable) {\n config.songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n /*\n\t\t\t\t\tIf the user want's to use soundcloud art, we overwrite the\n\t\t\t\t\tcover_art_url with the soundcloud artwork url.\n\t\t\t\t*/\n if (config.soundcloud_use_art) {\n config.songs[index].cover_art_url = sound.artwork_url;\n }\n\n /*\n\t\t\t\t\tGrab the extra metadata from soundcloud and bind it to the\n\t\t\t\t\tsong. The user can get this through the public function:\n\t\t\t\t\tgetActiveSongMetadata\n\t\t\t\t*/\n config.songs[index].soundcloud_data = sound;\n } else {\n /*\n\t\t\t\t\tIf not streamable, then we print a message to the user stating\n\t\t\t\t\tthat the song with name X and artist X is not streamable. This\n\t\t\t\t\tgets printed ONLY if they have debug turned on.\n\t\t\t\t*/\n AmplitudeHelpers.writeDebugMessage(\n config.songs[index].name +\n \" by \" +\n config.songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n }\n /*\n\t\t\t\tIncrements the song ready counter.\n\t\t\t*/\n config.soundcloud_songs_ready++;\n\n /*\n\t\t\t\tWhen all songs are accounted for, then amplitude is ready\n\t\t\t\tto rock and we set the rest of the config.\n\t\t\t*/\n if (config.soundcloud_songs_ready == config.soundcloud_song_count) {\n AmplitudeInitializer.setConfig(tempUserConfig);\n }\n });\n }\n\n /**\n * Determines if a given URL is a SoundCloud URL.\n *\n * @param {string} url - The URL to test if it's a SoundCloud URL.\n */\n function isSoundCloudURL(url) {\n let soundcloud_regex = /^https?:\\/\\/(soundcloud.com|snd.sc)\\/(.*)$/;\n\n return url.match(soundcloud_regex);\n }\n\n /*\n\t\tReturns the publically accessible methods\n\t*/\n return {\n loadSoundCloud: loadSoundCloud,\n resolveIndividualStreamableURL: resolveIndividualStreamableURL,\n isSoundCloudURL: isSoundCloudURL\n };\n})();\n\nexport default SoundCloud;\n\n\n\n// WEBPACK FOOTER //\n// ./src/soundcloud/soundcloud.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the Playback Speed Visual Elements Handler\n * @module visual/PlaybackSpeedElements\n */\nlet PlaybackSpeedElements = (function() {\n /**\n * Sets all of the visual playback speed buttons to have the right class\n * to display the background image that represents the current playback\n * speed.\n *\n * @access public\n */\n function sync() {\n /*\n\t\t\tGets all of the playback speed classes.\n\t\t*/\n let playbackSpeedClasses = document.getElementsByClassName(\n \"amplitude-playback-speed\"\n );\n\n /*\n\t\t\tIterates over all of the playback speed classes\n\t\t\tapplying the right speed class for visual purposes.\n\t\t*/\n for (let i = 0; i < playbackSpeedClasses.length; i++) {\n /*\n\t\t\t\tRemoves all of the old playback speed classes.\n\t\t\t*/\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-10\");\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-15\");\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-20\");\n\n /*\n\t\t\t\tSwitch the current playback speed and apply the appropriate\n\t\t\t\tspeed class.\n\t\t\t*/\n switch (config.playback_speed) {\n case 1:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-10\");\n break;\n case 1.5:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-15\");\n break;\n case 2:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-20\");\n break;\n }\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync\n };\n})();\n\nexport default PlaybackSpeedElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/playbackSpeedElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the shuffle elements\n * @module visual/ShuffleElements\n */\nlet ShuffleElements = (function() {\n /**\n * Syncs the global shuffle button visual state.\n *\n * @access public\n */\n function syncMain() {\n /*\n\t\t\tGets the shuffle buttons.\n\t\t*/\n let shuffleButtons = document.getElementsByClassName(\"amplitude-shuffle\");\n\n /*\n\t\t\tIterate over all of the shuffle buttons.\n\t\t*/\n for (let i = 0; i < shuffleButtons.length; i++) {\n /*\n\t\t\t\tEnsure the shuffle button doesn't belong to a playlist. We have\n\t\t\t\ta separate method for that.\n\t\t\t*/\n if (shuffleButtons[i].getAttribute(\"data-amplitude-playlist\") == null) {\n /*\n\t\t\t\t\tIf the state of the player is shuffled on, true, then\n\t\t\t\t\twe add the 'amplitude-shuffle-on' class and remove the\n\t\t\t\t\t'amplitude-shuffle-off' class. If the player is not shuffled\n\t\t\t\t\tthen we do the opposite.\n\t\t\t\t*/\n if (config.shuffle_on) {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-on\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-off\");\n } else {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-off\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-on\");\n }\n }\n }\n }\n\n /**\n * Syncs the playlist shuffle button visual state.\n *\n * @access public\n * @param {string} playlist - The playlist string the shuffle button belongs to.\n */\n function syncPlaylist(playlist) {\n /*\n\t\t\tGets all of the shuffle buttons.\n\t\t*/\n let shuffleButtons = document.querySelectorAll(\n '.amplitude-shuffle[data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n\t\t\tIterate over all of the shuffle buttons\n\t\t*/\n for (let i = 0; i < shuffleButtons.length; i++) {\n /*\n\t\t\t\tIf the state of the playlist is shuffled on, true, then\n\t\t\t\twe add the 'amplitude-shuffle-on' class and remove the\n\t\t\t\t'amplitude-shuffle-off' class. If the player is not shuffled\n\t\t\t\tthen we do the opposite.\n\t\t\t*/\n if (config.playlists[playlist].shuffle) {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-on\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-off\");\n } else {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-off\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-on\");\n }\n }\n }\n\n /**\n * Returns public facing methods\n */\n return {\n syncMain: syncMain,\n syncPlaylist: syncPlaylist\n };\n})();\n\nexport default ShuffleElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/shuffleElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the syncing of the song played progress elements.\n *\n * @module visual/SongPlayedProgressElements\n */\nlet SongPlayedProgressElements = (function() {\n /**\n * Syncs the song played progress bars. These are HTML5 progress elements.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percentage of the song that has been played.\n */\n function sync(songPlayedPercentage) {\n syncGlobal(songPlayedPercentage);\n syncPlaylist(songPlayedPercentage);\n syncSong(songPlayedPercentage);\n syncSongInPlaylist(songPlayedPercentage);\n }\n\n /**\n * Sync how much has been played with a progress bar. This is the global progress bar.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncGlobal(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n \".amplitude-song-played-progress\"\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is the playlist progress bar.\n *\n * @access public\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncPlaylist(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let song = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (song == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is for an individual song.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncSong(percentage) {\n if (config.active_playlist == null) {\n /*\n\t\t\t\tEnsure that the song completion percentage is a number\n\t\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\t\tGet all of the song progress bars\n\t\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is for an individual song in playlist.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncSongInPlaylist(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n Iterates over all of the song played progress elements\n and sets them accordingly.\n */\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist != null && songIndex != null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sets all of the song played progress bars to 0\n *\n * @access public\n */\n function resetElements() {\n let songPlayedProgressBars = document.getElementsByClassName(\n \"amplitude-song-played-progress\"\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n songPlayedProgressBars[i].value = 0;\n }\n }\n\n return {\n sync: sync,\n resetElements: resetElements\n };\n})();\n\nexport default SongPlayedProgressElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/songPlayedProgressElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Core Module\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * AmplitudeJS SoundCloud Module\n * @module soundcloud/SoundCloud\n */\nimport SoundCloud from \"../soundcloud/soundcloud.js\";\n\n/**\n * Imports the utilities used by the main module.\n */\n/**\n * AmplitudeJS Config State Module\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Checks Module\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * AmplitudeJS Shuffler Module\n * @module utilities/Shuffler\n */\nimport Shuffler from \"../utilities/shuffler.js\";\n\n/**\n * AmplitudeJS Events Module\n * @module events/Events\n */\nimport Events from \"../events/events.js\";\n\n/**\n * AmplitudeJS FX Module\n * @module fx/Fx\n */\nimport Fx from \"../fx/fx.js\";\n\n/**\n * AmplitudeJS Visualizations Module\n * @module fx/Visualizations\n */\nimport Visualizations from \"../fx/visualizations.js\";\n\n/**\n * AmplitudeJS WaveForm Module\n * @module fx/WaveForm\n */\nimport WaveForm from \"../fx/waveform.js\";\n\n/**\n * AmplitudeJS Audio Navigation Module.\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Callbacks Module\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * AmplitudeJS Playlists Initializer Module\n * @module init/Playlists\n */\nimport PlaylistsInitializer from \"./playlists.js\";\n\n/**\n * Imports the AmplitudeJS Shuffle Elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"../visual/shuffleElements.js\";\n\n/**\n * Imports the AmplitudeJS Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Volume Slider\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Imports the AmplitudeJS Time Elements\n * @module visual/TimeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Imports the AmplitudeJS Play/Pause Elements Module.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the AmplitudeJS MetaData Elements Module.\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Imports the AmplitudeJS PlaybackSpeedElements Module.\n * @module visual/PlayBackSpeedElements\n */\nimport PlaybackSpeedElements from \"../visual/playbackSpeedElements.js\";\n\n/**\n * Imports the AmplitudeJS Repeat Element\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * AmplitudeJS Initializer Module. Helps with the handling of all of the\n * initialization for AmplitudeJS.\n *\n * @module init/Initializer\n */\nlet Initializer = (function() {\n /**\n * The main init function. The user will call this through\n * Amplitude.init({}) and pass in their settings.\n *\n * Public Accessor: Amplitude.init( user_config_json )\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function initialize(userConfig) {\n let ready = false;\n\n /*\n\t\t\tReset the config on init so we have a clean slate. This is if the\n\t\t\tuser has to re-init.\n\t\t*/\n ConfigState.resetConfig();\n\n /*\n\t\t\tInitialize event handlers on init. This will clear any old\n\t\t\tevent handlers on the amplitude element and re-bind what is\n\t\t\tnecessary.\n\t\t*/\n Events.initialize();\n\n /*\n Initialize the callbacks we listen to for the audio object.\n */\n Callbacks.initialize();\n\n /*\n\t\t\tInitializes debugging right away so we can use it for the rest\n\t\t\tof the configuration.\n\t\t*/\n config.debug = userConfig.debug != undefined ? userConfig.debug : false;\n\n /*\n Set default artwork, if specified.\n */\n setArt(userConfig)\n\n /*\n\t\t\tChecks to see if the user has songs defined.\n\t\t*/\n if (userConfig.songs) {\n /*\n\t\t\t\tChecks to see if the user has some songs in the songs array.\n\t\t\t*/\n if (userConfig.songs.length != 0) {\n /*\n\t\t\t\t\tCopies over the user defined songs. and prepares\n\t\t\t\t\tAmplitude for the rest of the configuration.\n\t\t\t\t*/\n config.songs = userConfig.songs;\n /*\n\t\t\t\t\tFlag amplitude as ready.\n\t\t\t\t*/\n ready = true;\n } else {\n Debug.writeMessage(\"Please add some songs, to your songs object!\");\n }\n } else {\n Debug.writeMessage(\n \"Please provide a songs object for AmplitudeJS to run!\"\n );\n }\n\n /*\n\t\t\tInitializes the audio context. In this method it checks to see if the\n\t\t\tuser wants to use visualizations or not before proceeding.\n\t\t*/\n if (Fx.webAudioAPIAvailable()) {\n if( Fx.determineUsingAnyFX() ){\n /*\n Configure the Web Audio API If It's available.\n */\n Fx.configureWebAudioAPI();\n\n /*\n Activates the audio context after an event for the user.\n */\n document.documentElement.addEventListener(\n \"mousedown\", function(){\n if (config.context.state !== 'running') {\n config.context.resume();\n }\n });\n\n document.documentElement.addEventListener(\n \"keydown\", function(){\n if (config.context.state !== 'running') {\n config.context.resume();\n }\n });\n\n document.documentElement.addEventListener(\n \"keyup\", function(){\n if (config.context.state !== 'running') {\n config.context.resume();\n }\n });\n \n \n\n /*\n Set the user waveform settings if provided.\n */\n if (\n userConfig.waveforms != undefined &&\n userConfig.waveforms.sample_rate != undefined\n ) {\n config.waveforms.sample_rate = userConfig.waveforms.sample_rate;\n }\n\n /*\n Initialize the waveform.\n */\n WaveForm.init();\n\n /*\n If the user is registering visualizations on init,\n we set them right away.\n */\n if (\n userConfig.visualizations != undefined &&\n userConfig.visualizations.length > 0\n ) {\n /*\n Iterate over all of the visualizations and\n register them in our player.\n */\n for (let i = 0; i < userConfig.visualizations.length; i++) {\n Visualizations.register(\n userConfig.visualizations[i].object,\n userConfig.visualizations[i].params\n );\n }\n }\n }\n } else {\n Debug.writeMessage(\n \"The Web Audio API is not available on this platform. We are using your defined backups!\"\n );\n }\n\n /*\n Initialize default live settings\n */\n initializeDefaultLiveSettings();\n\n /*\n Initialize default song indexes\n */\n initializeDefaultSongIndexes();\n\n /*\n\t\t\tWhen the preliminary config is ready, we are ready to proceed.\n\t\t*/\n if (ready) {\n /*\n\t\t\t\tCopies over the soundcloud information to the global config\n\t\t\t\twhich will determine where we go from there.\n\t\t\t*/\n config.soundcloud_client =\n userConfig.soundcloud_client != undefined\n ? userConfig.soundcloud_client\n : \"\";\n\n /*\n\t\t\t\tChecks if we want to use the art loaded from soundcloud.\n\t\t\t*/\n config.soundcloud_use_art =\n userConfig.soundcloud_use_art != undefined\n ? userConfig.soundcloud_use_art\n : \"\";\n\n /*\n\t\t\t\tIf the user provides a soundcloud client then we assume that\n\t\t\t\tthere are URLs in their songs that will reference SoundCloud.\n\t\t\t\tWe then copy over the user config they provided to the\n\t\t\t\ttemp_user_config so we don't mess up the global or their configs\n\t\t\t\tand load the soundcloud information.\n\t\t\t*/\n let tempUserConfig = {};\n\n /*\n If there's a soundcloud_client key set, we load the SoundCloud data\n for all of the songs in the array.\n */\n if (config.soundcloud_client != \"\") {\n tempUserConfig = userConfig;\n\n /*\n\t\t\t\t\tLoad up SoundCloud for use with AmplitudeJS.\n\t\t\t\t*/\n SoundCloud.loadSoundCloud(tempUserConfig);\n } else {\n /*\n\t\t\t\t\tThe user is not using Soundcloud with Amplitude at this point\n\t\t\t\t\tso we just finish the configuration with the users's preferences.\n\t\t\t\t*/\n setConfig(userConfig);\n }\n }\n\n /*\n\t\t\tDebug out what was initialized with AmplitudeJS.\n\t\t*/\n Debug.writeMessage(\"Initialized With: \");\n Debug.writeMessage(config);\n }\n\n /**\n * Rebinds all of the elements in the display.\n *\n * Public Accessor: Amplitude.rebindDisplay()\n * @access public\n */\n function rebindDisplay() {\n Events.initialize();\n MetaDataElements.displayMetaData();\n }\n\n /**\n * Finishes the initalization of the config. Takes all of the user defined\n * parameters and makes sure they override the defaults. The important\n * config information is assigned in the publicInit() function.\n *\n * This function can be called from 2 different locations:\n * \t1. Right away on init after the important settings are defined.\n *\n * \t2. After all of the Soundcloud URLs are resolved properly and\n *\t \tsoundcloud is configured. We will need the proper URLs from Soundcloud\n * \t\tto stream through Amplitude so we get those right away before we\n * \t\tset the information and the active song\n *\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function setConfig(userConfig) {\n /*\n Checks if the user has any playlists defined. If they do\n we have to initialize the functionality for the playlists.\n */\n if (userConfig.playlists && countPlaylists(userConfig.playlists) > 0) {\n PlaylistsInitializer.initialize(userConfig.playlists);\n }\n\n /*\n\t\t\tCheck to see if the user entered a start song\n\t\t*/\n if (userConfig.start_song != undefined && userConfig.starting_playlist) {\n /*\n\t\t\t\tEnsure what has been entered is an integer.\n\t\t\t*/\n if (Checks.isInt(userConfig.start_song)) {\n AudioNavigation.changeSong(\n config.songs[userConfig.start_song],\n userConfig.start_song\n );\n } else {\n Debug.writeMessage(\n \"You must enter an integer index for the start song.\"\n );\n }\n } else {\n AudioNavigation.changeSong(config.songs[0], 0);\n }\n\n /*\n If the shuffle is on by default, shuffle the songs and\n switch to the shuffled song.\n */\n if (userConfig.shuffle_on != undefined && userConfig.shuffle_on) {\n config.shuffle_on = true;\n Shuffler.shuffleSongs();\n\n AudioNavigation.changeSong(config.shuffle_list[0], 0);\n }\n\n /*\n\t\t\tAllows the user to set whether they want to continue to the next song\n\t\t\twhen the current song finishes or not. In any scenario that's not a playlist,\n\t\t\tcontining to the next song may not be desired.\n\t\t*/\n config.continue_next =\n userConfig.continue_next != undefined ? userConfig.continue_next : true;\n\n /*\n\t\t\tIf the user defined a playback speed, we copy over their\n\t\t\tpreference here, otherwise we default to normal playback\n\t\t\tspeed of 1.0.\n\t\t*/\n config.playback_speed =\n userConfig.playback_speed != undefined ? userConfig.playback_speed : 1.0;\n\n /*\n\t\t\tSets the audio playback speed.\n\t\t*/\n Core.setPlaybackSpeed(config.playback_speed);\n\n /*\n\t\t\tIf the user wants the song to be pre-loaded for instant\n\t\t\tplayback, they set it to true. By default it's set to just\n\t\t\tload the metadata.\n\t\t*/\n config.audio.preload =\n userConfig.preload != undefined ? userConfig.preload : \"auto\";\n\n /*\n\t\t\tInitializes the user defined callbacks. This should be a JSON\n\t\t\tobject that contains a key->value store of the callback name\n\t\t\tand the name of the function the user needs to call.\n\t\t*/\n config.callbacks =\n userConfig.callbacks != undefined ? userConfig.callbacks : {};\n\n /*\n\t\t\tInitializes the user defined key bindings. This should be a JSON\n\t\t\tobject that contains a key->value store of the key event number\n\t\t\tpressed and the method to be run.\n\t\t*/\n config.bindings =\n userConfig.bindings != undefined ? userConfig.bindings : {};\n\n /*\n\t\t\tThe user can define a starting volume in a range of 0-100 with\n\t\t\t0 being muted and 100 being the loudest. After the config is set\n\t\t\tAmplitude sets the active song's volume to the volume defined\n\t\t\tby the user.\n\t\t*/\n config.volume = userConfig.volume != undefined ? userConfig.volume : 50;\n\n /*\n\t\t\tSets the delay between songs if the user has it set. This should be in MS.\n\t\t*/\n config.delay = userConfig.delay != undefined ? userConfig.delay : 0;\n\n /*\n\t\t\tThe user can set the volume increment and decrement values between 1 and 100\n\t\t\tfor when the volume up or down button is pressed. The default is an increase\n\t\t\tor decrease of 5.\n\t\t*/\n config.volume_increment =\n userConfig.volume_increment != undefined\n ? userConfig.volume_increment\n : 5;\n\n config.volume_decrement =\n userConfig.volume_decrement != undefined\n ? userConfig.volume_decrement\n : 5;\n\n /*\n\t\t\tSet the volume to what is defined in the config. The user can define this,\n\t\t\tso we should set it up that way.\n\t\t*/\n Core.setVolume(config.volume);\n\n /*\n Set default artwork, if specified\n */\n setArt(userConfig)\n\n /*\n Initialize the visual elements\n */\n initializeElements();\n\n /*\n\t\t\tIf the user has selected a starting playlist, we need to set the starting playlist\n\t\t\tand sync the visuals\n\t\t*/\n if (\n userConfig.starting_playlist != undefined &&\n userConfig.starting_playlist != \"\"\n ) {\n /*\n\t\t\t\tSet the active playlist to the starting playlist by the user\n\t\t\t*/\n config.active_playlist = userConfig.starting_playlist;\n\n /*\n\t\t\t\tCheck if the user defined a song to start with in the playlist.\n\t\t\t*/\n if (\n userConfig.starting_playlist_song != undefined &&\n userConfig.starting_playlist_song != \"\"\n ) {\n /*\n\t\t\t\t\tEnsure the song is a valid index.\n\t\t\t\t*/\n if (\n typeof userConfig.playlists[userConfig.starting_playlist].songs[\n parseInt(userConfig.starting_playlist_song)\n ] != undefined\n ) {\n /*\n\t\t\t\t\t\tSet the player to the song defined by the user.\n\t\t\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[\n parseInt(userConfig.starting_playlist_song)\n ],\n parseInt(userConfig.starting_playlist_song)\n );\n } else {\n /*\n\t\t\t\t\t\tSet the player to the first song in the playlist\n\t\t\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[0],\n 0\n );\n /*\n\t\t\t\t\t\tDebug that the song index doesn't exist\n\t\t\t\t\t*/\n Debug.writeMessage(\n \"The index of \" +\n userConfig.starting_playlist_song +\n \" does not exist in the playlist \" +\n userConfig.starting_playlist\n );\n }\n } else {\n /*\n\t\t\t\t\tSet the player to the first song in the playlist\n\t\t\t\t*/\n AudioNavigation.changeSong(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[0],\n 0\n );\n }\n\n /*\n\t\t\t\tSync the main and song play pause buttons.\n\t\t\t*/\n PlayPauseElements.sync();\n }\n\n /*\n\t\t\tRun after init callback\n\t\t*/\n Callbacks.run(\"initialized\");\n }\n\n /**\n * Sets the default_album_art and default_playlist_art from the\n * user supplied configuration.\n *\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function setArt(userConfig){\n /*\n If the user defines default album art, this image will display if the active\n song doesn't have album art defined.\n */\n if (userConfig.default_album_art != undefined) {\n config.default_album_art = userConfig.default_album_art;\n } else {\n config.default_album_art = \"\";\n }\n\n /*\n\t\t\tIf the user defines default playlist art, this image will display if the user\n\t\t\ttries to set up a playlist meta data image tag but doesn't have one defined.\n\t\t*/\n if (userConfig.default_playlist_art != undefined) {\n config.default_playlist_art = userConfig.default_playlist_art;\n } else {\n config.default_playlist_art = \"\";\n }\n }\n\n /**\n * Initializes all of the elements on the page to the default starting point\n * to build from there.\n *\n * @access private\n */\n function initializeElements() {\n /*\n\t\t\tVisually sync the shuffle statuses\n\t\t*/\n ShuffleElements.syncMain();\n\n /*\n\t\t\tSync Mute Elements.\n\t\t*/\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\tSync Volume Slider Elements\n\t\t*/\n VolumeSliderElements.sync();\n\n /*\n\t\t\tSyncs all of the playback speed elements.\n\t\t*/\n PlaybackSpeedElements.sync();\n\n /*\n\t\t\tSyncs all of the visual time elements to 00.\n\t\t*/\n TimeElements.resetCurrentTimes();\n\n /*\n\t\t\tSets all of the play pause buttons to pause.\n\t\t*/\n PlayPauseElements.syncToPause();\n\n /*\n\t\t\tSets the meta data for the songs automatically.\n\t\t*/\n MetaDataElements.syncMetaData();\n\n /*\n\t\t\tSets the repeat buttons automatically.\n\t\t*/\n RepeatElements.syncRepeatSong();\n }\n\n /**\n * Counts the number of playlists the user has configured. This ensures\n * that the user has at least 1 playlist so we can validate the songs\n * defined in the playlist are correct and they didn't enter an invalid\n * ID.\n *\n * @access private\n * @param {object} playlists \t-\n */\n function countPlaylists(playlists) {\n /*\n\t\t\tInitialize the placeholders to iterate through the playlists\n\t\t\tand find out how many we have to account for.\n\t\t*/\n let size = 0,\n key;\n\n /*\n\t\t\tIterate over playlists and if the user has the playlist defined,\n\t\t\tincrement the size of playlists.\n\t\t*/\n for (key in playlists) {\n if (playlists.hasOwnProperty(key)) {\n size++;\n }\n }\n\n /*\n\t\t\tDebug how many playlists are in the config.\n\t\t*/\n Debug.writeMessage(\"You have \" + size + \" playlist(s) in your config\");\n\n /*\n\t\t\tReturn the number of playlists in the config.\n\t\t*/\n return size;\n }\n\n /**\n * Intializes the default live settings for all of the songs.\n *\n * @access private\n */\n function initializeDefaultLiveSettings() {\n for (let i = 0; i < config.songs.length; i++) {\n if (config.songs[i].live == undefined) {\n config.songs[i].live = false;\n }\n }\n }\n\n /** \n * Initializes the index of the song in the songs array so\n * we can reference it if needed\n * \n * @access private\n */\n function initializeDefaultSongIndexes(){\n for (let i = 0; i < config.songs.length; i++) {\n config.songs[i].index = i;\n }\n }\n\n\n /*\n\t\tReturns the publicly accessible methods\n\t*/\n return {\n initialize: initialize,\n setConfig: setConfig,\n rebindDisplay: rebindDisplay\n };\n})();\n\nexport default Initializer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/init/init.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Builds a waveform for the current audio.\n * Help from: https://robots.thoughtbot.com/javascript-audio-api\n * https://stackoverflow.com/questions/21347833/html-svg-not-drawing-works-in-other-pages\n */\nlet WaveForm = (function() {\n /*\n Initialize the local variables used in the Waveform.\n */\n let buffer = \"\";\n let sampleRate = config.waveforms.sample_rate;\n let peaks = \"\";\n\n function init() {\n /*\n Grabs all of the waveform elements on the page.\n */\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n\n /*\n If there are waveforms, we iterate over them and set them up to display\n properly.\n */\n if (waveforms.length > 0) {\n /*\n Iterate over all of the waveforms and build the SVG parts.\n */\n for (let i = 0; i < waveforms.length; i++) {\n /*\n Clear the inner HTML of the element if we are replacing the waveform.\n */\n waveforms[i].innerHTML = \"\";\n\n /*\n Inserts an SVG into the element.\n */\n let svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"viewBox\", \"0 -1 \" + sampleRate + \" 2\");\n svg.setAttribute(\"preserveAspectRatio\", \"none\");\n\n /*\n Add a g component to the SVG\n */\n let g = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svg.appendChild(g);\n\n /*\n Add a path component to the g\n */\n let path = document.createElementNS(\n \"http://www.w3.org/2000/svg\",\n \"path\"\n );\n path.setAttribute(\"d\", \"\");\n path.setAttribute(\"id\", \"waveform\");\n\n g.appendChild(path);\n\n /*\n Append the SVG to the waveform.\n */\n waveforms[i].appendChild(svg);\n }\n }\n }\n\n /**\n * Builds each waveform for the page.\n */\n function build() {\n if (config.web_audio_api_available) {\n /*\n If we don't have the wave form built, we need to build the waveform by loading\n the src with an array buffer.\n */\n if (\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ] == undefined\n ) {\n /*\n Initializes a new XML Http Request.\n */\n var req = new XMLHttpRequest();\n\n /*\n Opens the src parameter for the audio file to read in.\n */\n req.open(\"GET\", config.audio.src, true);\n req.responseType = \"arraybuffer\";\n\n /*\n When the ready state changes, check to see if we can render the\n wave form.\n */\n req.onreadystatechange = function(e) {\n /*\n When the request is complete, then we begin decoding the\n audio to build the waveform.\n */\n if (req.readyState == 4) {\n /*\n If the status is 200 means the response is a success and\n we decode the audio data.\n */\n if (req.status == 200) {\n /*\n Decode the audio data and process the waveform.\n */\n config.context.decodeAudioData(req.response, function(\n bufferedAudio\n ) {\n /*\n Set the buffer to the audio returned.\n */\n buffer = bufferedAudio;\n\n /*\n Get the peaks in the audio.\n */\n peaks = getPeaks(sampleRate, buffer);\n\n /*\n Build the SVG\n */\n process(sampleRate, buffer, peaks);\n });\n }\n }\n };\n req.send();\n } else {\n /*\n If we already have a waveform, we grab the waveform that\n was created for the song and display it. We do a simple hash\n of the song URL so it's already unique.\n */\n displayWaveForms(\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ]\n );\n }\n }\n }\n\n /**\n * Processes the audio and generates the waveform.\n *\n * @param {sampleRate} sampleRate - The rate we should sample the audio.\n * @param {arraybuffer} buffer - The Web Audio API\n * @param {array} peaks - The peaks in the audio.\n */\n function process(sampleRate, buffer, peaks) {\n /*\n If we have a buffer, we find the peaks in the audio.\n */\n if (buffer) {\n /*\n Get the total peaks in the song.\n */\n let totalPeaks = peaks.length;\n\n /*\n Figure out the depth of the peak.\n */\n let d = \"\";\n for (let peakNumber = 0; peakNumber < totalPeaks; peakNumber++) {\n if (peakNumber % 2 === 0) {\n d += ` M${~~(peakNumber / 2)}, ${peaks.shift()}`;\n } else {\n d += ` L${~~(peakNumber / 2)}, ${peaks.shift()}`;\n }\n }\n\n /*\n Add the waveform to the built waveforms array.\n */\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ] = d;\n\n /*\n Display the waveform.\n */\n displayWaveForms(\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ]\n );\n }\n }\n\n /**\n * Get the peaks of the audio for the waveform.\n *\n * @param {number} length - The sample size of the audio.\n * @param {array} buffer - The array buffer used to find the peaks in the audio.\n */\n function getPeaks(length, buffer) {\n /*\n Set the parameters needed to build the SVG.\n */\n const sampleSize = buffer.length / length;\n const sampleStep = ~~(sampleSize / 10) || 1;\n const numberOfChannels = buffer.numberOfChannels;\n const mergedPeaks = [];\n\n /*\n Iterate over the channels and find the peaks.\n */\n for (\n let channelNumber = 0;\n channelNumber < numberOfChannels;\n channelNumber++\n ) {\n /*\n Initialize the peaks array and set the channel data to what\n the buffer has in its channel data.\n */\n const peaks = [];\n const channelData = buffer.getChannelData(channelNumber);\n\n /*\n Iterate over peaks with respect to the sample size.\n */\n for (let peakNumber = 0; peakNumber < length; peakNumber++) {\n /*\n Gt the start and end peak.\n */\n const start = ~~(peakNumber * sampleSize);\n const end = ~~(start + sampleSize);\n\n /*\n Set min and max to the channel data first peak.\n */\n let min = channelData[0];\n let max = channelData[0];\n\n /*\n Iterate over the parts of the song starting to the\n ending to display the waveform.\n */\n for (\n let sampleIndex = start;\n sampleIndex < end;\n sampleIndex += sampleStep\n ) {\n const value = channelData[sampleIndex];\n\n if (value > max) {\n max = value;\n }\n if (value < min) {\n min = value;\n }\n }\n\n /*\n Set the max and min for the peak.\n */\n peaks[2 * peakNumber] = max;\n peaks[2 * peakNumber + 1] = min;\n\n /*\n Merge the peaks\n */\n if (channelNumber === 0 || max > mergedPeaks[2 * peakNumber]) {\n mergedPeaks[2 * peakNumber] = max;\n }\n\n if (channelNumber === 0 || min < mergedPeaks[2 * peakNumber + 1]) {\n mergedPeaks[2 * peakNumber + 1] = min;\n }\n }\n }\n\n /*\n Returns the merged peaks.\n */\n return mergedPeaks;\n }\n\n /**\n * Displays all of the waveforms necessary.\n *\n * @param {path} svg - The drawing of the waveform.\n */\n function displayWaveForms(svg) {\n let waveformElements = document.querySelectorAll(\".amplitude-wave-form\");\n\n /*\n Iterate over all of the waveform elements and\n display the waveform.\n */\n for (let i = 0; i < waveformElements.length; i++) {\n /*\n Get the playlist attribute of the waveform element.\n */\n let playlist = waveformElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Get the song index attribute of the waveform element.\n */\n let song = waveformElements[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n If the playlist is null and the song is null it's a global element.\n */\n if (playlist == null && song == null) {\n displayGlobalWaveform(waveformElements[i], svg);\n }\n\n /*\n If the playlist is defined but the song is null it's a playlist element.\n */\n if (playlist != null && song == null) {\n displayPlaylistWaveform(waveformElements[i], svg, playlist);\n }\n\n /*\n If the playlist is not defined and the song is not null it's a song\n element.\n */\n if (playlist == null && song != null) {\n displaySongWaveform(waveformElements[i], svg, song);\n }\n\n /*\n If the playlist and song are defined it's a song in the playlist element.\n */\n if (playlist != null && song != null) {\n displaySongInPlaylistWaveform(waveformElements[i], svg, playlist, song);\n }\n }\n }\n\n /**\n * Displays a global wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n */\n function displayGlobalWaveform(element, svg) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n\n /**\n * Displays a playlist wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {string} playlist - The playlist we are displaying the waveform for.\n */\n function displayPlaylistWaveform(element, svg, playlist) {\n /*\n Ensure the playlist is the active playlist.\n */\n if (config.active_playlist == playlist) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Displays a song wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {Integer} song - The index of the song we are displaying the\n * waveform for.\n */\n function displaySongWaveform(element, svg, song) {\n /*\n Ensure it's the active song being displayed.\n */\n if (config.active_index == song) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Displays a song in playlist waveform.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {String} playlist - The playlist the waveform is in.\n * @param {Integer} song - The index of the song we are displaying the waveform for.\n */\n function displaySongInPlaylistWaveform(element, svg, playlist, song) {\n /*\n Ensure it's the active song in the active playlist.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[config.active_playlist].active_index == song\n ) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Determines if the user is using waveforms\n */\n function determineIfUsingWaveforms(){\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n\n if( waveforms.length > 0 ){\n return true;\n }else{\n return false;\n }\n }\n\n /*\n Return the public methods.\n */\n return {\n init: init,\n build: build,\n determineIfUsingWaveforms: determineIfUsingWaveforms\n };\n})();\n\nexport default WaveForm;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/waveform.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * The utility to handle the computation of time in AmplitudeJS.\n * @module utilities/Time\n */\nlet Time = (function() {\n /**\n * Computes the current song time. Breaks down where the song is into\n * hours, minutes, seconds and formats it to be displayed to the user.\n *\n * @access public\n */\n function computeCurrentTimes() {\n /*\n\t\t\tInitialize the current time object that will be returned.\n\t\t*/\n let currentTime = {};\n\n /*\n\t\t\tComputes the current seconds for the song.\n\t\t*/\n let currentSeconds =\n (Math.floor(config.audio.currentTime % 60) < 10 ? \"0\" : \"\") +\n Math.floor(config.audio.currentTime % 60);\n\n /*\n\t\t\tComputes the current minutes for the song.\n\t\t*/\n let currentMinutes = Math.floor(config.audio.currentTime / 60);\n\n /*\n\t\t\tInitialize the current hours variable.\n\t\t*/\n let currentHours = \"00\";\n\n /*\n\t\t\tIf the current minutes is less than 10, we add a leading 0.\n\t\t*/\n if (currentMinutes < 10) {\n currentMinutes = \"0\" + currentMinutes;\n }\n\n /*\n\t\t\tIf the user is more than 60 minutes into the song, then\n\t\t\twe extract the hours.\n\t\t*/\n if (currentMinutes >= 60) {\n currentHours = Math.floor(currentMinutes / 60);\n currentMinutes = currentMinutes % 60;\n\n /*\n\t\t\t\tIf the user is less than 10 minutes in, we append the\n\t\t\t\tadditional 0 to the minutes.\n\t\t\t*/\n if (currentMinutes < 10) {\n currentMinutes = \"0\" + currentMinutes;\n }\n }\n\n /*\n\t\t\tBuild a clean current time object and send back the appropriate information.\n\t\t*/\n currentTime.seconds = currentSeconds;\n currentTime.minutes = currentMinutes;\n currentTime.hours = currentHours;\n\n return currentTime;\n }\n\n /**\n * Computes the current song duration. Breaks down where the song is into\n * hours, minutes, seconds and formats it to be displayed to the user.\n *\n * @access public\n */\n function computeSongDuration() {\n /*\n\t\t\tInitialize the song duration object that will be returned.\n\t\t*/\n let songDuration = {};\n\n /*\n\t\t\tComputes the duration of the song's seconds.\n\t\t*/\n let songDurationSeconds =\n (Math.floor(config.audio.duration % 60) < 10 ? \"0\" : \"\") +\n Math.floor(config.audio.duration % 60);\n\n /*\n\t\t\tComputes the duration of the song's minutes.\n\t\t*/\n let songDurationMinutes = Math.floor(config.audio.duration / 60);\n\n /*\n\t\t\tInitialize the hours duration variable.\n\t\t*/\n var songDurationHours = \"00\";\n\n /*\n\t\t\tIf the song duration minutes is less than 10, we add a leading 0.\n\t\t*/\n if (songDurationMinutes < 10) {\n songDurationMinutes = \"0\" + songDurationMinutes;\n }\n\n /*\n\t\t\tIf there is more than 60 minutes in the song, then we\n\t\t\textract the hours.\n\t\t*/\n if (songDurationMinutes >= 60) {\n songDurationHours = Math.floor(songDurationMinutes / 60);\n songDurationMinutes = songDurationMinutes % 60;\n\n /*\n\t\t\t\tIf the song duration minutes is less than 10 we append\n\t\t\t\tthe additional 0.\n\t\t\t*/\n if (songDurationMinutes < 10) {\n songDurationMinutes = \"0\" + songDurationMinutes;\n }\n }\n\n /*\n\t\t\tBuild a clean song duration object and send back the appropriate information.\n\t\t*/\n songDuration.seconds = isNaN(songDurationSeconds)\n ? \"00\"\n : songDurationSeconds;\n songDuration.minutes = isNaN(songDurationMinutes)\n ? \"00\"\n : songDurationMinutes;\n songDuration.hours = isNaN(songDurationHours)\n ? \"00\"\n : songDurationHours.toString();\n\n return songDuration;\n }\n\n /**\n * Computes the song completion percentage.\n *\n * @access public\n */\n function computeSongCompletionPercentage() {\n return (config.audio.currentTime / config.audio.duration) * 100;\n }\n\n /**\n * Sets the current time for the audio.\n *\n * @access public\n */\n function setCurrentTime(time) {\n /*\n If the song is not live, we can set the current time.\n */\n if (!config.active_metadata.live) {\n /*\n Makes sure the number is finite to set the time.\n */\n if (isFinite(time)) {\n config.audio.currentTime = time;\n }\n }\n }\n\n /**\n * Defines what is returned by the module\n */\n return {\n computeCurrentTimes: computeCurrentTimes,\n computeSongDuration: computeSongDuration,\n computeSongCompletionPercentage: computeSongCompletionPercentage,\n setCurrentTime: setCurrentTime\n };\n})();\n\nexport default Time;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/time.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Visual Handler for Buffered Progress Elements\n *\n * @module visual/BufferedProgressElements\n */\nlet BufferedProgressElements = (function() {\n /**\n * Syncs the buffered progress bars to the current percentage in the config\n *\n * @access public\n */\n function sync() {\n syncGlobal();\n syncPlaylist();\n syncSong();\n syncSongInPlaylist();\n }\n\n /**\n * Sync the global song buffered progress elements.\n */\n function syncGlobal() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBars = document.getElementsByClassName(\n \"amplitude-buffered-progress\"\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBars.length; i++) {\n let playlist = songBufferedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = songBufferedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && song == null) {\n songBufferedProgressBars[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the playlist song buffered progress elements.\n */\n function syncPlaylist() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsPlaylist = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsPlaylist.length; i++) {\n let song = songBufferedProgressBarsPlaylist[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (song == null) {\n songBufferedProgressBarsPlaylist[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the song song buffered progress elements.\n */\n function syncSong() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsSongs = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsSongs.length; i++) {\n let playlist = songBufferedProgressBarsSongs[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n songBufferedProgressBarsSongs[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the song in playlist song buffered progress elements.\n */\n function syncSongInPlaylist() {\n let activePlaylistIndex =\n config.active_playlist != null && config.active_playlist != \"\"\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsSongsInPlaylist = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsSongsInPlaylist.length; i++) {\n songBufferedProgressBarsSongsInPlaylist[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n\n /**\n * Sets all of the song buffered progress bars to 0\n *\n * @access public\n */\n function reset() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n let songBufferedProgressBars = document.getElementsByClassName(\n \"amplitude-buffered-progress\"\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBars.length; i++) {\n songBufferedProgressBars[i].value = 0;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n reset: reset\n };\n})();\n\nexport default BufferedProgressElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/bufferedProgressElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the Callback Utility\n * @module utilities/callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * AmplitudeJS Ended Module. Handles the ended event on the audio.\n *\n * @module events/Ended\n */\nlet Ended = (function() {\n /**\n * When the song has ended, handles what to do next\n *\n * HANDLER FOR: ended\n *\n * @access public\n */\n function handle() {\n /*\n Sets the time out for song ended. This determines if\n we should go to the next song or delay between songs.\n */\n setTimeout(function() {\n /*\n If we continue next, we should move to the next song in the playlist.\n */\n if (config.continue_next) {\n /*\n\t\t\t\t\tIf the active playlist is not set, we set the\n\t\t\t\t\tnext song that's in the songs array.\n\t\t\t\t*/\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext(true);\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist, true);\n }\n } else {\n if (!config.is_touch_moving) {\n /*\n\t\t\t\t\t\tStops the active song.\n\t\t\t\t\t*/\n AmplitudeCore.stop();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n }, config.delay);\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Ended;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/ended.js","/*\n\tImport the necessary classes and config to use\n\twith the events.\n*/\nimport config from \"../config.js\";\n\n/**\n * Imports all of the handler objects used by the events.\n */\nimport KeyDown from \"./keydown.js\";\nimport TimeUpdate from \"./timeUpdate.js\";\nimport Ended from \"./ended.js\";\nimport Progress from \"./progress.js\";\nimport Play from \"./play.js\";\nimport Pause from \"./pause.js\";\nimport PlayPause from \"./playPause.js\";\nimport Stop from \"./stop.js\";\nimport Mute from \"./mute.js\";\nimport VolumeUp from \"./volumeUp.js\";\nimport VolumeDown from \"./volumeDown.js\";\nimport SongSlider from \"./songSlider.js\";\nimport VolumeSlider from \"./volumeSlider.js\";\nimport Next from \"./next.js\";\nimport Prev from \"./prev.js\";\nimport Repeat from \"./repeat.js\";\nimport RepeatSong from \"./repeatSong.js\";\nimport PlaybackSpeed from \"./playbackSpeed.js\";\nimport Shuffle from \"./shuffle.js\";\nimport SkipTo from \"./skipTo.js\";\nimport WaveForm from \"../fx/waveform.js\";\n\n/**\n * Imports the utility classes used by the evnets.\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Events Module. Handles all of the events we listen to in\n * AmplitudeJS.\n *\n * @module events/Events\n */\nvar Events = (function() {\n /**\n * Initializes the handlers for the events listened to by Amplitude\n *\n * @access public\n */\n function initialize() {\n /*\n\t\t\tWrite out debug message\n\t\t*/\n Debug.writeMessage(\"Beginning initialization of event handlers..\");\n\n /*\n\t\t\tSets flag that the screen is moving and not a tap\n\t\t*/\n document.addEventListener(\"touchmove\", function() {\n config.is_touch_moving = true;\n });\n\n /*\n\t\t\tOn touch end if it was a touch move event, set moving to\n\t\t\tfalse\n\t\t*/\n document.addEventListener(\"touchend\", function() {\n if (config.is_touch_moving) {\n config.is_touch_moving = false;\n }\n });\n\n /*\n\t\t\tOn time update for the audio element, update visual displays that\n\t\t\trepresent the time on either a visualized element or time display.\n\t\t*/\n bindTimeUpdate();\n\n /*\n\t\t\tBinds key down event handlers for matching key codes to functions.\n\t\t*/\n bindKeyDownEventHandlers();\n\n /*\n\t\t\tWhen the audio element has ended playing, we handle the song\n\t\t\tending. In a single song or multiple modular song instance,\n\t\t\tthis just synchronizes the visuals for time and song time\n\t\t\tvisualization, but for a playlist it determines whether\n\t\t\tit should play the next song or not.\n\t\t*/\n bindSongEnded();\n\n /*\n\t\t\tBinds progress event so we can see how much of the song is loaded.\n\t\t*/\n bindProgress();\n\n /*\n\t\t\tBinds 'amplitude-play' event handlers\n\t\t*/\n bindPlay();\n\n /*\n\t\t\tBinds 'amplitude-pause' event handlers.\n\t\t*/\n bindPause();\n\n /*\n\t\t\tBinds 'amplitude-play-pause' event handlers.\n\t\t*/\n bindPlayPause();\n\n /*\n\t\t\tBinds 'amplitude-stop' event handlers.\n\t\t*/\n bindStop();\n\n /*\n\t\t\tBinds 'amplitude-mute' event handlers.\n\t\t*/\n bindMute();\n\n /*\n\t\t\tBinds 'amplitude-volume-up' event handlers\n\t\t*/\n bindVolumeUp();\n\n /*\n\t\t\tBinds 'amplitude-volume-down' event handlers\n\t\t*/\n bindVolumeDown();\n\n /*\n\t\t\tBinds 'amplitude-song-slider' event handlers\n\t\t*/\n bindSongSlider();\n\n /*\n\t\t\tBinds 'amplitude-volume-slider' event handlers.\n\t\t*/\n bindVolumeSlider();\n\n /*\n\t\t\tBinds 'amplitude-next' event handlers.\n\t\t*/\n bindNext();\n\n /*\n\t\t\tBinds 'amplitude-prev' event handlers.\n\t\t*/\n bindPrev();\n\n /*\n\t\t\tBinds 'amplitude-shuffle' event handlers.\n\t\t*/\n bindShuffle();\n\n /*\n\t\t\tBinds 'amplitude-repeat' event handlers.\n\t\t*/\n bindRepeat();\n\n /*\n\t\t\tBinds 'amplitude-repeat-song' event handlers.\n\t\t*/\n bindRepeatSong();\n\n /*\n\t\t\tBinds 'amplitude-playback-speed' event handlers.\n\t\t*/\n bindPlaybackSpeed();\n\n /*\n\t\t\tBinds 'amplitude-skip-to' event handlers.\n\t\t*/\n bindSkipTo();\n\n /*\n\t\t\tBinds `canplaythrough` event to build the waveform.\n\t\t*/\n bindCanPlayThrough();\n }\n\n /**\n * On time update for the audio element, update visual displays that\n * represent the time on either a visualized element or time display.\n *\n * @access private\n */\n function bindTimeUpdate() {\n /*\n\t\t\tBind for time update\n\t\t*/\n config.audio.removeEventListener(\"timeupdate\", TimeUpdate.handle);\n config.audio.addEventListener(\"timeupdate\", TimeUpdate.handle);\n\n /*\n\t\t\tBind for duration change\n\t\t*/\n config.audio.removeEventListener(\"durationchange\", TimeUpdate.handle);\n config.audio.addEventListener(\"durationchange\", TimeUpdate.handle);\n }\n\n /**\n * On keydown, we listen to what key got pressed so we can map the key to\n * a function. This allows the user to map pause and play, next, etc. to key\n * presses.\n *\n * @access private\n */\n function bindKeyDownEventHandlers() {\n document.removeEventListener(\"keydown\", KeyDown.handle);\n document.addEventListener(\"keydown\", KeyDown.handle);\n }\n\n /**\n * When the audio element has ended playing, we handle the song\n * ending. In a single song or multiple modular song instance,\n * this just synchronizes the visuals for time and song time\n * visualization, but for a playlist it determines whether\n * it should play the next song or not.\n *\n * @access private\n */\n function bindSongEnded() {\n config.audio.removeEventListener(\"ended\", Ended.handle);\n config.audio.addEventListener(\"ended\", Ended.handle);\n }\n\n /**\n * As the audio is loaded, the progress event gets fired. We bind into this\n * to grab the buffered percentage of the song. We can then add more elements\n * to show the buffered amount.\n *\n * @access private\n */\n function bindProgress() {\n config.audio.removeEventListener(\"progress\", Progress.handle);\n config.audio.addEventListener(\"progress\", Progress.handle);\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS play buttons\n *\n * @access private\n */\n function bindPlay() {\n /*\n\t\t\tGets all of the elements with the class amplitude-play\n\t\t*/\n var play_classes = document.getElementsByClassName(\"amplitude-play\");\n\n /*\n\t\t\tIterates over all of the play classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < play_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n play_classes[i].removeEventListener(\"touchend\", Play.handle);\n play_classes[i].addEventListener(\"touchend\", Play.handle);\n } else {\n play_classes[i].removeEventListener(\"click\", Play.handle);\n play_classes[i].addEventListener(\"click\", Play.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS pause buttons.\n *\n * @access private\n */\n function bindPause() {\n /*\n\t\t\tGets all of the elements with the class amplitude-pause\n\t\t*/\n var pause_classes = document.getElementsByClassName(\"amplitude-pause\");\n\n /*\n\t\t\tIterates over all of the pause classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < pause_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n pause_classes[i].removeEventListener(\"touchend\", Pause.handle);\n pause_classes[i].addEventListener(\"touchend\", Pause.handle);\n } else {\n pause_classes[i].removeEventListener(\"click\", Pause.handle);\n pause_classes[i].addEventListener(\"click\", Pause.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS play pause buttons\n *\n * @access private\n */\n function bindPlayPause() {\n /*\n\t\t\tGets all of the elements with the class amplitude-play-pause\n\t\t*/\n var play_pause_classes = document.getElementsByClassName(\n \"amplitude-play-pause\"\n );\n\n /*\n\t\t\tIterates over all of the play/pause classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < play_pause_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n play_pause_classes[i].removeEventListener(\"touchend\", PlayPause.handle);\n play_pause_classes[i].addEventListener(\"touchend\", PlayPause.handle);\n } else {\n play_pause_classes[i].removeEventListener(\"click\", PlayPause.handle);\n play_pause_classes[i].addEventListener(\"click\", PlayPause.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS stop buttons\n *\n * @access private\n */\n function bindStop() {\n /*\n\t\t\tGets all of the elements with the class amplitude-stop\n\t\t*/\n var stop_classes = document.getElementsByClassName(\"amplitude-stop\");\n\n /*\n\t\t\tIterates over all of the stop classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < stop_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n stop_classes[i].removeEventListener(\"touchend\", Stop.handle);\n stop_classes[i].addEventListener(\"touchend\", Stop.handle);\n } else {\n stop_classes[i].removeEventListener(\"click\", Stop.handle);\n stop_classes[i].addEventListener(\"click\", Stop.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS mute buttons\n *\n * @access private\n */\n function bindMute() {\n /*\n\t\t\tGets all of the elements with the class amplitue-mute\n\t\t*/\n var mute_classes = document.getElementsByClassName(\"amplitude-mute\");\n\n /*\n\t\t\tIterates over all of the mute classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < mute_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n mute_classes[i].removeEventListener(\"touchend\", Mute.handle);\n mute_classes[i].addEventListener(\"touchend\", Mute.handle);\n }\n } else {\n mute_classes[i].removeEventListener(\"click\", Mute.handle);\n mute_classes[i].addEventListener(\"click\", Mute.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS Volume Up Buttons\n *\n * @access private\n */\n function bindVolumeUp() {\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-up\n\t\t*/\n var volume_up_classes = document.getElementsByClassName(\n \"amplitude-volume-up\"\n );\n\n /*\n\t\t\tIterates over all of the volume up classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < volume_up_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n volume_up_classes[i].removeEventListener(\"touchend\", VolumeUp.handle);\n volume_up_classes[i].addEventListener(\"touchend\", VolumeUp.handle);\n }\n } else {\n volume_up_classes[i].removeEventListener(\"click\", VolumeUp.handle);\n volume_up_classes[i].addEventListener(\"click\", VolumeUp.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS Volume Down Buttons\n *\n * @access private\n */\n function bindVolumeDown() {\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-down\n\t\t*/\n var volume_down_classes = document.getElementsByClassName(\n \"amplitude-volume-down\"\n );\n\n /*\n\t\t\tIterates over all of the volume down classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < volume_down_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n volume_down_classes[i].removeEventListener(\n \"touchend\",\n VolumeDown.handle\n );\n volume_down_classes[i].addEventListener(\n \"touchend\",\n VolumeDown.handle\n );\n }\n } else {\n volume_down_classes[i].removeEventListener(\"click\", VolumeDown.handle);\n volume_down_classes[i].addEventListener(\"click\", VolumeDown.handle);\n }\n }\n }\n\n /**\n * Binds change and input events for AmplitudeJS Song Slider Inputs\n *\n * @access private\n */\n function bindSongSlider() {\n /*\n\t\t\tGets browser so if we need to apply overrides, like we usually\n\t\t\thave to do for anything cool in IE, we can do that.\n\t\t*/\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n /*\n\t\t\tGets all of the elements with the class amplitude-song-slider\n\t\t*/\n var song_sliders = document.getElementsByClassName(\"amplitude-song-slider\");\n\n /*\n\t\t\tIterates over all of the song slider classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is IE we listen to the change event\n\t\t\twhere if it is anything else, it's the input method.\n\t\t*/\n for (var i = 0; i < song_sliders.length; i++) {\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n song_sliders[i].removeEventListener(\"change\", SongSlider.handle);\n song_sliders[i].addEventListener(\"change\", SongSlider.handle);\n } else {\n song_sliders[i].removeEventListener(\"input\", SongSlider.handle);\n song_sliders[i].addEventListener(\"input\", SongSlider.handle);\n }\n }\n }\n\n /**\n * Binds change and input events fro AmplitudeJS Volume Slider inputs\n *\n * @access private\n */\n function bindVolumeSlider() {\n /*\n\t\t\tGets browser so if we need to apply overrides, like we usually\n\t\t\thave to do for anything cool in IE, we can do that.\n\t\t*/\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-slider\n */\n var volume_sliders = document.getElementsByClassName(\n \"amplitude-volume-slider\"\n );\n\n /*\n\t\t\tIterates over all of the volume slider classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is IE we listen to the change event\n\t\t\twhere if it is anything else, it's the input method.\n\t\t*/\n for (var i = 0; i < volume_sliders.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n volume_sliders[i].removeEventListener(\"change\", VolumeSlider.handle);\n volume_sliders[i].addEventListener(\"change\", VolumeSlider.handle);\n } else {\n volume_sliders[i].removeEventListener(\"input\", VolumeSlider.handle);\n volume_sliders[i].addEventListener(\"input\", VolumeSlider.handle);\n }\n }\n }\n }\n\n /**\n * Binds click and touchend events fro AmplitudeJS Next buttons\n *\n * @access private\n */\n function bindNext() {\n /*\n\t\t\tGets all of the elements with the class amplitude-next\n */\n var next_classes = document.getElementsByClassName(\"amplitude-next\");\n\n /*\n\t\t\tIterates over all of the next classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < next_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n next_classes[i].removeEventListener(\"touchend\", Next.handle);\n next_classes[i].addEventListener(\"touchend\", Next.handle);\n } else {\n next_classes[i].removeEventListener(\"click\", Next.handle);\n next_classes[i].addEventListener(\"click\", Next.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS prev buttons.\n *\n * @access private\n */\n function bindPrev() {\n /*\n\t\t\tGets all of the elements with the class amplitude-prev\n\t\t*/\n var prev_classes = document.getElementsByClassName(\"amplitude-prev\");\n\n /*\n\t\t\tIterates over all of the prev classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < prev_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n prev_classes[i].removeEventListener(\"touchend\", Prev.handle);\n prev_classes[i].addEventListener(\"touchend\", Prev.handle);\n } else {\n prev_classes[i].removeEventListener(\"click\", Prev.handle);\n prev_classes[i].addEventListener(\"click\", Prev.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS shuffle buttons.\n *\n * @access private\n */\n function bindShuffle() {\n /*\n\t\t\tGets all of the elements with the class amplitude-shuffle\n\t\t*/\n var shuffle_classes = document.getElementsByClassName(\"amplitude-shuffle\");\n\n /*\n\t\t\tIterates over all of the shuffle classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < shuffle_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the shuffle control.\n\t\t\t*/\n shuffle_classes[i].classList.remove(\"amplitude-shuffle-on\");\n shuffle_classes[i].classList.add(\"amplitude-shuffle-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n shuffle_classes[i].removeEventListener(\"touchend\", Shuffle.handle);\n shuffle_classes[i].addEventListener(\"touchend\", Shuffle.handle);\n } else {\n shuffle_classes[i].removeEventListener(\"click\", Shuffle.handle);\n shuffle_classes[i].addEventListener(\"click\", Shuffle.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS repeat buttons.\n *\n * @access private\n */\n function bindRepeat() {\n /*\n\t\t\tGets all of the elements with the class amplitude-repeat\n\t\t*/\n var repeat_classes = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\tIterates over all of the repeat classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < repeat_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the repeat control.\n\t\t\t*/\n repeat_classes[i].classList.remove(\"amplitude-repeat-on\");\n repeat_classes[i].classList.add(\"amplitude-repeat-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n repeat_classes[i].removeEventListener(\"touchend\", Repeat.handle);\n repeat_classes[i].addEventListener(\"touchend\", Repeat.handle);\n } else {\n repeat_classes[i].removeEventListener(\"click\", Repeat.handle);\n repeat_classes[i].addEventListener(\"click\", Repeat.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS repeat song buttons.\n *\n * @access private\n */\n function bindRepeatSong() {\n /*\n\t\t\tGets all of the elements with the class amplitude-repeat-song\n\t\t*/\n var repeat_song_classes = document.getElementsByClassName(\n \"amplitude-repeat-song\"\n );\n\n /*\n\t\t\tIterates over all of the repeat song classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < repeat_song_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the repeat control.\n\t\t\t*/\n repeat_song_classes[i].classList.remove(\"amplitude-repeat-on\");\n repeat_song_classes[i].classList.add(\"amplitude-repeat-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n repeat_song_classes[i].removeEventListener(\n \"touchend\",\n RepeatSong.handle\n );\n repeat_song_classes[i].addEventListener(\"touchend\", RepeatSong.handle);\n } else {\n repeat_song_classes[i].removeEventListener(\"click\", RepeatSong.handle);\n repeat_song_classes[i].addEventListener(\"click\", RepeatSong.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS playback speed buttons\n *\n * @access private\n */\n function bindPlaybackSpeed() {\n /*\n\t\t\tGets all of the elements with the class amplitude-playback-speed\n\t\t*/\n var playback_speed_classes = document.getElementsByClassName(\n \"amplitude-playback-speed\"\n );\n\n /*\n\t\t\tIterates over all of the playback speed classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < playback_speed_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n playback_speed_classes[i].removeEventListener(\n \"touchend\",\n PlaybackSpeed.handle\n );\n playback_speed_classes[i].addEventListener(\n \"touchend\",\n PlaybackSpeed.handle\n );\n } else {\n playback_speed_classes[i].removeEventListener(\n \"click\",\n PlaybackSpeed.handle\n );\n playback_speed_classes[i].addEventListener(\n \"click\",\n PlaybackSpeed.handle\n );\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS skip to buttons.\n *\n * @access private\n */\n function bindSkipTo() {\n /*\n\t\t\tGets all of the skip to elements with the class 'amplitude-skip-to'\n\t\t*/\n var skipToClasses = document.getElementsByClassName(\"amplitude-skip-to\");\n\n /*\n\t\t\tIterates over all of the skip to classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it's a click.\n\t\t*/\n for (var i = 0; i < skipToClasses.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n skipToClasses[i].removeEventListener(\"touchend\", SkipTo.handle);\n skipToClasses[i].addEventListener(\"touchend\", SkipTo.handle);\n } else {\n skipToClasses[i].removeEventListener(\"click\", SkipTo.handle);\n skipToClasses[i].addEventListener(\"click\", SkipTo.handle);\n }\n }\n }\n\n /**\n * Binds can play through to a song.\n *\n * @access private\n */\n function bindCanPlayThrough() {\n if( WaveForm.determineIfUsingWaveforms() ){\n config.audio.removeEventListener(\"canplaythrough\", WaveForm.build);\n config.audio.addEventListener(\"canplaythrough\", WaveForm.build);\n }\n }\n\n /*\n\t\tReturns the public facing functions.\n\t*/\n return {\n initialize: initialize\n };\n})();\n\nexport default Events;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/events.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the core of AmplitudeJS\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Shuffle Utility\n * @module utilities/Shuffle\n */\nimport Shuffle from \"../utilities/shuffler.js\";\n\n/**\n * Imports the Repeater Utility\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the Repeat Elements Visual Handler\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * Imports the Play Pause Elements Visual Handler\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * AmplitudeJS Key Down event handler\n *\n * @module events/KeyDown\n */\nlet KeyDown = (function() {\n /**\n * When the keydown event is fired, we determine which function should be run\n * based on what was passed in.\n *\n * HANDLER FOR: keydown\n *\n * @access public\n * @prop {object} event The event object being passed in.\n */\n function handle(event) {\n runKeyEvent(event.which);\n }\n\n /**\n * Runs an event on key down\n *\n * @access public\n * @param {number} key \t- The key code the event is bound to.\n */\n function runKeyEvent(key) {\n /*\n\t\t\tChecks to see if the user bound an event to the code pressed.\n\t\t*/\n if (config.bindings[key] != undefined) {\n /*\n\t\t\t\tDetermine which event should be run if bound.\n\t\t\t*/\n switch (config.bindings[key]) {\n /*\n\t\t\t\t\tFires a play pause event.\n\t\t\t\t*/\n case \"play_pause\":\n runPlayPauseKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a next event.\n\t\t\t\t*/\n case \"next\":\n runNextKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a previous event.\n\t\t\t\t*/\n case \"prev\":\n runPrevKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a stop event.\n\t\t\t\t*/\n case \"stop\":\n runStopKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a shuffle event.\n\t\t\t\t*/\n case \"shuffle\":\n runShuffleKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a repeat event.\n\t\t\t\t*/\n case \"repeat\":\n runRepeatKeyDownEvent();\n break;\n }\n }\n }\n\n /**\n * Runs the play pause method for key down.\n */\n function runPlayPauseKeyDownEvent() {\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Runs the next method for key down.\n */\n function runNextKeyDownEvent() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Runs the previous method for key down.\n */\n function runPrevKeyDownEvent() {\n /*\n Check to see if the current playlist has been set\n or null and set the previous song.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setPrev();\n } else {\n AudioNavigation.setPrevPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Runs the stop method for key down.\n */\n function runStopKeyDownEvent() {\n /*\n Syncs all of the play pause elements to pause.\n */\n PlayPauseElements.syncToPause();\n\n /*\n Stops the active song.\n */\n Core.stop();\n }\n\n /**\n * Runs the shuffle method for key down.\n */\n function runShuffleKeyDownEvent() {\n /*\n Check to see if the current playlist has been set\n or null and set the previous song.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n Shuffle.toggleShuffle();\n } else {\n Shuffle.toggleShufflePlaylist(config.active_playlist);\n }\n }\n\n /**\n * Run the repeat method for key down.\n */\n function runRepeatKeyDownEvent() {\n /*\n Toggles the repeat\n */\n Repeater.setRepeat(!config.repeat);\n\n /*\n Visually sync repeat\n */\n RepeatElements.syncRepeat();\n }\n\n /**\n * Returns the public methods for the handler.\n */\n return {\n handle: handle\n };\n})();\n\nexport default KeyDown;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/keydown.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a mute event.\n * @module events/Mute\n */\nlet Mute = (function() {\n /**\n * Handles an event for a mute element\n *\n * HANDLER FOR: class=\"amplitude-mute\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tIf the current volume in the config is 0, we set the volume to the\n\t\t\t\tpre_mute level. This means that the audio is already muted and\n\t\t\t\tneeds to be restored to the pre_mute level.\n\n\t\t\t\tOtherwise, we set pre_mute volume to the current volume\n\t\t\t\tand set the config volume to 0, muting the audio.\n\t\t\t*/\n if (config.volume == 0) {\n Core.setVolume(config.pre_mute_volume);\n } else {\n config.pre_mute_volume = config.volume;\n Core.setVolume(0);\n }\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\t\tSyncs the volume sliders so the visuals align up with the functionality.\n\t\t\t\tIf the volume is at 0, then the sliders should represent that so the user\n\t\t\t\thas the right starting point.\n\t\t\t*/\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Mute;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/mute.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core module.\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Play Pause Elements Module.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Callbacks Module\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports the Amplitude Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Next Event Handler\n *\n * @module events/Next\n */\nlet Next = (function() {\n /**\n * Handles an event on the next button\n *\n * HANDLER FOR: class=\"amplitude-next\"\n *\n * GLOBAL: class=\"amplitude-next\"\n * PLAYLIST: class=\"amplitude-next\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global next.\n */\n if (playlist == null) {\n handleGlobalNext();\n }\n\n /*\n If the playlist is set, we handle the playlist next.\n */\n if (playlist != null) {\n handlePlaylistNext(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global enxt button.\n *\n * @access private\n */\n function handleGlobalNext() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode. If we are in playlist mode,\n we set next on the playlist.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Handles an event on a next playlist button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the next for.\n */\n function handlePlaylistNext(playlist) {\n /*\n Ensure the playlist is the same as the active playlist. To get to change\n the scope to a new playlist, you need to play that playlist.\n */\n if (playlist == config.active_playlist) {\n AudioNavigation.setNextPlaylist(playlist);\n } else {\n Debug.writeMessage(\n \"You can not go to the next song on a playlist that is not being played!\"\n );\n }\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Next;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/next.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the ConfigState module.\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the pause events\n * @module events/Pause\n */\nlet Pause = (function() {\n /**\n * Handles an event on a pause button\n *\n * HANDLER FOR: class=\"amplitude-pause\"\n *\n * GLOBAL: class=\"amplitude-pause\"\n * PLAYLIST: class=\"amplitude-pause\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-pause\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-pause\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Gets the attribute for song index so we can check if\n there is a need to change the song. In some scenarios\n there might be multiple pause classes on the page. In that\n case it is possible the user could click a different pause\n class.\n */\n let songIndexAttribute = this.getAttribute(\"data-amplitude-song-index\");\n let playlistAttribute = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n Handle a global pause button.\n */\n if (playlistAttribute == null && songIndexAttribute == null) {\n handleGlobalPause();\n }\n\n /*\n Handle a playlist pause button.\n */\n if (playlistAttribute != null && songIndexAttribute == null) {\n handlePlaylistPause(playlistAttribute);\n }\n\n /*\n Handle a song pause button.\n */\n if (playlistAttribute == null && songIndexAttribute != null) {\n handleSongPause(songIndexAttribute);\n }\n\n /*\n Handle a song in playlist pause button.\n */\n if (playlistAttribute != null && songIndexAttribute != null) {\n handleSongInPlaylistPause(playlistAttribute, songIndexAttribute);\n }\n\n ConfigState.setPlayerState();\n }\n }\n\n /**\n * Handles global pause button which pauses whatever song is\n * active.\n *\n * @access private\n */\n function handleGlobalPause() {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the playlist pause.\n *\n * @access private\n * @param {string} playlist The playlist the pause button belongs to.\n */\n function handlePlaylistPause(playlist) {\n /*\n Checks to see if the active playlist is the same\n */\n if (config.active_playlist == playlist) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /**\n * Handles the song pause.\n *\n * @access private\n * @param {integer} song The song the pause button belongs to.\n */\n function handleSongPause(song) {\n /*\n Checks to see if the active playlist is null and the song matches\n the active index.\n */\n if (\n (config.active_playlist == \"\" || config.active_playlist == null) &&\n config.active_index == song\n ) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /**\n * Handles the song in playlist pause.\n *\n * @access private\n * @param {string} playlist The playlist the pause button belongs to.\n * @param {integer} song The song the pause button belongs to.\n */\n function handleSongInPlaylistPause(playlist, song) {\n /*\n Checks to see if the active song matches the song and the\n active playlist matches the playlist. This means the pause button is\n for the song in the playlist.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[playlist].active_index == song\n ) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /*\n Returns the public facing elements\n */\n return {\n handle: handle\n };\n})();\n\nexport default Pause;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/pause.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the config state utility.\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the play events\n * @module events/Play\n */\nlet Play = (function() {\n /**\n * Handles an event on a play button in Amplitude.\n *\n * HANDLER FOR: class=\"amplitude-play\"\n *\n * GLOBAL: class=\"amplitude-play\"\n * PLAYLIST: class=\"amplitude-play\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-play\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-play\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Gets the attribute for song index so we can check if\n there is a need to change the song. In some scenarios\n there might be multiple play classes on the page. In that\n case it is possible the user could click a different play\n class and change the song.\n */\n let songIndexAttribute = this.getAttribute(\"data-amplitude-song-index\");\n let playlistAttribute = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n Handle a global play button.\n */\n if (playlistAttribute == null && songIndexAttribute == null) {\n handleGlobalPlay();\n }\n\n /*\n Handle a playlist play button.\n */\n if (playlistAttribute != null && songIndexAttribute == null) {\n handlePlaylistPlay(playlistAttribute);\n }\n\n /*\n Handle a song play button.\n */\n if (playlistAttribute == null && songIndexAttribute != null) {\n handleSongPlay(songIndexAttribute);\n }\n\n /*\n Handle a song in playlist play button.\n */\n if (playlistAttribute != null && songIndexAttribute != null) {\n handleSongInPlaylistPlay(playlistAttribute, songIndexAttribute);\n }\n\n ConfigState.setPlayerState();\n }\n }\n\n /**\n * Handles global play button which plays whatever song is\n * active.\n *\n * @access private\n */\n function handleGlobalPlay() {\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handle the playlist play.\n *\n * @access private\n * @param {string} playlist The playlist the play button belongs to.\n */\n function handlePlaylistPlay(playlist) {\n /*\n Checks if we have a new playlist.\n */\n if (Checks.newPlaylist(playlist)) {\n /*\n Sets the active playlist to what belongs to the playlist.\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n Play first song in the playlist since we just\n switched playlists, we start from the first song.\n\n If the user has shuffle on for the playlist, then\n we go from the first song in the shuffle playlist array.\n */\n if (config.playlists[playlist].shuffle) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].shuffle_list[0],\n 0\n );\n } else {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[0],\n 0\n );\n }\n }\n\n /*\n Plays the song.\n */\n Core.play();\n\n /*\n Syncs the play pause elements since they are dependent upon this state\n of the player.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the song play button.\n *\n * @access private\n * @param {integer} song The index of the song we are playing.\n */\n function handleSongPlay(song) {\n /*\n There can be multiple playlists on the page and there can be\n multiple songs on the page AND there can be songs in multiple\n playlists, so we have some checking to do.\n */\n\n /*\n Check to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n */\n if (Checks.newPlaylist(null)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(null);\n\n /*\n We then change the song to the index selected.\n */\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n Check to see if the song has changed. If it has,\n set the active song. If it was in a playlist, the\n song wouldn't change here, since we already set the\n song when we checked for a playlist.\n */\n if (Checks.newSong(null, song)) {\n /*\n The song selected is different, so we change the\n song.\n */\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Syncs the play pause elements since they are dependent upon this state\n of the player.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the song in playlist play.\n *\n * @access private\n * @param {string} playlist The playlist the play button belongs to.\n * @param {integer} song The song the play button belongs to.\n */\n function handleSongInPlaylistPlay(playlist, song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(playlist, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /*\n Returns the public facing elements\n */\n return {\n handle: handle\n };\n})();\n\nexport default Play;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/play.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Import the config state utility.\n * @module utilities/configState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the play pause events\n * @module events/PlayPause\n */\nlet PlayPause = (function() {\n /**\n * Handles an event on a play/pause button\n *\n * HANDLER FOR: class=\"amplitude-play-pause\"\n *\n * GLOBAL: class=\"amplitude-play-pause\"\n * PLAYLIST: class=\"amplitude-play-pause\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-play-pause\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-play-pause\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Get the playlist and song from the element. It's alright if these\n are null.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let song = this.getAttribute(\"data-amplitude-song-index\");\n\n /*\n Handle a global play pause button\n */\n if (playlist == null && song == null) {\n handleGlobalPlayPause();\n }\n\n /*\n Handle a playlist play pause button\n */\n if (playlist != null && song == null) {\n handlePlaylistPlayPause(playlist);\n }\n\n /*\n Handle a song play pause button\n */\n if (playlist == null && song != null) {\n handleSongPlayPause(song);\n }\n\n /*\n Handle a song in playlist play pause button\n */\n if (playlist != null && song != null) {\n handleSongInPlaylistPlayPause(playlist, song);\n }\n\n ConfigState.setPlayerState();\n }\n }\n\n /**\n * Sets the main play pause buttons to the current state of the song.\n * @access private\n */\n function handleGlobalPlayPause() {\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the playlist main play pause buttons to the current state of the song.\n * @access private\n * @param {string} playlist The playlist the main play pause button controls\n */\n function handlePlaylistPlayPause(playlist) {\n /*\n The only thing that can change when you click a playlist\n play pause is the playlist. Main play pauses have no change\n in song, song play pauses can change playlist and song.\n */\n if (Checks.newPlaylist(playlist)) {\n /*\n If there's a new playlist, then we set the new playlist.\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n Play first song in the playlist since we just\n switched playlists, we start from the first song.\n\n If the user has shuffle on for the playlist, then\n we go from the first song in the shuffle playlist array.\n */\n if (config.playlists[playlist].shuffle) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].shuffle_list[0],\n 0\n );\n } else {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[0],\n 0\n );\n }\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the playlist main play pause buttons to the current state of the song.\n * @access private\n * @param {string} song The index of the song being played/paused\n */\n function handleSongPlayPause(song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(null)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(null);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(null, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the song in playlist play pause buttons to the current\n * state of the song.\n * @access private\n * @param {string} playlist The playlist the song is a part of\n * @param {number} song The index of the song being played/paused\n */\n function handleSongInPlaylistPlayPause(playlist, song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(playlist, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default PlayPause;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/playPause.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Amplitude Core module\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Playback Speed Visual Elements\n * @module visual/PlaybackSpeedElements\n */\nimport PlaybackSpeedElements from \"../visual/playbackSpeedElements.js\";\n\n/**\n * AmplitudeJS Playback Speed Event Handler\n *\n * @module events/PlaybackSpeed\n */\nlet PlaybackSpeed = (function() {\n /**\n * Handles an event on the playback speed button\n *\n * HANDLER FOR: class=\"amplitude-playback-speed\"\n *\n * @access public\n */\n function handle() {\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tWe increment the speed by .5 everytime we click\n\t\t\t\tthe button to change the playback speed. Once we are\n\t\t\t\tactively playing back at 2, we start back at 1 which\n\t\t\t\tis normal speed.\n\t\t\t*/\n switch (config.playback_speed) {\n case 1:\n Core.setPlaybackSpeed(1.5);\n break;\n case 1.5:\n Core.setPlaybackSpeed(2);\n break;\n case 2:\n Core.setPlaybackSpeed(1);\n break;\n }\n\n /*\n\t\t\t\tVisually sync the playback speed.\n\t\t\t*/\n PlaybackSpeedElements.sync();\n }\n }\n\n /*\n Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default PlaybackSpeed;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/playbackSpeed.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Amplitude Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Prev Event Handler\n *\n * @module events/Prev\n */\nlet Prev = (function() {\n /**\n * Handles an event on the previous button\n *\n * HANDLER FOR: class=\"amplitude-prev\"\n *\n * GLOBAL: class=\"amplitude-prev\"\n * PLAYLIST: class=\"amplitude-prev\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global prev.\n */\n if (playlist == null) {\n handleGlobalPrev();\n }\n\n /*\n If the playlist is set, we handle the playlist prev.\n */\n if (playlist != null) {\n handlePlaylistPrev(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global previous button.\n *\n * @access private\n */\n function handleGlobalPrev() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode. If we are in playlist mode,\n we set prev on the playlist.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Handles an event on a previous playlist button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the previous for.\n */\n function handlePlaylistPrev(playlist) {\n /*\n Ensure the playlist is the same as the active playlist. To get to change\n the scope to a new playlist, you need to play that playlist.\n */\n if (playlist == config.active_playlist) {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n } else {\n Debug.writeMessage(\n \"You can not go to the previous song on a playlist that is not being played!\"\n );\n }\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Prev;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/prev.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the BufferedProgressElements visual handler\n * @module visual/bufferedProgressElements.js\n */\nimport BufferedProgressElements from \"../visual/bufferedProgressElements.js\";\n\n/**\n * AmplitudeJS Event Handler for progress\n *\n * @module events/Progress\n */\nlet Progress = (function() {\n /**\n * As the song is buffered, we can display the buffered percentage in\n * a progress bar.\n *\n * HANDLER FOR: progress\n *\n * @access public\n */\n function handle() {\n /*\n Help from: http://jsbin.com/badimipi/1/edit?html,js,output\n */\n if (config.audio.buffered.length - 1 >= 0) {\n let bufferedEnd = config.audio.buffered.end(\n config.audio.buffered.length - 1\n );\n let duration = config.audio.duration;\n\n /*\n Set the computed song buffered value to the config.\n */\n config.buffered = (bufferedEnd / duration) * 100;\n }\n\n /*\n Sync the buffered progress bars.\n */\n BufferedProgressElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Progress;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/progress.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the repeater utility module.\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the visual repeat elements module\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * AmplitudeJS Repeat Event Handler\n *\n * @module events/Repeat\n */\nlet Repeat = (function() {\n /**\n * Handles an event on the repeat button\n *\n * HANDLER FOR: class=\"amplitude-repeat\"\n *\n * GLOBAL: class=\"amplitude-repeat\"\n * PLAYLIST: class=\"amplitude-repeat\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global repeat.\n */\n if (playlist == null) {\n handleGlobalRepeat();\n }\n\n /*\n If the playlist is set, we handle the playlist repeat.\n */\n if (playlist != null) {\n handlePlaylistRepeat(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global repeat button.\n *\n * @access private\n */\n function handleGlobalRepeat() {\n /*\n Sets repeat to the opposite of what it was set to\n */\n Repeater.setRepeat(!config.repeat);\n\n /*\n Visually sync repeat\n */\n RepeatElements.syncRepeat();\n }\n\n /**\n * Handles an event on a playlist repeat button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the repeat store.\n */\n function handlePlaylistRepeat(playlist) {\n /*\n Sets repeat to the opposite of what it was set to for the playlist.\n */\n Repeater.setRepeatPlaylist(!config.playlists[playlist].repeat, playlist);\n\n /*\n Visually sync playlist repeat\n */\n RepeatElements.syncRepeatPlaylist(playlist);\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Repeat;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/repeat.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the repeat utility\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the AmplitudeJS Repeat Element\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * Handles an event on the Amplitude Repeat Song.\n *\n * @module events/RepeatSong\n */\nlet RepeatSong = (function() {\n /**\n * Handles an event on the repeat song button\n *\n * HANDLER FOR: 'amplitude-repeat-song'\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tSets repeat song to the opposite of what it was set to\n\t\t\t*/\n Repeater.setRepeatSong(!config.repeat_song);\n\n /*\n\t\t\t\tVisually sync repeat song\n\t\t\t*/\n RepeatElements.syncRepeatSong();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default RepeatSong;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/repeatSong.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the shuffler utility\n * @module utilities/Shuffler\n */\nimport Shuffler from \"../utilities/shuffler.js\";\n\n/**\n * Imports the visual shuffle elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"../visual/shuffleElements.js\";\n\n/**\n * Handles all of the shuffle events\n * @module events/Shuffle\n */\nlet Shuffle = (function() {\n /**\n * Handles an event on the shuffle button\n *\n * HANDLER FOR: class=\"amplitude-shuffle\"\n *\n * GLOBAL: class=\"amplitude-shuffle\"\n * PLAYLIST: class=\"amplitude-shuffle\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Get the playlist attribute\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n\t\t\t\tCheck to see if the shuffle button belongs to a playlist\n\t\t\t*/\n if (playlist == null) {\n handleGlobalShuffle();\n } else {\n handlePlaylistShuffle(playlist);\n }\n }\n }\n\n /**\n * Handles the event on the global shuffle button.\n */\n function handleGlobalShuffle() {\n /*\n Either shuffles or removes shuffle on the global state.\n */\n Shuffler.toggleShuffle();\n\n /*\n Visualize the shuffle state change.\n */\n ShuffleElements.syncMain(config.shuffle_on);\n }\n\n /**\n * Handles the event on the playlist shuffle button.\n *\n * @param {string} playlist - The playlist string the shuffle button belongs to.\n */\n function handlePlaylistShuffle(playlist) {\n /*\n Either shuffles or removes shuffle on the playlist state.\n */\n Shuffler.toggleShufflePlaylist(playlist);\n\n /*\n Visually sync the playlist shuffle statuses.\n */\n ShuffleElements.syncPlaylist(playlist);\n }\n\n /**\n * Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Shuffle;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/shuffle.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports AmplitudeJS Debug Utility\n * @module utilities/debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS play pause elements.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles the skip to event.\n *\n * @module events/SkipTo\n */\nlet SkipTo = (function() {\n /**\n * Handles an event on a skip to button.\n *\n * HANDLER FOR: class=\"amplitude-skip-to\"\n *\n * GLOBAL: class=\"amplitude-skip-to\" amplitude-song-index=\"song_index\" amplitude-location=\"seconds\"\n * PLAYLIST: class=\"amplitude-skip-to\" amplitude-playlist=\"playlist_key\" amplitude-song-index=\"song_index\" amplitude-location=\"seconds\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Extracts the needed attributes from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let songIndex = this.getAttribute(\"data-amplitude-song-index\");\n let location = this.getAttribute(\"data-amplitude-location\");\n\n /*\n If the location is null, write a message. We can't skip to a location\n that is null\n */\n if (location == null) {\n Debug.writeMessage(\n \"You must add an 'data-amplitude-location' attribute in seconds to your 'amplitude-skip-to' element.\"\n );\n }\n\n /*\n If the song index is null, write a debug message. We can't skip to a location\n of a null song.\n */\n if (songIndex == null) {\n Debug.writeMessage(\n \"You must add an 'data-amplitude-song-index' attribute to your 'amplitude-skip-to' element.\"\n );\n }\n\n /*\n If the location and song index are set, continue.\n */\n if (location != null && songIndex != null) {\n /*\n \t\t\t\tDetermines if the skip to button is in the scope of a playlist.\n \t\t\t*/\n if (playlist == null) {\n handleSkipToSong(parseInt(songIndex), parseInt(location));\n } else {\n handleSkipToPlaylist(\n playlist,\n parseInt(songIndex),\n parseInt(location)\n );\n }\n }\n }\n }\n\n /**\n * Handles the skipping to a specific song\n *\n * @access private\n * @param {string} songIndex - The index of the song being skipped to\n * @param {number} location - The seconds location of the song in the playlist.\n */\n function handleSkipToSong(songIndex, location) {\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSong(config.songs[songIndex], songIndex);\n Core.play();\n\n /*\n Syncs all of the play pause buttons now that we've skipped.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(location);\n }\n\n /**\n * Handles the skipping to a song that's in a playlist.\n *\n * @access private\n * @param {string} playlist - The playlist being skipped to\n * @param {string} songIndex - The index of the song in the playlist\n * @param {number} location - The seconds location of the song in the playlist.\n */\n function handleSkipToPlaylist(playlist, songIndex, location) {\n /*\n Checks if we are skipping to a new playlist\n */\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n }\n\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[songIndex],\n songIndex\n );\n Core.play();\n\n /*\n Sync all of the play pause elements.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncPlaylist();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(location);\n }\n\n /**\n * Return public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default SkipTo;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/skipTo.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the time utility\n * @module utilities/Time\n */\nimport Time from \"../utilities/time.js\";\n\n/**\n * Imports the song slider elements.\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Handles the song slider to event.\n *\n * @module events/SongSlider\n */\nlet SongSlider = (function() {\n /**\n * Handles a song slider element.\n *\n * HANDLER FOR: class=\"amplitude-song-slider\"\n *\n * GLOBAL: class=\"amplitude-song-slider\"\n * PLAYLIST: class=\"amplitude-song-slider\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-song-slider\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-song-slider\" amplitude-playlist=\"playlist_key\" amplitude-song-index=\"song_index\"\n *\n * @access public\n */\n function handle() {\n /*\n\t\t\tGets the percentage of the song we will be setting the location for.\n\t\t*/\n let locationPercentage = this.value;\n\n /*\n Computes the time in seconds for the current song.\n */\n let computedTime = config.audio.duration * (locationPercentage / 100);\n\n /*\n Gets the attributes for playlist and index for the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let song = this.getAttribute(\"data-amplitude-song-index\");\n\n /*\n If no playlist or song is defined, then it's a global song slider.\n */\n if (playlist == null && song == null) {\n handleGlobalSongSlider(computedTime, locationPercentage);\n }\n\n /*\n If a playlist but no song is defined, then it's playlist slider.\n */\n if (playlist != null && song == null) {\n handlePlaylistSongSlider(computedTime, locationPercentage, playlist);\n }\n\n /*\n If no playlist but a song is defined, then it's a song slider.\n */\n if (playlist == null && song != null) {\n handleSongSongSlider(computedTime, locationPercentage, song);\n }\n\n /*\n If playlist and song are defined then it's a song in a playlist\n slider.\n */\n if (playlist != null && song != null) {\n handleSongInPlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist,\n song\n );\n }\n }\n\n /**\n * Handles a change on a global audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n */\n function handleGlobalSongSlider(computedTime, locationPercentage) {\n /*\n\t\t\tIf the active song is not live, set the current time and adjust the slider.\n\t\t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n config.active_playlist,\n config.active_index\n );\n }\n }\n\n /**\n * Handles a change on a playlist audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {string} playlist = The playlist the song slider belongs to.\n */\n function handlePlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist\n ) {\n /*\n\t\t\tWe don't want to song slide a playlist that's not the\n\t\t\tactive placylist.\n\t\t*/\n if (config.active_playlist == playlist) {\n /*\n \t\t\tIf the active song is not live, set the current time\n \t\t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n playlist,\n config.active_index\n );\n }\n }\n }\n\n /**\n * Handles a change on a song audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {integer} songIndex = The song being navigated.\n */\n function handleSongSongSlider(computedTime, locationPercentage, songIndex) {\n /*\n We only want to move the slider if the active song is the\n same as the song being selected.\n */\n if (config.active_index == songIndex && config.active_playlist == null) {\n /*\n \t\tIf the active song is not live, set the current time\n \t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n config.active_playlist,\n songIndex\n );\n }\n }\n }\n\n /**\n * Handles a change on a song audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {integer} playlist = The playlist the song belongs to.\n * @param {integer} songIndex = The song being navigated.\n */\n function handleSongInPlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist,\n songIndex\n ) {\n /*\n We only want to move the slider if the active song is the\n same as the song being selected and the active playlist is the same\n as the playlist selected.\n */\n if (\n config.playlists[playlist].active_index == songIndex &&\n config.active_playlist == playlist\n ) {\n /*\n \t\tIf the active song is not live, set the current time\n \t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(locationPercentage, playlist, songIndex);\n }\n }\n }\n\n /*\n Return public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default SongSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/songSlider.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the config state module.\n * @module utilities/configState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Handles all of the stop events\n * @module events/Stop\n */\nlet Stop = (function() {\n /**\n * Handles an event on a stop element.\n *\n * HANDLER FOR: class=\"amplitude-stop\"\n *\n * @access public\n */\n function handle() {\n /*\n If touch is not moving, we run. We don't want to accidentally press\n stop if touch is moving.\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tSets all of the play/pause buttons to pause\n\t\t\t*/\n PlayPauseElements.syncToPause();\n\n /*\n\t\t\t\tStops the active song.\n\t\t\t*/\n Core.stop();\n\n /*\n Set the state of the player.\n */\n ConfigState.setPlayerState();\n }\n }\n\n /**\n * Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Stop;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/stop.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Buffered Progress Elements visual class\n * @module visual/bufferedProgressElements\n */\nimport BufferedProgressElements from \"../visual/bufferedProgressElements.js\";\n\n/**\n * Imports the Time Elements visual class.\n * @module visual/timeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Imports the Song Slider Elements visual class.\n * @module visual/songSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Imports the Song Played Progress Elements visual class.\n * @module visual/songPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"../visual/songPlayedProgressElements.js\";\n\n/**\n * Imports the Time utility class\n * @module utilities/Time\n */\nimport Time from \"../utilities/time.js\";\n\n/**\n * Imports the Callback utility class\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * AmplitudeJS Event Handler for Time Update\n *\n * @module events/TimeUpdate\n */\nlet TimeUpdate = (function() {\n /**\n * When the time updates on the active song, we sync the current time displays\n *\n * HANDLER FOR: timeupdate\n *\n * @access public\n */\n function handle() {\n /*\n Computes the buffered time.\n */\n computeBufferedTime();\n\n /*\n Sync the buffered progress elements.\n */\n BufferedProgressElements.sync();\n\n /*\n Updates the current time information.\n */\n updateTimeInformation();\n\n /*\n Run time callbacks\n */\n runTimeCallbacks();\n }\n\n /**\n * Computes the buffered time\n */\n function computeBufferedTime() {\n /*\n Help from: http://jsbin.com/badimipi/1/edit?html,js,output\n */\n if (config.audio.buffered.length - 1 >= 0) {\n let bufferedEnd = config.audio.buffered.end(\n config.audio.buffered.length - 1\n );\n let duration = config.audio.duration;\n\n config.buffered = (bufferedEnd / duration) * 100;\n }\n }\n\n /**\n * Updates the current time information.\n * @access private\n */\n function updateTimeInformation() {\n /*\n If the current song is not live, then\n we can update the time information. Otherwise the\n current time updates wouldn't mean much since the time\n is infinite.\n */\n if (!config.active_metadata.live) {\n /*\n Compute the current time\n */\n let currentTime = Time.computeCurrentTimes();\n\n /*\n Compute the song completion percentage\n */\n let songCompletionPercentage = Time.computeSongCompletionPercentage();\n\n /*\n Computes the song duration\n */\n let songDuration = Time.computeSongDuration();\n\n /*\n Sync the current time elements with the current\n location of the song and the song duration elements with\n the duration of the song.\n */\n TimeElements.syncCurrentTimes(currentTime);\n\n /*\n Sync the song slider elements.\n */\n SongSliderElements.sync(\n songCompletionPercentage,\n config.active_playlist,\n config.active_index\n );\n\n /*\n Sync the song played progress elements.\n */\n SongPlayedProgressElements.sync(songCompletionPercentage);\n\n /*\n Sync the duration time elements.\n */\n TimeElements.syncDurationTimes(currentTime, songDuration);\n }\n }\n\n /**\n * Runs a callback at a certain time in the song.\n */\n function runTimeCallbacks() {\n /*\n Gets the current seconds into the song.\n */\n let currentSeconds = Math.floor(config.audio.currentTime);\n\n /*\n Checks to see if there is a callback at the certain seconds into the song.\n */\n if (\n config.active_metadata.time_callbacks != undefined &&\n config.active_metadata.time_callbacks[currentSeconds] != undefined\n ) {\n /*\n Checks to see if the callback has been run. Since the time updates more than\n one second, we don't want the callback to run X times.\n */\n if (!config.active_metadata.time_callbacks[currentSeconds].run) {\n config.active_metadata.time_callbacks[currentSeconds].run = true;\n config.active_metadata.time_callbacks[currentSeconds]();\n }\n } else {\n /*\n Iterate over all of the callbacks for a song. If the song has one, we flag\n the run as false. This occurs because we have passed the active second for\n the callback, so we flag it as not run. It will either run again if the user\n seeks back or not run in the future.\n */\n for (var seconds in config.active_metadata.time_callbacks) {\n if (config.active_metadata.time_callbacks.hasOwnProperty(seconds)) {\n config.active_metadata.time_callbacks[seconds].run = false;\n }\n }\n }\n }\n /**\n * Returns public functions\n */\n return {\n handle: handle\n };\n})();\n\nexport default TimeUpdate;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/timeUpdate.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume down event.\n * @module events/VolumeDown\n */\nlet VolumeDown = (function() {\n /**\n * Handles a click on a volume down element.\n *\n * HANDLER FOR: class=\"amplitude-volume-down\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tThe volume range is from 0 to 1 for an audio element. We make this\n\t\t\t\ta base of 100 for ease of working with.\n\n\t\t\t\tIf the new value is less than 100, we use the new calculated\n\t\t\t\tvalue which gets converted to the proper unit for the audio element.\n\n\t\t\t\tIf the new value is greater than 100, we set the volume to 1 which\n\t\t\t\tis the max for the audio element.\n\t\t\t*/\n let volume = null;\n\n if (config.volume - config.volume_increment > 0) {\n volume = config.volume - config.volume_increment;\n } else {\n volume = 0;\n }\n\n /*\n\t\t\t\tCalls the core function to set the volume to the computed value\n\t\t\t\tbased on the user's intent.\n\t\t\t*/\n Core.setVolume(volume);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n Sync Volume Slider Elements\n */\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeDown;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeDown.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume up event.\n * @module events/VolumeSlider\n */\nlet VolumeSlider = (function() {\n /**\n * Handles a change on the volume slider\n *\n * HANDLER FOR: class=\"amplitude-volume-slider\"\n *\n * @access public\n */\n function handle() {\n /*\n\t\t\tCalls the core function to set the volume to the computed value\n\t\t\tbased on the user's intent.\n\t\t*/\n Core.setVolume(this.value);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\tSync the volume slider locations\n\t\t*/\n VolumeSliderElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeSlider.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume up event.\n * @module events/VolumeUp\n */\nlet VolumeUp = (function() {\n /**\n * Handles a click on a volume up element.\n *\n * HANDLER FOR: class=\"amplitude-volume-up\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tThe volume range is from 0 to 1 for an audio element. We make this\n\t\t\t\ta base of 100 for ease of working with.\n\n\t\t\t\tIf the new value is less than 100, we use the new calculated\n\t\t\t\tvalue which gets converted to the proper unit for the audio element.\n\n\t\t\t\tIf the new value is greater than 100, we set the volume to 1 which\n\t\t\t\tis the max for the audio element.\n\t\t\t*/\n let volume = null;\n\n if (config.volume + config.volume_increment <= 100) {\n volume = config.volume + config.volume_increment;\n } else {\n volume = 100;\n }\n\n /*\n\t\t\t\tCalls the core function to set the volume to the computed value\n\t\t\t\tbased on the user's intent.\n\t\t\t*/\n Core.setVolume(volume);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n Sync Volume Slider Elements\n */\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeUp;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeUp.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS FX Module. Helps with configuring and setting up visualizations\n * and any other features of the Web Audio API that Amplitude takes advantage\n * of.\n *\n * @module fx/FX\n */\nlet Fx = (function() {\n /**\n * Configures the Web Audio API to work with AmplitudeJS\n */\n function configureWebAudioAPI() {\n /*\n\t\t\tGets the context for the browser. If this is null, the Web Audio\n\t\t\tAPI is unavailable.\n\t\t*/\n let browserContext =\n window.AudioContext ||\n window.webkitAudioContext ||\n window.mozAudioContext ||\n window.oAudioContext ||\n window.msAudioContext;\n\n /*\n\t\t\tIf we have a context, the Web Audio API is available and we can continue,\n\t\t\totherwise, we alert the user if they have debug turned on.\n\t\t*/\n if (browserContext) {\n /*\n\t\t\t\tWeb Audio API is available, set the context in our config.\n\t\t\t*/\n config.context = new browserContext();\n \n /*\n\t\t\t\tCreate an analyzer that we will use in the context.\n\t\t\t*/\n config.analyser = config.context.createAnalyser();\n\n /*\n\t\t\t\tSet cross origin to anonymous so we have a better chance of being able\n\t\t\t\tto use the power of the Web Audio API.\n\t\t\t*/\n config.audio.crossOrigin = \"anonymous\";\n \n /*\n\t\t\t\tBind the source to the Javascript Audio Element.\n\t\t\t*/\n config.source = config.context.createMediaElementSource(config.audio);\n\n /*\n\t\t\t\tConnect the analyser to the source\n\t\t\t*/\n config.source.connect(config.analyser);\n\n /*\n\t\t\t\tConnect the context destination to the analyser.\n\t\t\t*/\n config.analyser.connect(config.context.destination);\n } else {\n AmplitudeHelpers.writeDebugMessage(\n \"Web Audio API is unavailable! We will set any of your visualizations with your back up definition!\"\n );\n }\n }\n\n /**\n * Determines if the web audio API is available or not.\n */\n function webAudioAPIAvailable() {\n /*\n\t\t\tGets the context for the browser. If this is null, the Web Audio\n\t\t\tAPI is unavailable.\n\t\t*/\n let browserContext =\n window.AudioContext ||\n window.webkitAudioContext ||\n window.mozAudioContext ||\n window.oAudioContext ||\n window.msAudioContext;\n config.web_audio_api_available = false;\n\n /*\n\t\t\tDetermines if the Web Audio API is available or not.\n\t\t*/\n if (browserContext) {\n /*\n\t\t\t\tSet the flag in the config that the Web Audio API is available\n\t\t\t*/\n config.web_audio_api_available = true;\n return true;\n } else {\n /*\n\t\t\t\tSet the flag in the config that the Web Audio API is not available\n\t\t\t*/\n config.web_audio_api_available = false;\n return false;\n }\n }\n\n /**\n * Determines if the user is using any of the web audio API features.\n */\n function determineUsingAnyFX(){\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n if( waveforms.length > 0 || visualizationElements.length > 0 ){\n return true;\n }else{\n return false;\n }\n }\n\n /*\n\t\tReturns the publicly accessible methods\n\t*/\n return {\n configureWebAudioAPI: configureWebAudioAPI,\n webAudioAPIAvailable: webAudioAPIAvailable,\n determineUsingAnyFX: determineUsingAnyFX\n };\n})();\n\nexport default Fx;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/fx.js","/**\n * @name \t\tAmplitude.js\n * @author \tDan Pastori (521 Dimensions) \n */\n/**\n * AmplitudeJS Initializer Module\n *\n * @module init/AmplitudeInitializer\n */\nimport Initializer from \"./init/init.js\";\n\n/****************************************************\n * Config\n ****************************************************/\n/**\n * Imports the config module\n * @module config\n */\nimport config from \"./config.js\";\n\n/****************************************************\n * Core\n ****************************************************/\n/**\n * AmplitudeJS Core Module\n *\n * @module core/Core\n */\nimport Core from \"./core/core.js\";\n\n/****************************************************\n * Utilities\n ****************************************************/\n/**\n * Shuffler Module\n * @module utilities/Shuffler\n */\nimport Shuffler from \"./utilities/shuffler.js\";\n\n/**\n * Imports the config state module.\n * @module ConfigState\n */\nimport ConfigState from \"./utilities/configState.js\";\n\n/**\n * Imports the audio navigation\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"./utilities/audioNavigation.js\";\n\n/**\n * Repeater Module\n *\n * @module utilities/Repeater\n */\nimport Repeater from \"./utilities/repeater.js\";\n\n/**\n * Imports the checks\n * @module utilities/Checks\n */\nimport Checks from \"./utilities/checks.js\";\n\n/****************************************************\n * FX Modules\n ****************************************************/\n/**\n * Imports the visualizations module\n * @module fx/Visualizations\n */\nimport Visualizations from \"./fx/visualizations.js\";\n\n/****************************************************\n * Elements\n ****************************************************/\n/**\n * Visual Shuffle Elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"./visual/shuffleElements.js\";\n\n/**\n * Visual Repeat Elements\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"./visual/repeatElements.js\";\n\n/**\n * Song Slider Elements\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"./visual/songSliderElements.js\";\n\n/**\n * Song Played Progress Elements\n * @module visual/SongPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"./visual/songPlayedProgressElements.js\";\n\n/**\n * Time Elements\n * @module visual/TimeElements\n */\nimport TimeElements from \"./visual/timeElements.js\";\n\n/**\n * Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"./visual/playPauseElements.js\";\n\n/**\n * Meta Data Elements\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"./visual/metaDataElements.js\";\n\n/** \n * Playback Speed Elements\n * @module visual/PlaybackSpeedElements\n */\nimport PlaybackSpeedElements from \"./visual/playbackSpeedElements.js\";\n\nimport Debug from \"./utilities/debug.js\";\n\nimport SoundCloud from \"./soundcloud/soundcloud.js\";\n\n/**\n * Amplitude should just be an interface to the public functions.\n * Everything else should be handled by other objects\n *\n * @module Amplitude\n */\nlet Amplitude = (function() {\n /**\n * The main init function. The user will call this through\n * Amplitude.init({}) and pass in their settings.\n *\n * Public Accessor: Amplitude.init( user_config_json );\n *\n * @access public\n * @param {object} userConfig \t- A JSON object of user defined values that helps configure and initialize AmplitudeJS.\n */\n function init(userConfig) {\n Initializer.initialize(userConfig);\n }\n\n /**\n * Returns the current config for AmplitudeJS\n */\n function getConfig() {\n return config;\n }\n\n /**\n * Binds new elements that were added to the page.\n *\n * Public Accessor: Amplitude.bindNewElements()\n *\n * @access public\n */\n function bindNewElements() {\n Initializer.rebindDisplay();\n }\n\n /**\n * Returns the active playlist.\n *\n * Public Accessor: Amplitude.getActivePlaylist()\n *\n * @access public\n */\n function getActivePlaylist() {\n return config.active_playlist;\n }\n\n /**\n * Returns the current playback speed.\n *\n * Public Accessor: Amplitude.getPlaybackSpeed()\n *\n * @access public\n */\n function getPlaybackSpeed() {\n return config.playback_speed;\n }\n\n /**\n * Sets the playback speed\n * \n * Public Accessor: Amplitude.setPlaybackSpeed( speed )\n * \n * @access public\n */\n function setPlaybackSpeed( speed ) {\n /*\n Increments are set in .5 We only accept values\n 1, 1.5, 2\n\n 1 -> Regular Speed\n 1.5 -> 50% faster\n 2 -> Twice as fast\n */\n Core.setPlaybackSpeed( speed );\n\n /*\n Visually sync the playback speed.\n */\n PlaybackSpeedElements.sync();\n }\n\n /**\n * Gets the repeat state of the player.\n *\n * Public Accessor: Amplitude.getRepeat()\n *\n * @access public\n */\n function getRepeat() {\n return config.repeat;\n }\n\n /**\n * Gets the repeat state for a playlist\n *\n * Public Accessor: Amplitude.getRepeatPlaylist()\n *\n * @access public\n */\n function getRepeatPlaylist(playlistKey) {\n return config.playlists[playlistKey].repeat;\n }\n\n /**\n * Returns the shuffle state of the player.\n *\n * Public Accessor: Amplitude.getShuffle()\n *\n * @access public\n */\n function getShuffle() {\n return config.shuffle_on;\n }\n\n /**\n * Returns the shuffle state of the playlist.\n *\n * Public Accessor: Amplitude.getShufflePlaylist( playlist )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to see if it's shuffled or not.\n */\n function getShufflePlaylist(playlist) {\n return config.playlists[playlist].shuffle;\n }\n\n /**\n * Sets the shuffle state for the player.\n *\n * Public Accessor: Amplitude.setShuffle()\n *\n * @param {boolean} shuffle \t- True when we are shuffling the songs, false when we turn off shuffle.\n *\n * @access public\n */\n function setShuffle(shuffle) {\n Shuffler.setShuffle(shuffle);\n\n ShuffleElements.syncMain();\n }\n\n /**\n * Sets the shuffle state for the playlist\n *\n * Public Accessor: Amplitude.setShufflePlaylist( playlist )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to to shuffle the playlist.\n * @param {boolean} shuffle \t- True when we are shuffling the playlist, false when we turn off shuffle.\n */\n function setShufflePlaylist(playlist, shuffle) {\n Shuffler.setShufflePlaylist(playlist, shuffle);\n\n ShuffleElements.syncMain();\n ShuffleElements.syncPlaylist(playlist);\n }\n\n /**\n * Sets the repeat state for the player.\n *\n * Public Accessor: Amplitude.setRepeat()\n *\n * @access public\n * @param {boolean} repeatState \t- The state you want the repeat song to be in.\n */\n function setRepeat(repeatState) {\n Repeater.setRepeat(repeatState);\n RepeatElements.syncRepeat();\n }\n\n /**\n * Sets the repeat state for a playlist.\n *\n * Public Accessor: Amplitude.setRepeatPlaylist( playlistKey )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to to shuffle the playlist.\n * @param {boolean} repeatState - The state you want the repeat playlist to be in.\n */\n function setRepeatPlaylist(playlist, repeatState) {\n Repeater.setRepeatPlaylist(repeatState, playlist);\n RepeatElements.syncRepeatPlaylist(playlist);\n }\n\n /**\n * Sets the repeat state for the song.\n *\n * Public Accessor: Amplitude.setRepeatSong()\n *\n * @access public\n * @param {boolean} repeatState \t- The state you want the repeat song status to be in.\n */\n function setRepeatSong(repeatState) {\n if (!config.is_touch_moving) {\n /*\n\t\t\t Sets repeat to the opposite of what it was set to\n\t\t\t*/\n Repeater.setRepeatSong(!config.repeat_song);\n\n /*\n\t\t\t\tVisually sync repeat song\n\t\t\t*/\n RepeatElements.syncRepeatSong();\n }\n }\n\n /**\n * Gets the default album art for the player\n *\n * Public Accessor: Amplitude.getDefaultAlbumArt()\n *\n * @access public\n */\n function getDefaultAlbumArt() {\n return config.default_album_art;\n }\n\n /**\n * Gets the default playlist art for the playlists\n *\n * Public Accessor: Amplitude.getDefaultPlaylistArt()\n *\n * @access public\n */\n function getDefaultPlaylistArt(){\n return config.default_playlist_art;\n }\n\n /**\n * Sets the default album art for the player\n *\n * Public Accessor: Amplitude.setDefaultAlbumArt( url )\n *\n * @access public\n * @param {string} url \t- A string representing the URL of the new default album art.\n */\n function setDefaultAlbumArt(url) {\n config.default_album_art = url;\n }\n\n /**\n * Sets the default playlist art for the player\n *\n * Public Accessor: Amplitude.setDefaultPlaylistArt( url )\n *\n * @access public\n * @param {string} url - A string representing the URL of the new default playlist art.\n */\n function setDefaultPlaylistArt(url){\n config.default_plalist_art = url;\n }\n\n /**\n * Allows the user to get the percentage of the song played.\n *\n * Public Accessor: Amplitude.getSongPlayedPercentage();\n *\n * @access public\n */\n function getSongPlayedPercentage() {\n /*\n\t\t\tReturns the percentage of the song played.\n\t\t*/\n return (config.audio.currentTime / config.audio.duration) * 100;\n }\n\n /**\n * Allows the user to get the amount of seconds the song has played.\n *\n * Public Accessor: Amplitude.getSongPlayed();\n *\n * @access public\n */\n function getSongPlayedSeconds() {\n /*\n\t\t\tReturns the amount of seconds the song has played.\n\t\t*/\n return config.audio.currentTime;\n }\n\n /**\n * Allows the user to get the duration of the current song\n *\n * Public Accessor: Amplitude.getSongPlayed();\n *\n * @access public\n */\n function getSongDuration() {\n /*\n\t\t\tReturns the duration of the current song\n\t\t*/\n return config.audio.duration;\n }\n\n /**\n * Allows the user to set how far into the song they want to be. This is\n * helpful for implementing custom range sliders. Only works on the current song.\n *\n * Public Accessor: Amplitude.setSongPlayedPercentage( float );\n *\n * @access public\n * @param {number} percentage \t- The percentage of the song played\n */\n function setSongPlayedPercentage(percentage) {\n /*\n\t\t\tEnsures the percentage is a number and is between 0 and 100.\n\t\t*/\n if (typeof percentage == \"number\" && (percentage > 0 && percentage < 100)) {\n /*\n\t\t\t\t\tSets the current time of the song to the percentage.\n\t\t\t\t*/\n config.audio.currentTime = config.audio.duration * (percentage / 100);\n }\n }\n\n /**\n * Allows the user to turn on debugging.\n *\n * Public Accessor: Amplitude.setDebug( bool );\n *\n * @access public\n * @param {boolean} state \t\t- Turns debugging on and off.\n */\n function setDebug(state) {\n /*\n\t\t\tSets the global config debug on or off.\n\t\t*/\n config.debug = state;\n }\n\n /**\n * Returns the active song meta data for the user to do what is\n * needed.\n *\n * Public Accessor: Amplitude.getActiveSongMetadata();\n *\n * @access public\n * @returns {object} JSON Object with the active song information\n */\n function getActiveSongMetadata() {\n return config.active_metadata;\n }\n\n /**\n * Returns the active playlist meta data for the for the user to use.\n *\n * Public Accessor: Amplitude.getActivePlaylistMetadata();\n *\n * @access public\n * @returns {object} JSON representation for the active playlist\n */\n function getActivePlaylistMetadata() {\n return config.playlists[config.active_playlist];\n }\n\n /**\n * Returns a song in the songs array at that index\n *\n * Public Accessor: Amplitude.getSongAtIndex( song_index )\n *\n * @access public\n * @param {number} index \t- The integer for the index of the song in the songs array.\n * @returns {object} JSON representation for the song at a specific index.\n */\n function getSongAtIndex(index) {\n return config.songs[index];\n }\n\n /**\n * Returns a song at a playlist index\n *\n * Public Accessor: Amplitude.getSongAtPlaylistIndex( playlist, index\n *\n * @access public\n * @param {number} index \t\t\t- The integer for the index of the song in the playlist.\n * @param {string} playlist\t\t- The key of the playlist we are getting the song at the index for\n * @returns {object} JSON representation for the song at a specific index.\n */\n function getSongAtPlaylistIndex(playlist, index) {\n let song = config.playlists[playlist].songs[index];\n\n return song;\n }\n\n /**\n * Adds a song to the end of the config array. This will allow Amplitude\n * to play the song in a playlist type setting.\n *\n * Public Accessor: Amplitude.addSong( song_json )\n *\n * @access public\n * @param {object} song \t- JSON representation of a song.\n * @returns {number} New index of the song.\n */\n function addSong(song) {\n /*\n\t\t\tEnsures we have a songs array to push to.\n\t\t*/\n if (config.songs == undefined) {\n config.songs = [];\n }\n\n config.songs.push(song);\n\n if (config.shuffle_on) {\n config.shuffle_list.push(song);\n }\n\n if (SoundCloud.isSoundCloudURL(song.url)) {\n SoundCloud.resolveIndividualStreamableURL(\n song.url,\n null,\n config.songs.length - 1,\n config.shuffle_on\n );\n }\n\n return config.songs.length - 1;\n }\n\n /**\n * Adds a song to a playlist. This will allow Amplitude to play the song in the\n * playlist\n *\n * Public Accessor: Amplitude.addSongToPlaylist( song_json, playlist_key )\n *\n * @access public\n * @param {object} song \t\t\t- JSON representation of a song.\n * @param {string} playlist\t\t- Playlist we are adding the song to.\n * @returns {mixed} New index of song in playlist or null if no playlist exists\n */\n function addSongToPlaylist(song, playlist) {\n if (config.playlists[playlist] != undefined) {\n config.playlists[playlist].songs.push(song);\n\n if (config.playlists[playlist].shuffle) {\n config.playlists[playlist].shuffle_list.push(song);\n }\n\n if (SoundCloud.isSoundCloudURL(song.url)) {\n SoundCloud.resolveIndividualStreamableURL(\n song.url,\n playlist,\n config.playlists[playlist].songs.length - 1,\n config.playlists[playlist].shuffle\n );\n }\n\n return config.playlists[playlist].songs.length - 1;\n } else {\n Debug.writeMessage(\"Playlist doesn't exist!\");\n return null;\n }\n }\n\n /**\n * Adds a playlist to Amplitude.\n *\n * @param {string} key - The key of the playlist we are adding.\n * @param {object} data - The data relating to the playlist\n * @param {array} songs - The songs to add to the playlist\n */\n function addPlaylist(key, data, songs) {\n /*\n Ensures the playlist is not already defined.\n */\n if (config.playlists[key] == undefined) {\n /*\n Initialize the new playlist object.\n */\n config.playlists[key] = {};\n\n /*\n Define the ignored keys that we don't want to copy over.\n */\n let ignoredKeys = [\"repeat\", \"shuffle\", \"shuffle_list\", \"songs\", \"src\"];\n\n /*\n Iterate over all of the keys defined by the user and\n set them on the playlist.\n */\n for (let dataKey in data) {\n if (ignoredKeys.indexOf(dataKey) < 0) {\n config.playlists[key][dataKey] = data[dataKey];\n }\n }\n\n /*\n Initialize the default parameters for the playlist and set the songs.\n */\n config.playlists[key].songs = songs;\n config.playlists[key].active_index = null;\n config.playlists[key].repeat = false;\n config.playlists[key].shuffle = false;\n config.playlists[key].shuffle_list = [];\n\n return config.playlists[key];\n } else {\n Debug.writeMessage(\"A playlist already exists with that key!\");\n return null;\n }\n }\n\n /**\n * Removes a song from the song array\n *\n * Public Accessor: Amplitude.removeSong( index )\n *\n * @access public\n * @param {integer} index - Index of the song being removed\n * @returns {boolean} True if removed false if not.\n */\n function removeSong(index) {\n config.songs.splice(index, 1);\n }\n\n /**\n * Removes a song from the playlist\n *\n * Public Accessor: Amplitude.removeSongFromPlaylist( index, playlist )\n *\n * @access public\n * @param {integer} index \t\t\t- Index of the song being removed from the playlist.\n * @param {string} playlist\t\t\t- Playlist we are removing the song from.\n * @returns {boolean} True if removed false if not.\n */\n function removeSongFromPlaylist(index, playlist) {\n if (config.playlists[playlist] != undefined) {\n config.playlists[playlist].songs.splice(index, 1);\n }\n }\n\n /**\n * When you pass a song object it plays that song right awawy. It sets\n * the active song in the config to the song you pass in and synchronizes\n * the visuals.\n *\n * Public Accessor: Amplitude.playNow( song )\n *\n * @access public\n * @param {object} song \t- JSON representation of a song.\n */\n function playNow(song) {\n /*\n\t\t\tMakes sure the song object has a URL associated with it\n\t\t\tor there will be nothing to play.\n\t\t*/\n if (song.url) {\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n } else {\n /*\n\t\t\t\tWrite error message since the song passed in doesn't\n\t\t\t\thave a URL.\n\t\t\t*/\n Debug.writeMessage(\"The song needs to have a URL!\");\n }\n\n /*\n\t\t\tPlays the song.\n\t\t*/\n Core.play();\n\n /*\n\t\t\tSets the main song control status visual\n\t\t*/\n PlayPauseElements.sync();\n\n /*\n\t\t\tUpdate the song meta data\n\t\t*/\n MetaDataElements.displayMetaData();\n\n /*\n\t\t\tReset the song sliders, song progress bar info, and\n\t\t\treset times. This ensures everything stays in sync.\n\t\t*/\n SongSliderElements.resetElements();\n\n /*\n\t\t\tReset the song played progress elements.\n\t\t*/\n SongPlayedProgressElements.resetElements();\n\n /*\n\t\t\tReset all of the current time elements.\n\t\t*/\n TimeElements.resetCurrentTimes();\n\n /*\n\t\t\tReset all of the duration time elements.\n\t\t*/\n TimeElements.resetDurationTimes();\n\n /*\n Sets the state of the player.\n */\n ConfigState.setPlayerState();\n }\n\n /**\n * Plays a song at the index passed in from the songs array.\n *\n * Public Accessor: Amplitude.playSongAtIndex( index )\n *\n * @access public\n * @param {number} index \t- The number representing the song in the songs array.\n */\n function playSongAtIndex(index) {\n /*\n\t\t\t Stop the current song.\n\t\t*/\n Core.stop();\n\n /*\n\t\t\t Determine if there is a new playlist, if so set the active playlist and change the song.\n\t\t*/\n if (Checks.newPlaylist(null)) {\n AudioNavigation.setActivePlaylist(null);\n\n AudioNavigation.changeSong(config.songs[index], index);\n }\n\n /*\n\t\t\t Check if the song is new. If so, change the song.\n\t\t*/\n if (Checks.newSong(null, index)) {\n AudioNavigation.changeSong(config.songs[index], index);\n }\n\n /*\n\t\t\tPlay the song\n\t\t*/\n Core.play();\n\n /*\n Sets the state of the player.\n */\n ConfigState.setPlayerState();\n\n /*\n\t\t\tSync all of the play pause buttons.\n\t\t*/\n PlayPauseElements.sync();\n }\n\n /**\n * Plays a song at the index passed in for the playlist provided. The index passed\n * in should be the index of the song in the playlist and not the songs array.\n *\n * @access public\n * @param {number} index \t\t- The number representing the song in the playlist array.\n * @param {string} playlist - The key string representing the playlist we are playing the song from.\n *\n */\n function playPlaylistSongAtIndex(index, playlist) {\n Core.stop();\n\n /*\n\t\t\tDetermine if there is a new playlist, if so set the active playlist and change the song.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[index],\n index\n );\n }\n\n /*\n\t\t\tCheck if the song is new. If so, change the song.\n\t\t*/\n if (Checks.newSong(playlist, index)) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[index],\n index\n );\n }\n\n /*\n\t\t\tSync all of the play pause buttons.\n\t\t*/\n PlayPauseElements.sync();\n\n /*\n\t\t\tPlay the song\n\t\t*/\n Core.play();\n\n /*\n\t\t\tSet the state of the player\n\t\t*/\n ConfigState.setPlayerState();\n }\n\n /**\n * Allows the user to play whatever the active song is directly\n * through Javascript. Normally ALL of Amplitude functions that access\n * the core features are called through event handlers.\n *\n * Public Accessor: Amplitude.play();\n *\n * @access public\n */\n function play() {\n Core.play();\n\n ConfigState.setPlayerState();\n }\n\n /**\n * Allows the user to pause whatever the active song is directly\n * through Javascript. Normally ALL of Amplitude functions that access\n * the core features are called through event handlers.\n *\n * Public Accessor: Amplitude.pause();\n *\n * @access public\n */\n function pause() {\n Core.pause();\n\n ConfigState.setPlayerState();\n }\n\n /**\n * Returns the audio object used to play the audio\n *\n * Public Accessor: Amplitude.getAudio();\n *\n * @access public\n */\n function getAudio() {\n return config.audio;\n }\n\n /**\n * Returns the Web Audio API ANalyser used for visualizations.\n *\n * Public Accessor: Amplitude.getAnalyser()\n *\n * @access public\n */\n function getAnalyser() {\n return config.analyser;\n }\n\n /**\n * Plays the next song either in the playlist or globally.\n *\n * Public Accessor: Amplitude.next( playlist );\n *\n * @access public\n * @param {string} [playlist = null \t- The playlist key\n */\n function next(playlist = null) {\n let nextData = {};\n /*\n\t\t\tIf the playlist is empty or null, then we check the active\n\t\t\tplaylist\n\t\t*/\n if (playlist == \"\" || playlist == null) {\n /*\n\t\t\t\tIf the active playlist is null, then we set the next global\n\t\t\t\tsong or we set the next in the playlist.\n\t\t\t*/\n if (config.active_playlist == null || config.active_playlist == \"\") {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n } else {\n AudioNavigation.setNextPlaylist(playlist);\n }\n }\n\n /**\n * Plays the prev song either in the playlist or globally.\n *\n * Public Accessor: Amplitude.prev( playlist );\n *\n * @access public\n * @param {string} [playlist = null] \t- The playlist key\n */\n function prev(playlist = null) {\n let prevData = {};\n\n /*\n\t\t\tIf the playlist is empty or null, then we check the active\n\t\t\tplaylist\n\t\t*/\n if (playlist == \"\" || playlist == null) {\n /*\n\t\t\t\tIf the active playlist is null, then we set the prev global\n\t\t\t\tsong or we set the prev in the playlist.\n\t\t\t*/\n if (config.active_playlist == null || config.active_playlist == \"\") {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n } else {\n AudioNavigation.setPreviousPlaylist(playlist);\n }\n }\n\n /**\n * Gets all of the songs in the songs array\n *\n * Public Accessor: Amplitude.getSongs( );\n *\n * @access public\n */\n function getSongs() {\n return config.songs;\n }\n\n /**\n * Gets all of the songs in a playlist\n *\n * Public Accessor: Amplitude.getSongsInPlaylist( playlist );\n *\n * @access public\n * @param {string} playlist \t- The playlist key\n */\n function getSongsInPlaylist(playlist) {\n return config.playlists[playlist].songs;\n }\n\n /**\n * Get current state of songs. If shuffled, this will return the shuffled\n * songs.\n *\n * Public Accessor: Amplitude.getSongsState();\n *\n * @access public\n */\n function getSongsState() {\n if (config.shuffle_on) {\n return config.shuffle_list;\n } else {\n return config.songs;\n }\n }\n\n /**\n * Get current state of songs in playlist. If shuffled, this will return the\n * shuffled songs.\n *\n * Public Accessor: Amplitude.getSongsStatePlaylist( playlist );\n *\n * @access public\n * @param {string} playlist \t- The playlist key\n */\n function getSongsStatePlaylist(playlist) {\n if (config.playlists[playlist].shuffle) {\n return config.playlists[playlist].shuffle_list;\n } else {\n return config.playlists[playlist].songs;\n }\n }\n\n /**\n * Gets the active index of the player\n *\n * Public Accessor: Amplitude.getActiveIndex()\n *\n * @access public\n */\n function getActiveIndex() {\n return parseInt(config.active_index);\n }\n\n /**\n * Get the version of AmplitudeJS\n *\n * Public Accessor: Amplitude.getVersion()\n *\n * @access public\n */\n function getVersion() {\n return config.version;\n }\n\n /**\n * Get the buffered amount for the current song\n *\n * Public Accessor: Amplitude.getBuffered()\n *\n * @access public\n */\n function getBuffered() {\n return config.buffered;\n }\n\n /**\n * Skip to a certain location in a selected song.\n *\n * Public Accessor: Amplitude.getBuffered()\n *\n * @access public\n * @param {number} seconds \t\t\t\t\t\t- The amount of seconds we should skip to in the song.\n * @param {number} songIndex \t\t\t\t\t- The index of the song in the songs array.\n * @param {string} [playlist = null]\t- The playlist the song we are skipping to belogns to.\n */\n function skipTo(seconds, songIndex, playlist = null) {\n seconds = parseInt(seconds);\n\n if (playlist != null) {\n /*\n Checks if we are skipping to a new playlist\n */\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n }\n\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[songIndex],\n songIndex\n );\n Core.play();\n\n /*\n Sync all of the play pause elements.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncPlaylist();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(seconds);\n } else {\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSong(config.songs[songIndex], songIndex);\n Core.play();\n\n /*\n Syncs all of the play pause buttons now that we've skipped.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(seconds);\n }\n }\n\n /**\n * Sets the meta data for a song in the songs array. This will set any\n * meta data for a song besides the URL. The URL could cause issues if the\n * song was playing.\n *\n * Public Accessor: Amplitude.setSongMetaData()\n *\n * @access public\n * @param {number} index\t\t\t\t\t- The index of the song in the songs array.\n * @param {object} metaData \t\t\t- The object containing the meta data we are updating.\n * @param {string} playlist - The playlist we are updating the song meta data for.\n */\n function setSongMetaData(index, metaData, playlist = null) {\n /*\n Update the meta data for a song in a playlist.\n */\n if (\n playlist != \"\" &&\n playlist != null &&\n config.playlists[playlist] != undefined\n ) {\n /*\n Set all of the defined meta data properties\n */\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (key != \"url\" && key != \"URL\" && key != \"live\" && key != \"LIVE\") {\n config.playlists[playlist].songs[index][key] = metaData[key];\n }\n }\n }\n } else {\n /*\n Update the meta data for a song.\n */\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (key != \"url\" && key != \"URL\" && key != \"live\" && key != \"LIVE\") {\n config.songs[index][key] = metaData[key];\n }\n }\n }\n }\n\n /*\n Display the updates on the screen.\n */\n MetaDataElements.displayMetaData();\n MetaDataElements.syncMetaData();\n }\n\n function setPlaylistMetaData(playlist, metaData) {\n if (config.playlists[playlist] != undefined) {\n /*\n \t\t\tThese are the ignored keys that we won't be worrying about displaying.\n \t\t\tEvery other key in the playlist object can be displayed.\n \t\t*/\n let ignoredKeys = [\"repeat\", \"shuffle\", \"shuffle_list\", \"songs\", \"src\"];\n\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (ignoredKeys.indexOf(key) < 0) {\n config.playlists[playlist][key] = metaData[key];\n }\n }\n }\n\n MetaDataElements.displayPlaylistMetaData();\n } else {\n Debug.writeMessage(\"You must provide a valid playlist key!\");\n }\n }\n\n /**\n * Sets the delay between the songs when they are finished.\n *\n * Public Accessor: Amplitude.setDelay()\n *\n * @access public\n * @param {number} delay \t- The millisecond delay time between songs\n */\n function setDelay(time) {\n config.delay = time;\n }\n\n /**\n * Returns the current delay between songs.\n *\n * Public Accessor: Amplitude.getDelay()\n *\n * @access public\n */\n function getDelay() {\n return config.delay;\n }\n\n /**\n * Returns the state of the player.\n *\n * Public Accessor: Amplitude.getPlayerState();\n */\n function getPlayerState() {\n return config.player_state;\n }\n\n /**\n * Registers a visualization and sets that visualization's\n * preferences. When creating a visualization, you can set certain\n * preferences that the user can overwrite similar to Amplitude.\n * Public Accessor: Amplitude.registerVisualization( visualization, preferences )\n *\n * @param {object} visualzation A visualization object that gets registered\n * with Amplitude\n *\n * @param {object} preferences A JSON object of preferences relating to the\n * visualization\n */\n function registerVisualization(visualization, preferences) {\n Visualizations.register(visualization, preferences);\n }\n\n /**\n * Set the visualization for the playlist\n *\n * @param {string} playlist - The playlist we are setting the visualization for.\n * @param {string} visualizationKey - The key of the visualization we are adding to the playlist.\n */\n function setPlaylistVisualization(playlist, visualizationKey) {\n if (config.playlists[playlist] != undefined) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.playlists[playlist].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"The playlist for the key provided does not exist\");\n }\n }\n\n /**\n * Set a visualization for the song.\n *\n * @param {number} songIndex - The index of the song in the songs array we are setting the visualization for.\n * @param {string} visualizationKey - The key of the visualization we are adding to the playlist.\n */\n function setSongVisualization(songIndex, visualizationKey) {\n if (config.songs[songIndex]) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.songs[songIndex].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"A song at that index is undefined\");\n }\n }\n\n /**\n * Set song in playlist visualization.\n *\n * @param {string} playlist - The playlist we are setting the song visualization for.\n * @param {number} songIndex - The index we are setting the visualization for.\n * @param {strong} visualizationKey - The key of the visualization we are adding to the song in the playlist.\n */\n function setSongInPlaylistVisualization(\n playlist,\n songIndex,\n visualizationKey\n ) {\n if (config.playlists[playlist].songs[songIndex] != undefined) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.playlists[playlist].songs[\n songIndex\n ].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"The song in the playlist at that key is not defined\");\n }\n }\n\n /**\n * Sets the global visualization default.\n */\n function setGlobalVisualization(visualizationKey) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n }\n\n /**\n * Sets the active volume.\n * @param {number} volumeLevel - A number between 1 and 100 as a percentage of\n * min to max for a volume level.\n */\n function setVolume( volumeLevel ){\n Core.setVolume( volumeLevel );\n }\n\n /**\n * Gets the active volume.\n */\n function getVolume(){\n return config.volume;\n }\n\n /*\n\t\tReturns all of the publically accesible methods.\n\t*/\n return {\n init: init,\n getConfig: getConfig,\n bindNewElements: bindNewElements,\n getActivePlaylist: getActivePlaylist,\n getPlaybackSpeed: getPlaybackSpeed,\n setPlaybackSpeed: setPlaybackSpeed,\n getRepeat: getRepeat,\n getRepeatPlaylist: getRepeatPlaylist,\n getShuffle: getShuffle,\n getShufflePlaylist: getShufflePlaylist,\n setShuffle: setShuffle,\n setShufflePlaylist: setShufflePlaylist,\n setRepeat: setRepeat,\n setRepeatSong: setRepeatSong,\n setRepeatPlaylist: setRepeatPlaylist,\n getDefaultAlbumArt: getDefaultAlbumArt,\n setDefaultAlbumArt: setDefaultAlbumArt,\n getDefaultPlaylistArt: getDefaultPlaylistArt,\n setDefaultPlaylistArt: setDefaultPlaylistArt,\n getSongPlayedPercentage: getSongPlayedPercentage,\n setSongPlayedPercentage: setSongPlayedPercentage,\n getSongPlayedSeconds: getSongPlayedSeconds,\n getSongDuration: getSongDuration,\n setDebug: setDebug,\n getActiveSongMetadata: getActiveSongMetadata,\n getActivePlaylistMetadata: getActivePlaylistMetadata,\n getSongAtIndex: getSongAtIndex,\n getSongAtPlaylistIndex: getSongAtPlaylistIndex,\n addSong: addSong,\n addSongToPlaylist: addSongToPlaylist,\n removeSong: removeSong,\n removeSongFromPlaylist: removeSongFromPlaylist,\n playNow: playNow,\n playSongAtIndex: playSongAtIndex,\n playPlaylistSongAtIndex: playPlaylistSongAtIndex,\n play: play,\n pause: pause,\n getAudio: getAudio,\n getAnalyser: getAnalyser,\n next: next,\n prev: prev,\n getSongs: getSongs,\n getSongsInPlaylist: getSongsInPlaylist,\n getSongsState: getSongsState,\n getSongsStatePlaylist: getSongsStatePlaylist,\n getActiveIndex: getActiveIndex,\n getVersion: getVersion,\n getBuffered: getBuffered,\n skipTo: skipTo,\n setSongMetaData: setSongMetaData,\n setPlaylistMetaData: setPlaylistMetaData,\n setDelay: setDelay,\n getDelay: getDelay,\n getPlayerState: getPlayerState,\n addPlaylist: addPlaylist,\n registerVisualization: registerVisualization,\n setPlaylistVisualization: setPlaylistVisualization,\n setSongVisualization: setSongVisualization,\n setSongInPlaylistVisualization: setSongInPlaylistVisualization,\n setGlobalVisualization: setGlobalVisualization,\n getVolume: getVolume,\n setVolume: setVolume\n };\n})();\n\nexport default Amplitude;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Checks Utility.\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * AmplitudeJS Visual Meta Data Elements Module\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * AmplitudeJS SoundCloud Meta module\n * @module soundcloud/Soundcloud\n */\nimport SoundCloud from \"../soundcloud/soundcloud.js\";\n\n/**\n * Handles the initialization of the playlists.\n *\n * @module init/PlaylistsInitializer\n */\nlet PlaylistsInitializer = (function() {\n /**\n * Initializes the playlists for AmplitudeJS\n *\n * @param {Object} playlists - The playlists defined by the user.\n */\n function initialize(playlists) {\n /*\n Copy the playlists over to Amplitude\n */\n config.playlists = playlists;\n\n /*\n Copy songs over from songs array.\n */\n copySongsToPlaylists();\n\n /*\n Grab any SoundCloud Data for the playlist songs if needed.\n */\n grabSoundCloudData();\n\n /*\n Initialize a scoped active index for each playlist.\n */\n initializePlaylistActiveIndexes();\n\n /*\n Initialize the shuffle status of the playlists.\n */\n initializePlaylistShuffleStatuses();\n\n /*\n Initialize the repeat status for the playlits.\n */\n initializePlaylistsRepeatStatuses();\n\n /*\n Initialize temporary place holders for shuffle lists.\n */\n initializePlaylistShuffleLists();\n\n /*\n Initializes the first song in the playlist\n */\n initializeFirstSongInPlaylistMetaData();\n }\n\n /**\n * Initializes a scoped active index for each playlist.\n *\n * @access private\n */\n function initializePlaylistActiveIndexes() {\n /*\n \t\tIterate over all of the playlists defined by the user\n and add an active index.\n\t\t*/\n for (let key in config.playlists) {\n config.playlists[key].active_index = null;\n }\n }\n\n /**\n * Ensures the indexes in the playlists are valid indexes. The song has\n * to exist in the Amplitude config to be played correctly. If the index\n * is an integer, we ensure it exists and coy it to the array.\n *\n * @access private\n */\n function copySongsToPlaylists() {\n /*\n Iterate over all of the config's playlists\n */\n for (let key in config.playlists) {\n /*\n Checks if the playlist key is accurate.\n */\n if (config.playlists.hasOwnProperty(key)) {\n /*\n Checks if the playlist has songs.\n */\n if (config.playlists[key].songs) {\n /*\n Iterate over all of the songs in the playlist\n */\n for (let i = 0; i < config.playlists[key].songs.length; i++) {\n if (Checks.isInt(config.playlists[key].songs[i])) {\n config.playlists[key].songs[i] =\n config.songs[config.playlists[key].songs[i]];\n\n config.playlists[key].songs[i].index = i;\n }\n /*\n Check to see if the index for the song in the playlist\n exists in the songs config.\n */\n if (\n Checks.isInt(config.playlists[key].songs[i]) &&\n !config.songs[config.playlists[key].songs[i]]\n ) {\n Debug.writeMessage(\n \"The song index: \" +\n config.playlists[key].songs[i] +\n \" in playlist with key: \" +\n key +\n \" is not defined in your songs array!\"\n );\n }\n\n /*\n If not an int, then is a dedicated song, just set the index.\n */\n if (!Checks.isInt(config.playlists[key].songs[i]) ){\n config.playlists[key].songs[i].index = i;\n }\n }\n }\n }\n }\n }\n\n /**\n * Grabs the SoundCloud data for any song in the playlist that\n * the user needs to grab data for.\n *\n * @access private\n */\n function grabSoundCloudData() {\n /*\n Iterate over all of the config's playlists\n */\n for (let key in config.playlists) {\n /*\n Checks if the playlist key is accurate.\n */\n if (config.playlists.hasOwnProperty(key)) {\n /*\n Iterate over all of the songs in the playlist and see if\n they need to grab the SoundCloud data for the song.\n */\n for (let i = 0; i < config.playlists[key].songs.length; i++) {\n /*\n Only Grab the data if the URL is a SoundCloud URL.\n */\n if (SoundCloud.isSoundCloudURL(config.playlists[key].songs[i].url)) {\n /*\n Only grab the data if the SoundCloud data has not already been\n grabbed for the audio. This could happen if the user defined the\n song in the songs array and was grabbed before.\n */\n if (config.playlists[key].songs[i].soundcloud_data == undefined) {\n SoundCloud.resolveIndividualStreamableURL(\n config.playlists[key].songs[i].url,\n key,\n i\n );\n }\n }\n }\n }\n }\n }\n\n /**\n * Initializes the shuffle statuses for each of the playlists. These will\n * be referenced when we shuffle individual playlists.\n *\n * @access private\n */\n function initializePlaylistShuffleStatuses() {\n /*\n\t\t\tIterate over all of the playlists the user defined adding\n\t\t\tthe playlist key to the shuffled playlist array and creating\n\t\t\tand empty object to house the statuses.\n\t\t*/\n for (let key in config.playlists) {\n config.playlists[key].shuffle = false;\n }\n }\n\n /**\n * Initializes the repeat statuses for each of the playlists. These will\n * be referenced when we repeat individual playlits.\n *\n * @access private\n */\n function initializePlaylistsRepeatStatuses() {\n /*\n Iterate over all of the playlists the user defined adding\n the playlist key to the repeated playlist array and creating\n and empty object to house the statuses.\n */\n for (let key in config.playlists) {\n config.playlists[key].repeat = false;\n }\n }\n\n /**\n * Initializes the shuffled playlist placeholders. These will be set for\n * playlists that are shuffled and contain the shuffled songs.\n *\n * @access private\n */\n function initializePlaylistShuffleLists() {\n /*\n \t\t\tIterate over all of the playlists the user defined adding\n \t\t\tthe playlist key to the shuffled playlists array and creating\n \t\t\tand empty object to house the shuffled playlists\n \t\t*/\n for (let key in config.playlists) {\n config.playlists[key].shuffle_list = [];\n }\n }\n\n /**\n * Intializes the display for the first song in the playlist meta data.\n *\n * @access private\n */\n function initializeFirstSongInPlaylistMetaData() {\n /*\n\t\t\tIterates over all of the playlists setting the meta data for the\n\t\t\tfirst song.\n\t\t*/\n for (let key in config.playlists) {\n MetaDataElements.setFirstSongInPlaylist(\n config.playlists[key].songs[0],\n key\n );\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n initialize: initialize\n };\n})();\n\nexport default PlaylistsInitializer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/init/playlists.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the container elements.\n *\n * @param visual/ContainerElements\n */\nlet ContainerElements = (function() {\n /**\n * Applies the class 'amplitude-active-song-container' to the element\n * containing visual information regarding the active song.\n *\n * @access public\n */\n function setActive() {\n /*\n Gets all of the song container elements.\n */\n let songContainers = document.getElementsByClassName(\n \"amplitude-song-container\"\n );\n\n /*\n\t\t\tRemoves all of the active song containrs.\n\t\t*/\n for (let i = 0; i < songContainers.length; i++) {\n songContainers[i].classList.remove(\"amplitude-active-song-container\");\n }\n\n /*\n\t\t\tFinds the active index and adds the active song container to the element\n\t\t\tthat represents the song at the index.\n\t\t*/\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n let activeIndex = '';\n\n if( config.shuffle_on ){\n activeIndex = config.shuffle_list[ config.active_index ].index;\n }else{\n activeIndex = config.active_index;\n }\n\n if (\n document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activeIndex +\n '\"]'\n )\n ) {\n let songContainers = document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activeIndex +\n '\"]'\n );\n\n for (let i = 0; i < songContainers.length; i++) {\n if (!songContainers[i].hasAttribute(\"data-amplitude-playlist\")) {\n songContainers[i].classList.add(\"amplitude-active-song-container\");\n }\n }\n }\n } else {\n if( config.active_playlist != null && config.active_playlist != '' ){\n var activePlaylistIndex = config.playlists[ config.active_playlist ].active_index;\n }else{\n var activePlaylistIndex = '';\n\n if( config.playlists[ config.active_playlist ].shuffle ){\n activePlaylistIndex = config.playlists[ config.active_playlist ].shuffle_list[ config.playlists[config.active_playlist].active_index ].index;\n }else{\n activePlaylistIndex = config.playlists[ config.active_playlist ].active_index;\n }\n }\n\n if (\n document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n )\n ) {\n let songContainers = document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < songContainers.length; i++) {\n songContainers[i].classList.add(\"amplitude-active-song-container\");\n }\n }\n }\n }\n\n return {\n setActive: setActive\n };\n})();\n\nexport default ContainerElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/containerElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time hour elements.\n *\n * @module visual/time/CurrentHourElements\n */\nlet CurrentHourElements = (function() {\n function sync(hours) {\n syncGlobal(hours);\n syncPlaylist(hours);\n syncSong(hours);\n syncSongInPlaylist(hours);\n }\n\n /**\n * Updates any elements that display the current hour for the song.\n *\n * @access public\n * @param {number} hours \t- An integer conaining how many hours into the song.\n */\n function syncGlobal(hours) {\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourSelectors = document.querySelectorAll(\n \".amplitude-current-hours\"\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourSelectors.length; i++) {\n let playlist = currentHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the playlist current hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncPlaylist(hours) {\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourPlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourPlaylistSelectors.length; i++) {\n let songIndex = currentHourPlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (songIndex == null) {\n currentHourPlaylistSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the song hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncSong(hours) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the hour selectors\n \t\t*/\n const currentHourSongSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current hour selector's inner html to hours passed in.\n \t\t*/\n for (let i = 0; i < currentHourSongSelectors.length; i++) {\n let playlist = currentHourSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (playlist == null) {\n currentHourSongSelectors[i].innerHTML = hours;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist song hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncSongInPlaylist(hours) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourPlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourPlaylistSongSelectors.length; i++) {\n currentHourPlaylistSongSelectors[i].innerHTML = hours;\n }\n }\n\n /**\n * Reset the current hour elements.\n */\n function resetTimes() {\n /*\n Gets the hour display elements\n */\n let hourSelectors = document.querySelectorAll(\".amplitude-current-hours\");\n\n /*\n Iterates over all of the hour selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < hourSelectors.length; i++) {\n hourSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentHourElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentHourElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time minutes elements.\n *\n * @module visual/time/CurrentMinuteElements\n */\nlet CurrentMinuteElements = (function() {\n /**\n * Syncs the current minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function sync(minutes) {\n syncGlobal(minutes);\n syncPlaylist(minutes);\n syncSong(minutes);\n syncSongInPlaylist(minutes);\n }\n\n /**\n * Syncs the global current minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncGlobal(minutes) {\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinuteSelectors = document.querySelectorAll(\n \".amplitude-current-minutes\"\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinuteSelectors.length; i++) {\n let playlist = currentMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the playlist minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncPlaylist(minutes) {\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinutePlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinutePlaylistSelectors.length; i++) {\n let songIndex = currentMinutePlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (songIndex == null) {\n currentMinutePlaylistSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the current song minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncSong(minutes) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the minute selectors\n \t\t*/\n const currentMinuteSongSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current minute selector's inner html to minutes passed in.\n \t\t*/\n for (let i = 0; i < currentMinuteSongSelectors.length; i++) {\n let playlist = currentMinuteSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (playlist == null) {\n currentMinuteSongSelectors[i].innerHTML = minutes;\n }\n }\n }\n }\n\n /**\n * Syncs the current song in playlist minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncSongInPlaylist(minutes) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinutePlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinutePlaylistSongSelectors.length; i++) {\n currentMinutePlaylistSongSelectors[i].innerHTML = minutes;\n }\n }\n\n /**\n * Reset the current times.\n */\n function resetTimes() {\n /*\n Gets the minute display elements\n */\n let minuteSelectors = document.querySelectorAll(\n \".amplitude-current-minutes\"\n );\n\n /*\n Iterates over all of the minute selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < minuteSelectors.length; i++) {\n minuteSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentMinuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentMinuteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time seconds elements.\n *\n * @module visual/time/CurrentSecondElements\n */\nlet CurrentSecondElements = (function() {\n /**\n * Syncs the current seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function sync(seconds) {\n syncGlobal(seconds);\n syncPlaylist(seconds);\n syncSong(seconds);\n syncSongInPlaylist(seconds);\n }\n\n /**\n * Syncs the global current seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncGlobal(seconds) {\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondSelectors = document.querySelectorAll(\n \".amplitude-current-seconds\"\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondSelectors.length; i++) {\n let playlist = currentSecondSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the playlist seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncPlaylist(seconds) {\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondPlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondPlaylistSelectors.length; i++) {\n let songIndex = currentSecondPlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (songIndex == null) {\n currentSecondPlaylistSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the current song seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncSong(seconds) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the second selectors\n \t\t*/\n const currentSecondSongSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current second selector's inner html to seconds passed in.\n \t\t*/\n for (let i = 0; i < currentSecondSongSelectors.length; i++) {\n let playlist = currentSecondSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (playlist == null) {\n currentSecondSongSelectors[i].innerHTML = seconds;\n }\n }\n }\n }\n\n /**\n * Syncs the current song in playlist seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncSongInPlaylist(seconds) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondPlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondPlaylistSongSelectors.length; i++) {\n currentSecondPlaylistSongSelectors[i].innerHTML = seconds;\n }\n }\n\n /**\n * Reset the current seconds elements.\n */\n function resetTimes() {\n /*\n Gets the second display elements\n */\n let secondSelectors = document.querySelectorAll(\n \".amplitude-current-seconds\"\n );\n\n /*\n Iterates over all of the second selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < secondSelectors.length; i++) {\n secondSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentSecondElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentSecondElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * These methods help sync visual time elements.\n *\n * @module visual/CurrentTimeElements\n */\nlet CurrentTimeElements = (function() {\n /**\n * Visually displays the current time on the screen. This is called on\n * time update for the current song.\n *\n * @access public\n * @param {object} currentTime \t\t\t\t\t- An object containing the current time for the song in seconds, minutes, and hours.\n */\n function sync(currentTime) {\n /*\n\t\t\tSet current time display.\n\t\t*/\n syncGlobal(currentTime);\n syncPlaylist(currentTime);\n syncSong(currentTime);\n syncSongInPlaylist(currentTime);\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncGlobal(time) {\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n \".amplitude-current-time\"\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let playlist = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncPlaylist(time) {\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let songIndex = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncSong(time) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the time selectors.\n \t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the time selector's inner html to the current time for the song. The current\n \t\t\ttime is computed by joining minutes and seconds.\n \t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let playlist = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncSongInPlaylist(time) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n\n /**\n * Resets the current time displays to 00:00\n *\n * @access public\n */\n function resetTimes() {\n /*\n\t\t\tGets the time selector display elements\n\t\t*/\n let timeSelectors = document.querySelectorAll(\".amplitude-current-time\");\n\n /*\n\t\t\tIterates over all of the time selectors and sets the inner HTML\n\t\t\tto 00.\n\t\t*/\n for (let i = 0; i < timeSelectors.length; i++) {\n timeSelectors[i].innerHTML = \"00:00\";\n }\n }\n\n /**\n * Returns the publically facing methods\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentTimeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration countdown elements.\n *\n * @module visual/time/DurationCountDownTimeElements.\n */\nlet DurationCountDownTimeElements = (function() {\n /**\n * Syncs all of the countdown time elements.\n *\n * @param {object} countDownTime - The current time of the audio.\n * @param {object} songDuration - The song duration of the audio.\n */\n function sync(countDownTime, songDuration) {\n let timeRemaining = computeTimeRemaining(countDownTime, songDuration);\n\n syncGlobal(timeRemaining);\n syncPlaylist(timeRemaining);\n syncSong(timeRemaining);\n syncSongInPlaylist(timeRemaining);\n }\n\n /**\n * Syncs the global count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncGlobal(timeRemaining) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n \".amplitude-time-remaining\"\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let playlist = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n\n /**\n * Syncs the playlist count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncPlaylist(timeRemaining) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let songIndex = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n\n /**\n * Syncs the song count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncSong(timeRemaining) {\n if (config.active_playlist == null) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let playlist = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncSongInPlaylist(timeRemaining) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n\n /**\n * Resets the count down times.\n */\n function resetTimes() {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n \".amplitude-time-remaining\"\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n durationTimeRemainingSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Computes the time remaining for the audio.\n *\n * @param {object} currentTime - The current time of the audio.\n * @param {object} songDuration - The duration of the audio.\n */\n function computeTimeRemaining(currentTime, songDuration) {\n let timeRemaining = \"00:00\";\n\n /*\n Initialize the total current seconds and total duration seconds\n */\n let totalCurrentSeconds =\n parseInt(currentTime.seconds) +\n parseInt(currentTime.minutes) * 60 +\n parseInt(currentTime.hours) * 60 * 60;\n let totalDurationSeconds =\n parseInt(songDuration.seconds) +\n parseInt(songDuration.minutes) * 60 +\n parseInt(songDuration.hours) * 60 * 60;\n\n /*\n If the two variables are numbers we continue the computing.\n */\n if (!isNaN(totalCurrentSeconds) && !isNaN(totalDurationSeconds)) {\n /*\n Find the total remaining seconds.\n */\n let timeRemainingTotalSeconds =\n totalDurationSeconds - totalCurrentSeconds;\n\n var remainingHours = Math.floor(timeRemainingTotalSeconds / 3600);\n var remainingMinutes = Math.floor(\n (timeRemainingTotalSeconds - remainingHours * 3600) / 60\n );\n var remainingSeconds =\n timeRemainingTotalSeconds -\n remainingHours * 3600 -\n remainingMinutes * 60;\n\n timeRemaining =\n (remainingMinutes < 10 ? \"0\" + remainingMinutes : remainingMinutes) +\n \":\" +\n (remainingSeconds < 10 ? \"0\" + remainingSeconds : remainingSeconds);\n\n if (remainingHours > 0) {\n timeRemaining = remainingHours + \":\" + timeRemaining;\n }\n }\n\n return timeRemaining;\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationCountDownTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationCountDownTimeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration hours elements.\n *\n * @module visual/time/DurationHourElements.\n */\nlet DurationHourElements = (function() {\n /**\n * Sync the duration hours elements.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function sync(hours) {\n syncGlobal(hours);\n syncPlaylist(hours);\n syncSong(hours);\n syncSongInPlaylist(hours);\n }\n\n /**\n * Syncs the global duration hours elements.\n *\n * @param {Integer} hours - the duration hours for the audio.\n */\n function syncGlobal(hours) {\n let durationHourSelectors = document.querySelectorAll(\n \".amplitude-duration-hours\"\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let playlist = durationHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the playlist duration hours for the audio.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function syncPlaylist(hours) {\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let songIndex = durationHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the song duration hours.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function syncSong(hours) {\n if (config.active_playlist == null) {\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let playlist = durationHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration hours.\n *\n * @param {Integer} hours - The duration hours of the audio.\n */\n function syncSongInPlaylist(hours) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n\n /**\n * Resets the duration shours elements to '00'\n */\n function resetTimes() {\n let durationHourSelectors = document.querySelectorAll(\n \".amplitude-duration-hours\"\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n durationHourSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationHourElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationHourElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration minutes elements.\n *\n * @module visual/time/DurationMinuteElements.\n */\nlet DurationMinuteElements = (function() {\n /**\n * Sync the duration minutes elements.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function sync(minutes) {\n syncGlobal(minutes);\n syncPlaylist(minutes);\n syncSong(minutes);\n syncSongInPlaylist(minutes);\n }\n\n /**\n * Syncs the global duration minutes elements.\n *\n * @param {Integer} minutes - the duration minutes for the audio.\n */\n function syncGlobal(minutes) {\n let durationMinuteSelectors = document.querySelectorAll(\n \".amplitude-duration-minutes\"\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let playlist = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the playlist duration minutes for the audio.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function syncPlaylist(minutes) {\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let songIndex = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the song duration minutes.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function syncSong(minutes) {\n if (config.active_playlist == null) {\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let playlist = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration minutes.\n *\n * @param {Integer} minutes - The duration minutes of the audio.\n */\n function syncSongInPlaylist(minutes) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n\n /**\n * Resets the duration minutes elements to '00'\n */\n function resetTimes() {\n let durationMinuteSelectors = document.querySelectorAll(\n \".amplitude-duration-minutes\"\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n durationMinuteSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationMinuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationMinuteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration seconds elements.\n *\n * @module visual/time/DurationSecondElements.\n */\nlet DurationSecondElements = (function() {\n /**\n * Sync the duration seconds elements.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function sync(seconds) {\n syncGlobal(seconds);\n syncPlaylist(seconds);\n syncSong(seconds);\n syncSongInPlaylist(seconds);\n }\n\n /**\n * Syncs the global duration seconds elements.\n *\n * @param {Integer} seconds - the duration seconds for the audio.\n */\n function syncGlobal(seconds) {\n let durationSecondSelectors = document.querySelectorAll(\n \".amplitude-duration-seconds\"\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let playlist = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the playlist duration seconds for the audio.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function syncPlaylist(seconds) {\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let songIndex = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the song duration seconds.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function syncSong(seconds) {\n if (config.active_playlist == null) {\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let playlist = durationSecondSelectors[i].getAttribute(\n \"data--amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration seconds.\n *\n * @param {Integer} seconds - The duration seconds of the audio.\n */\n function syncSongInPlaylist(seconds) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n\n /**\n * Resets the duration seconds elements to '00'\n */\n function resetTimes() {\n let durationSecondSelectors = document.querySelectorAll(\n \".amplitude-duration-seconds\"\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n durationSecondSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationSecondElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationSecondElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration time elements.\n *\n * @module visual/time/DurationTimeElements.\n */\nlet DurationTimeElements = (function() {\n /**\n * Syncs the duration time for all elements.\n *\n * @param {Object} durationTime - The object containing all of the song duration times.\n */\n function sync(durationTime) {\n let durationText = computeDurationText(durationTime);\n\n syncGlobal(durationText);\n syncPlaylist(durationText);\n syncSong(durationText);\n syncSongInPlaylist(durationText);\n }\n\n /**\n * Sync the global song duration elements.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncGlobal(durationText) {\n let durationTimeSelectors = document.querySelectorAll(\n \".amplitude-duration-time\"\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let playlist = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n\n /**\n * Sync the playlist duration times.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncPlaylist(durationText) {\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let songIndex = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n\n /**\n * Sync the song duration times.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncSong(durationText) {\n if (config.active_playlist == null) {\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let playlist = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n }\n\n /**\n * Sync the song in playlist duration times.\n *\n * @param {Object} durationText - An object containing the duration text.\n */\n function syncSongInPlaylist(durationText) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n\n /**\n * Resets all of the duration times to empty.\n */\n function resetTimes() {\n let durationTimeSelectors = document.querySelectorAll(\n \".amplitude-duration-time\"\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n durationTimeSelectors[i].innerHTML = \"00:00\";\n }\n }\n\n /**\n * Computes the duration text\n *\n * @param {Object} durationTime - An object containint the duration times.\n */\n function computeDurationText(durationTime) {\n var durationText = \"00:00\";\n\n if (!isNaN(durationTime.minutes) && !isNaN(durationTime.seconds)) {\n durationText = durationTime.minutes + \":\" + durationTime.seconds;\n if (!isNaN(durationTime.hours) && durationTime.hours > 0) {\n durationText = durationTime.hours + \":\" + durationText;\n }\n }\n\n return durationText;\n }\n\n /**\n * Return publically accessible methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationTimeElements.js","module.exports = {\"name\":\"amplitudejs\",\"version\":\"5.0.1\",\"description\":\"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs\",\"main\":\"dist/amplitude.js\",\"devDependencies\":{\"babel-core\":\"^6.26.3\",\"babel-loader\":\"^7.1.5\",\"babel-plugin-add-module-exports\":\"0.2.1\",\"babel-polyfill\":\"^6.26.0\",\"babel-preset-es2015\":\"^6.18.0\",\"husky\":\"^1.3.1\",\"jest\":\"^23.6.0\",\"prettier\":\"1.15.1\",\"pretty-quick\":\"^1.11.1\",\"watch\":\"^1.0.2\",\"webpack\":\"^2.7.0\"},\"directories\":{\"doc\":\"docs\"},\"files\":[\"dist\"],\"scripts\":{\"build\":\"node_modules/.bin/webpack\",\"watch\":\"watch 'node_modules/.bin/webpack' dist\",\"prettier\":\"npx pretty-quick\",\"test\":\"jest\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/521dimensions/amplitudejs.git\"},\"keywords\":[\"webaudio\",\"html5\",\"javascript\",\"audio-player\"],\"author\":\"521 Dimensions (https://521dimensions.com)\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/521dimensions/amplitudejs/issues\"},\"homepage\":\"https://github.com/521dimensions/amplitudejs#readme\"}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./package.json\n// module id = 59\n// module chunks = 0 1"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap c928b168697f944252b1","webpack:///./src/config.js","webpack:///./src/core/core.js","webpack:///./src/visual/playPauseElements.js","webpack:///./src/utilities/audioNavigation.js","webpack:///./src/utilities/debug.js","webpack:///./src/utilities/checks.js","webpack:///./src/utilities/configState.js","webpack:///./src/utilities/callbacks.js","webpack:///./src/visual/metaDataElements.js","webpack:///./src/visual/repeatElements.js","webpack:///./src/visual/muteElements.js","webpack:///./src/visual/volumeSliderElements.js","webpack:///./src/utilities/repeater.js","webpack:///./src/utilities/shuffler.js","webpack:///./src/visual/songSliderElements.js","webpack:///./src/visual/timeElements.js","webpack:///./src/fx/visualizations.js","webpack:///./src/soundcloud/soundcloud.js","webpack:///./src/visual/playbackSpeedElements.js","webpack:///./src/visual/shuffleElements.js","webpack:///./src/visual/songPlayedProgressElements.js","webpack:///./src/init/init.js","webpack:///./src/fx/waveform.js","webpack:///./src/utilities/time.js","webpack:///./src/visual/bufferedProgressElements.js","webpack:///./src/events/ended.js","webpack:///./src/events/events.js","webpack:///./src/events/keydown.js","webpack:///./src/events/mute.js","webpack:///./src/events/next.js","webpack:///./src/events/pause.js","webpack:///./src/events/play.js","webpack:///./src/events/playPause.js","webpack:///./src/events/playbackSpeed.js","webpack:///./src/events/prev.js","webpack:///./src/events/progress.js","webpack:///./src/events/repeat.js","webpack:///./src/events/repeatSong.js","webpack:///./src/events/shuffle.js","webpack:///./src/events/skipTo.js","webpack:///./src/events/songSlider.js","webpack:///./src/events/stop.js","webpack:///./src/events/timeUpdate.js","webpack:///./src/events/volumeDown.js","webpack:///./src/events/volumeSlider.js","webpack:///./src/events/volumeUp.js","webpack:///./src/fx/fx.js","webpack:///./src/index.js","webpack:///./src/init/playlists.js","webpack:///./src/visual/containerElements.js","webpack:///./src/visual/time/currentHourElements.js","webpack:///./src/visual/time/currentMinuteElements.js","webpack:///./src/visual/time/currentSecondElements.js","webpack:///./src/visual/time/currentTimeElements.js","webpack:///./src/visual/time/durationCountDownTimeElements.js","webpack:///./src/visual/time/durationHourElements.js","webpack:///./src/visual/time/durationMinuteElements.js","webpack:///./src/visual/time/durationSecondElements.js","webpack:///./src/visual/time/durationTimeElements.js","webpack:///./package.json"],"names":["module","exports","version","audio","Audio","active_metadata","active_album","active_index","active_playlist","playback_speed","callbacks","songs","playlists","start_song","starting_playlist","starting_playlist_song","repeat","repeat_song","shuffle_list","shuffle_on","default_album_art","default_playlist_art","debug","volume","pre_mute_volume","volume_increment","volume_decrement","soundcloud_client","soundcloud_use_art","soundcloud_song_count","soundcloud_songs_ready","is_touch_moving","buffered","bindings","continue_next","delay","player_state","web_audio_api_available","context","source","analyser","visualizations","available","active","backup","waveforms","sample_rate","built","Core","play","Visualizations","stop","run","config","live","reconnectStream","test","navigator","userAgent","paused","playPromise","undefined","then","catch","playbackRate","pause","disconnectStream","currentTime","Callbacks","setVolume","volumeLevel","muted","setSongLocation","songPercentage","duration","skipToLocation","seconds","addEventListener","Debug","writeMessage","once","src","load","url","setPlaybackSpeed","playbackSpeed","PlayPauseElements","sync","syncGlobal","syncPlaylist","syncSong","syncSongInPlaylist","state","playPauseElements","document","querySelectorAll","i","length","playlist","getAttribute","song","setElementPlay","setElementPause","playlistPlayPauseElements","songPlayPauseElements","activePlaylistIndex","songInPlaylistPlayPauseElements","syncToPause","element","classList","add","remove","AudioNavigation","setNext","songEnded","nextIndex","nextSong","endOfList","index","parseInt","changeSong","setNextPlaylist","shuffle","setActivePlaylist","changeSongPlaylist","setPrevious","previousIndex","previousSong","setPreviousPlaylist","prepareSongChange","album","afterSongChange","SongSliderElements","resetElements","SongPlayedProgressElements","TimeElements","resetCurrentTimes","Checks","newAlbum","MetaDataElements","displayMetaData","ContainerElements","setActive","resetDurationTimes","message","console","log","newSong","songIndex","newPlaylist","isURL","pattern","isInt","int","isNaN","Number","ConfigState","resetConfig","setPlayerState","initialize","callbackName","callbackFunction","error","imageMetaDataKeys","songInfoElements","info","val","indexOf","setAttribute","innerHTML","displayPlaylistMetaData","playlistInfoElements","setFirstSongInPlaylist","elementPlaylist","syncMetaData","RepeatElements","syncRepeat","repeatClasses","getElementsByClassName","syncRepeatPlaylist","repeatButtons","syncRepeatSong","repeatSongClasses","MuteElements","setMuted","muteClasses","VolumeSliderElements","volumeSliders","value","Repeater","setRepeat","setRepeatPlaylist","setRepeatSong","Shuffler","setShuffle","shuffleSongs","toggleShuffle","setShufflePlaylist","shufflePlaylistSongs","toggleShufflePlaylist","shuffleTemp","Array","randNum","Math","floor","random","shuffleSwap","shuffleList","original","temp","location","syncMain","mainSongSliders","playlistSongSliders","playlistAttribute","songAttribute","songSliders","songInPlaylistSliders","CurrentTimeElements","resetTimes","CurrentHourElements","CurrentMinuteElements","CurrentSecondElements","syncCurrentTimes","hours","minutes","DurationCountDownTimeElements","DurationHourElements","DurationMinuteElements","DurationSecondElements","DurationTimeElements","syncDurationTimes","songDuration","visualizationElements","Object","keys","runGlobalVisualization","runPlaylistVisualization","runSongVisualization","runSongInPlaylistVisualization","displayBackups","globalVisualizationIndex","visualization","activeSongVisualizationIndex","addToActiveVisualizations","firstVisualization","activePlaylistVisualizationIndex","key","setPreferences","startVisualization","push","stopVisualization","register","preferences","newVisualization","getID","x","displayGlobalBackup","displayPlaylistBackup","displaySongBackup","displaySongInPlaylistBackup","style","backgroundImage","cover_art_url","SoundCloud","tempUserConfig","loadSoundCloud","userConfig","head","getElementsByTagName","script","createElement","type","onreadystatechange","initSoundcloud","onload","appendChild","SC","client_id","getStreamableURLs","soundcloud_regex","match","resolveStreamable","resolveIndividualStreamableURL","addToShuffleList","get","sound","streamable","stream_url","artwork_url","soundcloud_data","AmplitudeHelpers","writeDebugMessage","name","artist","AmplitudeInitializer","setConfig","isSoundCloudURL","PlaybackSpeedElements","playbackSpeedClasses","ShuffleElements","shuffleButtons","songPlayedPercentage","percentage","songPlayedProgressBars","max","Initializer","ready","Events","setArt","Fx","webAudioAPIAvailable","determineUsingAnyFX","configureWebAudioAPI","documentElement","resume","WaveForm","init","object","params","initializeDefaultLiveSettings","initializeDefaultSongIndexes","rebindDisplay","countPlaylists","PlaylistsInitializer","preload","initializeElements","size","hasOwnProperty","buffer","sampleRate","peaks","svg","createElementNS","g","path","build","abs","split","reduce","a","b","charCodeAt","req","XMLHttpRequest","open","responseType","e","readyState","status","decodeAudioData","response","bufferedAudio","getPeaks","process","send","displayWaveForms","totalPeaks","d","peakNumber","shift","sampleSize","sampleStep","numberOfChannels","mergedPeaks","channelNumber","channelData","getChannelData","start","end","min","sampleIndex","waveformElements","displayGlobalWaveform","displayPlaylistWaveform","displaySongWaveform","displaySongInPlaylistWaveform","waveformPath","querySelector","determineIfUsingWaveforms","Time","computeCurrentTimes","currentSeconds","currentMinutes","currentHours","computeSongDuration","songDurationSeconds","songDurationMinutes","songDurationHours","toString","computeSongCompletionPercentage","setCurrentTime","time","isFinite","BufferedProgressElements","songBufferedProgressBars","parseFloat","songBufferedProgressBarsPlaylist","songBufferedProgressBarsSongs","songBufferedProgressBarsSongsInPlaylist","reset","Ended","handle","setTimeout","AmplitudeCore","bindTimeUpdate","bindKeyDownEventHandlers","bindSongEnded","bindProgress","bindPlay","bindPause","bindPlayPause","bindStop","bindMute","bindVolumeUp","bindVolumeDown","bindSongSlider","bindVolumeSlider","bindNext","bindPrev","bindShuffle","bindRepeat","bindRepeatSong","bindPlaybackSpeed","bindSkipTo","bindCanPlayThrough","removeEventListener","TimeUpdate","KeyDown","Progress","play_classes","Play","pause_classes","Pause","play_pause_classes","PlayPause","stop_classes","Stop","mute_classes","Mute","volume_up_classes","VolumeUp","volume_down_classes","VolumeDown","ua","window","msie","song_sliders","SongSlider","volume_sliders","VolumeSlider","next_classes","Next","prev_classes","Prev","shuffle_classes","Shuffle","repeat_classes","Repeat","repeat_song_classes","RepeatSong","playback_speed_classes","PlaybackSpeed","skipToClasses","SkipTo","event","runKeyEvent","which","runPlayPauseKeyDownEvent","runNextKeyDownEvent","runPrevKeyDownEvent","runStopKeyDownEvent","runShuffleKeyDownEvent","runRepeatKeyDownEvent","handleGlobalNext","handlePlaylistNext","songIndexAttribute","handleGlobalPause","handlePlaylistPause","handleSongPause","handleSongInPlaylistPause","handleGlobalPlay","handlePlaylistPlay","handleSongPlay","handleSongInPlaylistPlay","handleGlobalPlayPause","handlePlaylistPlayPause","handleSongPlayPause","handleSongInPlaylistPlayPause","handleGlobalPrev","handlePlaylistPrev","bufferedEnd","handleGlobalRepeat","handlePlaylistRepeat","handleGlobalShuffle","handlePlaylistShuffle","handleSkipToSong","handleSkipToPlaylist","locationPercentage","computedTime","handleGlobalSongSlider","handlePlaylistSongSlider","handleSongSongSlider","handleSongInPlaylistSongSlider","computeBufferedTime","updateTimeInformation","runTimeCallbacks","songCompletionPercentage","time_callbacks","browserContext","AudioContext","webkitAudioContext","mozAudioContext","oAudioContext","msAudioContext","createAnalyser","crossOrigin","createMediaElementSource","connect","destination","Amplitude","getConfig","bindNewElements","getActivePlaylist","getPlaybackSpeed","speed","getRepeat","getRepeatPlaylist","playlistKey","getShuffle","getShufflePlaylist","repeatState","getDefaultAlbumArt","getDefaultPlaylistArt","setDefaultAlbumArt","setDefaultPlaylistArt","default_plalist_art","getSongPlayedPercentage","getSongPlayedSeconds","getSongDuration","setSongPlayedPercentage","setDebug","getActiveSongMetadata","getActivePlaylistMetadata","getSongAtIndex","getSongAtPlaylistIndex","addSong","addSongToPlaylist","addPlaylist","data","ignoredKeys","dataKey","removeSong","splice","removeSongFromPlaylist","playNow","playSongAtIndex","playPlaylistSongAtIndex","getAudio","getAnalyser","next","nextData","prev","prevData","getSongs","getSongsInPlaylist","getSongsState","getSongsStatePlaylist","getActiveIndex","getVersion","getBuffered","skipTo","setSongMetaData","metaData","setPlaylistMetaData","setDelay","getDelay","getPlayerState","registerVisualization","setPlaylistVisualization","visualizationKey","setSongVisualization","setSongInPlaylistVisualization","setGlobalVisualization","getVolume","copySongsToPlaylists","grabSoundCloudData","initializePlaylistActiveIndexes","initializePlaylistShuffleStatuses","initializePlaylistsRepeatStatuses","initializePlaylistShuffleLists","initializeFirstSongInPlaylistMetaData","songContainers","activeIndex","hasAttribute","currentHourSelectors","currentHourPlaylistSelectors","currentHourSongSelectors","currentHourPlaylistSongSelectors","hourSelectors","currentMinuteSelectors","currentMinutePlaylistSelectors","currentMinuteSongSelectors","currentMinutePlaylistSongSelectors","minuteSelectors","currentSecondSelectors","currentSecondPlaylistSelectors","currentSecondSongSelectors","currentSecondPlaylistSongSelectors","secondSelectors","currentTimeSelectors","timeText","timeSelectors","countDownTime","timeRemaining","computeTimeRemaining","durationTimeRemainingSelectors","totalCurrentSeconds","totalDurationSeconds","timeRemainingTotalSeconds","remainingHours","remainingMinutes","remainingSeconds","durationHourSelectors","durationMinuteSelectors","durationSecondSelectors","durationTime","durationText","computeDurationText","durationTimeSelectors"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AAC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AQA,SAAK,IAAIT,IAAI,CAAb,EAAgBA,IAAIqhB,sBAAsBphB,MAA1C,EAAkDD,GAAlD,EAAuD;AACrDqhB,4BAAsBrhB,CAAtB,EAAyByE,SAAzB,GAAqC0c,YAArC;AACD;AACF;;AAED;;;AAGA,WAASxZ,UAAT,GAAsB;AACpB,QAAI0Z,wBAAwBvhB,SAASC,gBAAT,CAC1B,0BAD0B,CAA5B;;AAIA,SAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAIqhB,sBAAsBphB,MAA1C,EAAkDD,GAAlD,EAAuD;AACrDqhB,4BAAsBrhB,CAAtB,EAAyByE,SAAzB,GAAqC,OAArC;AACD;AACF;;AAED;;;;;AAKA,WAAS2c,mBAAT,CAA6BF,YAA7B,EAA2C;AACzC,QAAIC,eAAe,OAAnB;;AAEA,QAAI,CAACzd,MAAMwd,aAAajZ,OAAnB,CAAD,IAAgC,CAACvE,MAAMwd,aAAatiB,OAAnB,CAArC,EAAkE;AAChEuiB,qBAAeD,aAAajZ,OAAb,GAAuB,GAAvB,GAA6BiZ,aAAatiB,OAAzD;AACA,UAAI,CAAC8E,MAAMwd,aAAalZ,KAAnB,CAAD,IAA8BkZ,aAAalZ,KAAb,GAAqB,CAAvD,EAA0D;AACxDmZ,uBAAeD,aAAalZ,KAAb,GAAqB,GAArB,GAA2BmZ,YAA1C;AACD;AACF;;AAED,WAAOA,YAAP;AACD;;AAED;;;AAGA,SAAO;AACL5hB,UAAMA,IADD;AAELoI,gBAAYA;AAFP,GAAP;AAID,CArJ0B,EAA3B,C,CAXA;;;;kBAkKeW,oB;;;;;;;AClKf,kBAAkB,mTAAmT,uQAAuQ,gBAAgB,aAAa,6BAA6B,iIAAiI,eAAe,0EAA0E,2IAA2I,4DAA4D,kE","file":"amplitude.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Amplitude\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Amplitude\"] = factory();\n\telse\n\t\troot[\"Amplitude\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 47);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c928b168697f944252b1","/**\n * These variables make Amplitude run. The config is the most important\n * containing active settings and parameters.\n *\n * The config JSON is the global settings for ALL of Amplitude functions.\n * This is global and contains all of the user preferences. The default\n * settings are set, and the user overwrites them when they initialize\n * Amplitude.\n *\n * @module config\n * @type {object}\n * @property {string} \tconfig.version \t\t\t\t- The current version of AmplitudeJS.\n * @property {object} \tconfig.audio \t\t \t\t\t\t\t\t\t\t-\tHandles all of the audio.\n * @property {object} \tconfig.active_metadata\t\t\t\t\t- Contains the active metadata for the song.\n * @property {string} \tconfig.active_album\t\t\t\t\t\t\t- Holds the active album name. Used to check and see if the album changed and run the album changed callback.\n * @property {number} \tconfig.active_index\t\t\t\t\t\t\t- Contains the index of the actively playing song.\n * @property {string} \tconfig.active_playlist\t\t\t\t\t- Contains the key to the active playlist index.\n * @property {number} \tconfig.playback_speed\t\t\t\t\t\t- Sets the initial playback speed of the song. The values for this can be 1.0, 1.5, 2.0\n * @property {object} \tconfig.callbacks\t\t\t\t\t\t\t\t- The user can pass a JSON object with a key => value store of callbacks to be run at certain events.\n * @property {array} \t\tconfig.songs\t\t\t\t\t\t\t\t\t\t- Contains all of the songs the user has passed to Amplitude to use.\n * @property {object} \tconfig.playlists\t\t\t\t\t\t\t\t- Contains all of the playlists the user created.\n * @property {object} \tconfig.start_song \t\t\t\t\t\t\t- The index of the song that AmplitudeJS should start with.\n * @property {string} \tconfig.starting_playlist \t\t\t\t- The starting playlist the player will intiialize to.\n * @property {string} \tconfig.starting_playlist_song \t- The index of the song in the playlist that should be started.\n * @property {boolean} \tconfig.repeat \t\t\t\t\t\t\t\t\t- When repeat is on, when the song ends the song will replay itself.\n * @property {object} \tconfig.shuffle_list\t\t\t\t\t\t\t- When shuffled, gets populated with the songs the user provided in a random order.\n * @property {boolean} \tconfig.shuffle_on\t\t\t\t\t\t\t\t- When on, gets set to true so when traversing through songs, AmplitudeJS knows whether or not to use the songs object or the shuffle_list\n * @property {string}\t\tconfig.default_album_art \t\t\t\t- The user can set default album art to be displayed if the song they set doesn't contain album art.\n * @property {string} \tconfig.default_playlist_art \t\t- The user can set default playlist art to be displayed if the playlist they are setting meta data for doesn't contain an art picture.\n * @property {boolean} \tconfig.debug\t\t\t\t\t\t\t\t\t\t- When set to true, AmplitudeJS will print to the console any errors providing helpful feedback to the user.\n * @property {number} \tconfig.volume \t\t\t\t\t\t\t\t\t- The user can set the initial volume to a number between 0 and 1 over-riding the default of .5\n * @property {number} \tconfig.pre_mute_volume \t\t\t\t\t- This is set on mute so that when a user un-mutes AmplitudeJS knows what to restore the volume to.\n * @property {number}\t\tconfig.volume_increment \t\t\t\t- The default values are an integer between 1 and 100 for how much the volume should increase when the user presses the volume up button.\n * @property {number}\t\tconfig.volume_decrement \t\t\t\t- The default values are an integer between 1 and 100 for how much the volume should decrease when the user presses the volume down button.\n * @property {string} \tconfig.soundcloud_client \t\t\t\t- When using SoundCloud, the user will have to provide their API Client ID\n * @property {boolean} \tconfig.soundcloud_use_art \t\t\t- The user can set this to true and AmplitudeJS will use the album art for the song returned from the Soundcloud API\n * @property {number} \tconfig.soundcloud_song_count \t\t- Used on config to count how many songs are from Soundcloud and compare it to how many are ready for when to move to the rest of the configuration\n * @property {number} \tconfig.soundcloud_songs_ready \t- Used on config to count how many songs are ready so when we get all of the data from the SoundCloud API that we need this should match the SoundCloud song count meaning we can move to the rest of the config.\n * @property {integer}\tconfig.is_touch_moving \t\t\t\t\t- Flag for if the user is moving the screen.\n * @property {boolean}\tconfig.buffered\t\t\t\t\t\t\t\t\t- How much of the song is buffered.\n * @property {object} \tconfig.bindings\t\t\t\t\t\t\t\t\t- Array of bindings to certain key events.\n * @property {boolean} \tconfig.continue_next \t\t\t\t\t\t- Determines when a song ends, we should continue to the next song.\n * @property {number} config.delay \t\t\t\t\t\t\t\t\t\t- Sets the delay between songs in MS.\n * @property {boolean} config.use_web_audio_api \t\t\t\t- Flag that determines if the user wants to use Web Audio API Components.\n * @property {boolean} config.web_audio_api_available - Flag that determines if the Web Audio API is available.\n * @property {object} \tconfig.context \t\t\t\t\t\t\t\t\t- Web Audio API Context\n * @property {object}\t\tconfig.source \t\t\t\t\t\t\t\t\t- Web Audio API Source\n * @property {object} \tconfig.analyser \t\t\t\t\t\t\t\t- Web Audio API Analyser\n * @property {string}\t\tconfig.player_state \t\t\t\t\t\t- The current state of the player.\n */\nimport { version } from \"../package.json\";\n\nmodule.exports = {\n version: version,\n\n audio: new Audio(),\n\n active_metadata: {},\n\n active_album: \"\",\n\n active_index: 0,\n\n active_playlist: null,\n\n playback_speed: 1.0,\n\n callbacks: {},\n\n songs: [],\n\n playlists: {},\n\n start_song: \"\",\n\n starting_playlist: \"\",\n\n starting_playlist_song: \"\",\n\n repeat: false,\n\n repeat_song: false,\n\n shuffle_list: {},\n\n shuffle_on: false,\n\n default_album_art: \"\",\n\n default_playlist_art: \"\",\n\n debug: false,\n\n volume: 0.5,\n\n pre_mute_volume: 0.5,\n\n volume_increment: 5,\n\n volume_decrement: 5,\n\n soundcloud_client: \"\",\n\n soundcloud_use_art: false,\n\n soundcloud_song_count: 0,\n\n soundcloud_songs_ready: 0,\n\n is_touch_moving: false,\n\n buffered: 0,\n\n bindings: {},\n\n continue_next: true,\n\n delay: 0,\n\n player_state: \"stopped\",\n\n web_audio_api_available: false,\n\n context: null,\n\n source: null,\n\n analyser: null,\n\n visualizations: {\n available: [],\n\n active: [],\n\n backup: \"\"\n },\n\n waveforms: {\n sample_rate: 100,\n\n built: []\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/config.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Checks module.\n * @module utilities/checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the Audio Navigation module.\n * @module utilities/audioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the Play/Pause Visual Elements module.\n * @module visual/playPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Meta Data Visual Elements module.\n * @module visual/metaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Imports AmplitudeJS Callback Utility\n * @module utilities/callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports AmplitudeJS Debug Utility\n * @module utilities/debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Import the Visualizations from the FX module.\n * @module fx/visualizations\n */\nimport Visualizations from \"../fx/visualizations.js\";\n\n/**\n * Interacts directly with native functions of the Audio element. Logic\n * leading up to these methods are handled by click handlers which call\n * helpers and visual synchronizers. These are the core functions of AmplitudeJS.\n * Every other function that leads to these prepare the information to be\n * acted upon by these functions.\n *\n * @module core/Core\n */\nlet Core = (function() {\n /**\n * Plays the active song. If the current song is live, it reconnects\n * the stream before playing.\n *\n * Public Accessor: Amplitude.play()\n *\n * @access public\n */\n function play() {\n Visualizations.stop();\n Visualizations.run();\n\n /*\n\t\t\tIf the audio is live we re-conenct the stream.\n\t\t*/\n if (config.active_metadata.live) {\n reconnectStream();\n }\n\n /*\n\t\t\tMobile remote sources need to be reconnected on play. I think this is\n\t\t\tbecause mobile browsers are optimized not to load all resources\n\t\t\tfor speed reasons. We only do this if mobile and the paused button\n\t\t\tis not clicked. If the pause button was clicked then we don't reconnect\n\t\t\tor the user will lose their place in the stream.\n\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n ) &&\n !config.paused\n ) {\n reconnectStream();\n }\n\n /*\n\t\t\tPlay the song and set the playback rate to the playback\n\t\t\tspeed.\n */\n let playPromise = config.audio.play();\n\n if( playPromise !== undefined ){\n playPromise.then( _ => {\n\n })\n .catch( error => {\n\n });\n }\n config.audio.play();\n config.audio.playbackRate = config.playback_speed;\n }\n\n /**\n * Pauses the active song. If it's live, it disconnects the stream.\n *\n * Public Accessor: Amplitude.pause()\n *\n * @access public\n */\n function pause() {\n Visualizations.stop();\n\n /*\n\t\t\tPause the active song.\n\t\t*/\n config.audio.pause();\n\n /*\n\t\t\tFlag that pause button was clicked.\n\t\t*/\n config.paused = true;\n\n /*\n\t\t\tIf the song is live, we disconnect the stream so we aren't\n\t\t\tsaving it to memory.\n\t\t*/\n if (config.active_metadata.live) {\n disconnectStream();\n }\n }\n\n /**\n * Stops the active song by setting the current song time to 0.\n * When the user resumes, it will be from the beginning.\n * If it's a live stream it disconnects.\n *\n * Public Accessor: Amplitude.stop()\n *\n * @access public\n */\n function stop() {\n Visualizations.stop();\n\n /*\n\t\t\tSet the current time of the song to 0 which will reset the song.\n\t\t*/\n if (config.audio.currentTime != 0) {\n config.audio.currentTime = 0;\n }\n\n /*\n\t\t\tRun pause so the song will stop\n\t\t*/\n config.audio.pause();\n\n /*\n\t\t\tIf the song is live, disconnect the stream.\n\t\t*/\n if (config.active_metadata.live) {\n disconnectStream();\n }\n\n /*\n\t\t\tRun the stop callback\n\t\t*/\n Callbacks.run(\"stop\");\n }\n\n /**\n * Sets the song volume.\n *\n * Public Accessor: Amplitude.setVolume( volumeLevel )\n *\n * @access public\n * @param {number} volumeLevel - A number between 1 and 100 as a percentage of\n * min to max for a volume level.\n */\n function setVolume(volumeLevel) {\n /*\n\t\t\tIf the volume is set to mute somewhere else, we sync the display.\n\t\t*/\n if (volumeLevel == 0) {\n config.audio.muted = true;\n } else {\n config.audio.muted = false;\n }\n\n /*\n\t\t\tSets the volume in the config so we can reference it later on.\n\t\t*/\n config.volume = volumeLevel;\n\n /*\n\t\t\tSet the volume of the active song.\n\t\t*/\n config.audio.volume = volumeLevel / 100;\n }\n\n /**\n * Sets the song percentage. If it's a live song, we ignore this because\n * we can't skip ahead. This is an issue if you have a playlist with\n * a live source.\n *\n * Public Accessor: Amplitude.setSongLocation( songPercentage )\n *\n * @access public\n * @param {number} songPercentage - A number between 1 and 100 as a percentage of song completion.\n */\n function setSongLocation(songPercentage) {\n /*\n\t\t\tAs long as the song is not live, we can set the current time of the\n\t\t\tsong to the percentage the user passed in.\n\t\t*/\n if (!config.active_metadata.live) {\n config.audio.currentTime = config.audio.duration * (songPercentage / 100);\n }\n }\n\n /**\n * Skips to a location in a song\n *\n * Public Accessor: Amplitude.skipToLocation( seconds )\n *\n * @access public\n * @param {number} seconds - An integer containing the seconds to skip to\n */\n function skipToLocation(seconds) {\n /*\n\t\t\tWhen the active song can be played through, we can check to\n\t\t\tsee if the seconds will work. We only bind the event handler\n\t\t\tonce and remove it once it's fired.\n\t\t*/\n config.audio.addEventListener(\n \"canplaythrough\",\n function() {\n /*\n\t\t\t\tIf the active song duration is greater than or equal to the\n\t\t\t\tamount of seconds the user wants to skip to and the seconds\n\t\t\t\tis greater than 0, we skip to the seconds defined.\n\t\t\t*/\n if (config.audio.duration >= seconds && seconds > 0) {\n config.audio.currentTime = seconds;\n } else {\n Debug.writeMessage(\n \"Amplitude can't skip to a location greater than the duration of the audio or less than 0\"\n );\n }\n },\n { once: true }\n );\n }\n\n /**\n * Disconnects the live stream\n *\n * Public Accessor: Amplitude.disconnectStream()\n *\n * @access public\n */\n function disconnectStream() {\n config.audio.src = \"\";\n config.audio.load();\n }\n\n /**\n * Reconnects the live stream\n *\n * Public Accessor: Amplitude.reconnectStream()\n *\n * @access public\\\n */\n function reconnectStream() {\n config.audio.src = config.active_metadata.url;\n config.audio.load();\n }\n\n /**\n * Sets the playback speed for the song.\n *\n * @param {number} playbackSpeed The speed we want the song to play back at.\n */\n function setPlaybackSpeed(playbackSpeed) {\n /*\n\t\t\tSet the config playback speed.\n\t\t*/\n config.playback_speed = playbackSpeed;\n\n /*\n\t\t\tSet the active song playback rate.\n\t\t*/\n config.audio.playbackRate = config.playback_speed;\n }\n\n /*\n\t\tReturn publically facing functions\n\t*/\n return {\n play: play,\n pause: pause,\n stop: stop,\n setVolume: setVolume,\n setSongLocation: setSongLocation,\n skipToLocation: skipToLocation,\n disconnectStream: disconnectStream,\n reconnectStream: reconnectStream,\n setPlaybackSpeed: setPlaybackSpeed\n };\n})();\n\nexport default Core;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/core.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the visual representation of AmplitudeJS play pause elements.\n * @module visual/PlayPauseElements\n */\nlet PlayPauseElements = (function() {\n /**\n * Syncs all play pause elements.\n *\n * @access public\n */\n function sync() {\n syncGlobal();\n syncPlaylist();\n syncSong();\n syncSongInPlaylist();\n }\n\n /**\n * Syncs the global play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncGlobal() {\n /*\n Get the active song state.\n */\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all play pause buttons.\n */\n const playPauseElements = document.querySelectorAll(\n \".amplitude-play-pause\"\n );\n\n /*\n Iterate over all of the play pause elements syncing the\n display visually.\n */\n for (let i = 0; i < playPauseElements.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlist = playPauseElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = playPauseElements[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n This method is responsible for only the global elements,\n so we make sure there are no playlist or songs defined on\n the element.\n */\n if (playlist == null && song == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(playPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(playPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the main playlist play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncPlaylist() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all of the main playlist play pause elements\n */\n const playlistPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n Iterate over the play pause elements, syncing the state accordingly.\n */\n for (let i = 0; i < playlistPlayPauseElements.length; i++) {\n /*\n Grab the song attributes from the element.\n */\n let song = playlistPlayPauseElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n We want only the play pause elements for the main on a\n playlist nothing else. We have another method for the\n song in playlist play pause method.\n */\n if (song == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(playlistPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(playlistPlayPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the song play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncSong() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all of the individual song play pause buttons. These have an\n amplitude-song-index that matches the active index attribute.\n */\n let songPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n Iterate over all of the song play pause elements\n */\n for (let i = 0; i < songPlayPauseElements.length; i++) {\n /*\n Grab the playlist attributes from the element.\n */\n let playlist = songPlayPauseElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n We want only the song play pause buttons, not ones scoped in a playlist.\n */\n if (playlist == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(songPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(songPlayPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist play pause buttons to the state of\n * the active song.\n *\n * @access public\n */\n function syncSongInPlaylist() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n Get all of the individual song play pause buttons. These have an\n amplitude-song-index attribute. Some have amplitude-playlist which\n means they are individual songs within a playlist.\n */\n let songInPlaylistPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n Iterate over all of the individual play pause elements for songs inspect\n a playlist.\n */\n for (let i = 0; i < songInPlaylistPlayPauseElements.length; i++) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(songInPlaylistPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(songInPlaylistPlayPauseElements[i]);\n break;\n }\n }\n }\n\n /**\n * Sets all of the play pause buttons to paused.\n *\n * @access public\n */\n function syncToPause() {\n /*\n Gets all of the play pause elements\n */\n let playPauseElements = document.querySelectorAll(\".amplitude-play-pause\");\n\n /*\n Sets all of the elements to pause\n */\n for (let i = 0; i < playPauseElements.length; i++) {\n setElementPause(playPauseElements[i]);\n }\n }\n\n /**\n * Sets an element to be playing by removing the 'amplitude-paused' class\n * and adding the 'amplitude-playing' class\n *\n * @access public\n * @param {element} element \t- The element getting the playing class added.\n */\n function setElementPlay(element) {\n element.classList.add(\"amplitude-playing\");\n element.classList.remove(\"amplitude-paused\");\n }\n\n /**\n * Sets an element to be paused by adding the 'amplitude-paused' class\n * and removing the 'amplitude-playing' class\n *\n * @access public\n * @param {element} element \t- The element getting the paused class added.\n */\n function setElementPause(element) {\n element.classList.remove(\"amplitude-playing\");\n element.classList.add(\"amplitude-paused\");\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n syncGlobal: syncGlobal,\n syncPlaylist: syncPlaylist,\n syncSong: syncSong,\n syncSongInPlaylist: syncSongInPlaylist,\n syncToPause: syncToPause\n };\n})();\n\nexport default PlayPauseElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/playPauseElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Core Module\n *\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Callbacks Module\n *\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports the Checks Module\n *\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the Play Pause Elements Module\n *\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Song Slider Elements Module\n *\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Imports the Song Played Progress Elements Module\n *\n * @module visual/SongPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"../visual/songPlayedProgressElements.js\";\n\n/**\n * Imports the Time Elements Module\n *\n * @module visual/TimeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Meta Data Elements Module\n *\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Container Elements Module\n *\n * @module visual/ContainerElements\n */\nimport ContainerElements from \"../visual/containerElements.js\";\n\n/**\n * AmplitudeJS Audio Navigation Utility.\n *\n * @module utilities/AudioNavigation\n */\nlet AudioNavigation = (function() {\n /**\n * Sets the next song\n *\n * @access public\n * @param {boolean} [songEnded=false] If the song ended, this is set to true\n * so we take into effect the repeat setting.\n */\n function setNext(songEnded = false) {\n /*\n Initializes the next index variable. This will be the\n index of the song that is next.\n */\n let nextIndex = null;\n let nextSong = {};\n\n /*\n Ensure we don't loop in the playlist if config.repeat is not true\n */\n let endOfList = false;\n\n /*\n Determines if we are repeating the song or not. If we are repeating,\n the next song will be the same song index.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.shuffle_on) {\n nextIndex = config.shuffle_list[ config.active_index ].index;\n nextSong = config.shuffle_list[nextIndex];\n } else {\n nextIndex = config.active_index;\n nextSong = config.songs[nextIndex];\n }\n } else {\n /*\n If the shuffle is on, we use the shuffled list of\n songs to determine our next song.\n */\n if (config.shuffle_on) {\n /*\n If the active shuffle index + 1 is less than the length, then\n we use the next shuffle otherwise we go to the beginning\n of the shuffle list.\n */\n if (parseInt(config.active_index) + 1 < config.shuffle_list.length) {\n /*\n Set the next index to be the index of the song in the shuffle list.\n */\n nextIndex = parseInt( config.active_index ) + 1;\n } else {\n nextIndex = 0\n endOfList = true;\n }\n\n nextSong = config.shuffle_list[ nextIndex ];\n } else {\n /*\n If the active index + 1 is less than the length of the songs, then\n we use the next song otherwise we go to the beginning of the\n song list.\n */\n if (parseInt(config.active_index) + 1 < config.songs.length) {\n nextIndex = parseInt(config.active_index) + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n /*\n Sets the next index.\n */\n nextSong = config.songs[nextIndex];\n }\n }\n\n /*\n Change the song after the next button has been pressed.\n */\n changeSong(nextSong, nextIndex);\n\n /*\n \t\tIf it's the end of the list and repeat is not on, do nothing.\n \t*/\n if (endOfList && !config.repeat) {\n } else {\n /*\n \t\t\tIf the song has ended and repeat is on, play the song.\n \t\t*/\n if (!(songEnded && !config.repeat && endOfList)) {\n Core.play();\n }\n }\n\n /*\n Sync the play pause elements and run the\n after next callback.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"next\");\n\n /*\n If we repeated the song, run the repeat song callback.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the next song in a playlist\n *\n * @param {string} playlist - The playlist being shuffled\n * @param {boolean} [songEnded=false] - If the song ended, this is set to true\n * so we take into effect the repeat setting.\n */\n function setNextPlaylist(playlist, songEnded = false) {\n /*\n Initializes the next index\n */\n let nextIndex = null;\n let nextSong = {};\n\n /*\n Ensure we don't loop in the playlist if config.repeat is not true\n */\n let endOfList = false;\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.playlists[playlist].shuffle) {\n nextIndex = config.playlists[playlist].active_index;\n nextSong = config.playlists[playlist].shuffle_list[nextIndex];\n } else {\n nextIndex = config.playlists[playlist].active_index;\n nextSong = config.playlists[playlist].songs[nextIndex];\n }\n } else {\n /*\n If the playlist is shuffled we get the next index of the playlist.\n */\n if (config.playlists[playlist].shuffle) {\n /*\n If the active shuffle index + 1 is less than the length of the shuffle list,\n then we use the next shuffle otherwise we go to the beginning of the shuffle list.\n */\n if (\n parseInt(config.playlists[playlist].active_index) + 1 <\n config.playlists[playlist].shuffle_list.length\n ) {\n /*\n Set the next index to be the index of the song in the shuffle list.\n */\n nextIndex = config.playlists[playlist].active_index + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n nextSong = config.playlists[playlist].shuffle_list[nextIndex];\n } else {\n /*\n If the active index +1 is less than the length of the songs in the playlist,\n then we use the next song otherwise we go to the beginning of the playlist.\n */\n if (\n parseInt(config.playlists[playlist].active_index) + 1 <\n config.playlists[playlist].songs.length\n ) {\n nextIndex = parseInt(config.playlists[playlist].active_index) + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n /*\n Sets the next song.\n */\n nextSong = config.playlists[playlist].songs[nextIndex];\n }\n }\n\n /*\n Sets the active playlist to the playlist we are on.\n */\n setActivePlaylist(playlist);\n\n /*\n Change the song within the playlist.\n */\n changeSongPlaylist(playlist, nextSong, nextIndex);\n\n /*\n If it's the end of the playlist and we aren't repeating, do nothing.\n */\n if (endOfList && !config.repeat) {\n } else {\n if (!(songEnded && !config.repeat && endOfList)) {\n Core.play();\n }\n }\n\n /*\n Sync the play pause buttons.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"next\");\n\n /*\n Repeat the song.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the previous song on the global songs array.\n *\n * @access private\n */\n function setPrevious() {\n /*\n Initializes the previous index\n */\n let previousIndex = null;\n let previousSong = {};\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the config is shuffled, get the now playing index.\n */\n if (config.shuffle_on) {\n previousIndex = config.active_index;\n previousSong = config.shuffle_list[previousIndex];\n } else {\n previousIndex = config.active_index;\n previousSong = config.songs[previousIndex];\n }\n } else {\n /*\n Get the previous index. If the previous index will be less than 0, get the\n last song of the array and continue.\n */\n if (parseInt(config.active_index) - 1 >= 0) {\n previousIndex = parseInt(config.active_index - 1);\n } else {\n previousIndex = parseInt(config.songs.length - 1);\n }\n\n /*\n If the config is shuffled, we grab the song from the shuffle list\n */\n if (config.shuffle_on) {\n /*\n Grab song from the shuffle list\n */\n previousSong = config.shuffle_list[previousIndex];\n } else {\n /*\n Grab song from the songs array\n */\n previousSong = config.songs[previousIndex];\n }\n }\n /*\n Change the song after the next button has been pressed.\n */\n changeSong(previousSong, previousIndex);\n\n /*\n Play the newest song.\n */\n Core.play();\n\n /*\n Sync the play pause elements and run the\n after next callback.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"prev\");\n\n /*\n If we repeated the song, run the repeat song callback.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the previous playlist song.\n *\n * @access private\n *\n * @prop {string} playlist - The playlist we are navigating in.\n */\n function setPreviousPlaylist(playlist) {\n /*\n Initializes the previous index\n */\n let previousIndex = null;\n let previousSong = {};\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.playlists[playlist].shuffle) {\n previousIndex = config.playlists[playlist].active_index;\n previousSong = config.playlists[playlist].shuffle_list[previousIndex];\n } else {\n previousIndex = config.playlists[playlist].active_index;\n previousSong = config.playlists[playlist].songs[previousIndex];\n }\n } else {\n /*\n Get the previous index. If the previous index will be less than 0, get the\n last song of the array and continue.\n */\n if (parseInt(config.playlists[playlist].active_index) - 1 >= 0) {\n previousIndex = parseInt(config.playlists[playlist].active_index - 1);\n } else {\n previousIndex = parseInt(config.playlists[playlist].songs.length - 1);\n }\n\n /*\n If the playlist is shuffled, we grab the song from the shuffle list\n */\n if (config.playlists[playlist].shuffle) {\n /*\n Grab song from the shuffle list\n */\n previousSong = config.playlists[playlist].shuffle_list[previousIndex];\n } else {\n /*\n Grab song from the songs array\n */\n previousSong = config.playlists[playlist].songs[previousIndex];\n }\n }\n\n /*\n Sets the active playlist to the playlist we are on.\n */\n setActivePlaylist(playlist);\n\n /*\n Change the song within the playlist.\n */\n changeSongPlaylist(playlist, previousSong, previousIndex);\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Sync the play pause buttons.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"prev\");\n\n /*\n Repeat the song.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Change song in the songs array.\n *\n * @access private\n * @prop {object} song - The song we are changing to.\n * @prop {number} index - The index we are changing to.\n */\n function changeSong(song, index) {\n /*\n Prepare the song change.\n */\n prepareSongChange(song);\n\n /*\n Change the song.\n */\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n \n config.active_index = parseInt(index);\n\n /*\n Set new information now that the song has changed.\n */\n afterSongChange();\n }\n\n /**\n * Handles a song change in the playlist\n *\n * @access private\n * @prop {string} playlist - The playlist we are changing the song on.\n * @prop {object} song - The song we are changing to in the playlist.\n * @prop {number} index - The inded of the song we are changing to in the playlist.\n */\n function changeSongPlaylist(playlist, song, index) {\n /*\n Prepare the song change.\n */\n prepareSongChange(song);\n\n /*\n Change the song.\n */\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n config.active_index = null;\n\n config.playlists[playlist].active_index = parseInt(index);\n\n /*\n Set new information now that the song has changed.\n */\n afterSongChange();\n }\n\n /**\n * Prepares a song change\n *\n * @access private\n * @prop {object} song - The song we change to.\n */\n function prepareSongChange(song) {\n /*\n Stop the current song.\n */\n Core.stop();\n\n /*\n Sync all of the elements to a stopped song.\n */\n PlayPauseElements.syncToPause();\n SongSliderElements.resetElements();\n SongPlayedProgressElements.resetElements();\n TimeElements.resetCurrentTimes();\n\n /*\n If an album changes, fire an album change.\n */\n if (Checks.newAlbum(song)) {\n Callbacks.run(\"album_change\");\n }\n }\n\n /**\n * Updates data on the display after a song has changed.\n *\n * @access private\n */\n function afterSongChange() {\n MetaDataElements.displayMetaData();\n ContainerElements.setActive();\n TimeElements.resetDurationTimes();\n\n /*\n Run the song change callback.\n */\n Callbacks.run(\"song_change\");\n }\n\n /**\n * Sets the active playlist\n *\n * @access public\n * @param {string} playlist - The string of the playlist being set to active.\n */\n function setActivePlaylist(playlist) {\n /*\n If the active playlist is different than the playlist being set,\n we run the `playlist_changed` callback.\n */\n if (config.active_playlist != playlist) {\n Callbacks.run(\"playlist_changed\");\n /*\n Set the active playlist to the playlist parameter. Only need to\n set if it's different.\n */\n config.active_playlist = playlist;\n\n if (playlist != null) {\n config.playlists[playlist].active_index = 0;\n }\n }\n }\n\n /*\n Return the publically facing methods\n */\n return {\n setNext: setNext,\n setNextPlaylist: setNextPlaylist,\n setPrevious: setPrevious,\n setPreviousPlaylist: setPreviousPlaylist,\n changeSong: changeSong,\n changeSongPlaylist: changeSongPlaylist,\n setActivePlaylist: setActivePlaylist\n };\n})();\n\nexport default AudioNavigation;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/audioNavigation.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the debugging of AmplitudeJS\n * @module utilities/Debug\n */\nlet Debug = (function() {\n /**\n * Writes out debug message to the console if enabled.\n *\n * Public Accessor: Debug.writeMessage( message )\n *\n * @access public\n * @param {string} message - The string that gets printed to alert the user of a debugging error.\n */\n function writeMessage(message) {\n /*\n If the user has flagged AmplitudeJS to debug, we print out a message\n to the console.\n */\n if (config.debug) {\n console.log(message);\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n writeMessage: writeMessage\n };\n})();\n\nexport default Debug;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/debug.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Checks Module. Checks for new songs, albums, and playlists\n *\n * @module utilities/Checks\n */\nlet Checks = (function() {\n /**\n * Checks to see if the new song to be played is different than the song\n * that is currently playing. To be true, the user would have selected\n * play on a new song with a new index. To be false, the user would have\n * clicked play/pause on the song that was playing.\n *\n * Public Accessor: Checks.newSong( playlist, songIndex )\n * @access public\n * @param {string} playlist - The playlist we are checking the new song for. Could be null\n * @param {number} songIndex - The index of the new song to be played.\n * @returns {boolean} True if we are setting a new song, false if we are not setting a new song.\n */\n function newSong(playlist, songIndex) {\n /*\n If the playlists don't match, then it's definitely a new song.\n */\n if (config.active_playlist != playlist) {\n return true;\n } else {\n /*\n If we aren't in a playlist, we check the active index.\n */\n if (config.active_playlist == null && playlist == null) {\n /*\n If the active indexes don't match, then it's a new song.\n */\n if (config.active_index != songIndex) {\n return true;\n } else {\n return false;\n }\n } else {\n /*\n If we are in a playlist, then we check to see if the\n new song index matches the active index.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[playlist].active_index != songIndex\n ) {\n return true;\n } else {\n return false;\n }\n }\n }\n }\n\n /**\n * Checks to see if there is a new album\n *\n * Public Accessor: Checks.newAlbum( album )\n *\n * @access public\n * @param {string} album - Checks to see if the new song will have a new album.\n * @returns {boolean} True if there is a new album, false if there is not a new ablum.\n */\n function newAlbum(album) {\n if (config.active_album != album) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Checks to see if there is a new playlist\n *\n * Public Accessor: Checks.newPlaylist( playlist )\n *\n * @access public\n * @param {string} playlist - The playlist passed in to check against the active playlist.\n * @returns {boolean} True if there is a new playlist, false if there is not a new playlist.\n */\n function newPlaylist(playlist) {\n if (config.active_playlist != playlist) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Determines if the string passed in is a URL or not\n *\n * Public Accessor: AmplitudeHelpers.isURL( url )\n *\n * @access public\n * @param {string} url - The string we are testing to see if it's a URL.\n * @returns {boolean} True if the string is a url, false if it is not.\n */\n function isURL(url) {\n /*\n\t\t\tTest the string against the URL pattern and return if it matches\n\t\t*/\n let pattern = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;\n\n return pattern.test(url);\n }\n\n /**\n * Determines if what is passed in is an integer or not.\n *\n * Public Accessor: AmplitudeHelpers.isInt( int )\n *\n * @access public\n * @param {string|number} int - The variable we are testing to see is an integer or not.\n * @returns {boolean} If the variable is an integer or not.\n */\n function isInt(int) {\n return (\n !isNaN(int) && parseInt(Number(int)) == int && !isNaN(parseInt(int, 10))\n );\n }\n\n /**\n * Returns public facing methods\n */\n return {\n newSong: newSong,\n newAlbum: newAlbum,\n newPlaylist: newPlaylist,\n isURL: isURL,\n isInt: isInt\n };\n})();\n\nexport default Checks;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/checks.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the state of the config object.\n *\n * @module utilities/ConfigState\n */\nlet ConfigState = (function() {\n /**\n * Resets the config to the default state. This is called on initialize\n * to ensure the user's config is what matters.\n *\n * Public Accessor: AmplitudeHelpers.resetConfig()\n *\n * @access public\n */\n function resetConfig() {\n config.audio = new Audio();\n config.active_metadata = {};\n config.active_album = \"\";\n config.active_index = 0;\n config.active_playlist = null;\n config.playback_speed = 1.0;\n config.callbacks = {};\n config.songs = [];\n config.playlists = {};\n config.start_song = \"\";\n config.starting_playlist = \"\";\n config.starting_playlist_song = \"\";\n config.repeat = false;\n config.shuffle_list = {};\n config.shuffle_on = false;\n config.default_album_art = \"\";\n config.default_playlist_art = \"\";\n config.debug = false;\n config.volume = 0.5;\n config.pre_mute_volume = 0.5;\n config.volume_increment = 5;\n config.volume_decrement = 5;\n config.soundcloud_client = \"\";\n config.soundcloud_use_art = false;\n config.soundcloud_song_count = 0;\n config.soundcloud_songs_ready = 0;\n config.continue_next = true;\n }\n\n /**\n * Sets the state of the player.\n */\n function setPlayerState() {\n /*\n If paused and the current time is 0 the player is stopped.\n */\n if (config.audio.paused && config.audio.currentTime == 0) {\n config.player_state = \"stopped\";\n }\n\n /*\n If paused and the current time is greater than 0 the player is\n paused.\n */\n if (config.audio.paused && config.audio.currentTime > 0) {\n config.player_state = \"paused\";\n }\n\n /*\n If playing, the current state is playing.\n */\n if (!config.audio.paused) {\n config.player_state = \"playing\";\n }\n }\n\n /*\n\t\tReturns the public facing methods\n\t*/\n return {\n resetConfig: resetConfig,\n setPlayerState: setPlayerState\n };\n})();\n\nexport default ConfigState;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/configState.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the debug module\n * @module utilities/debug\n */\nimport Debug from \"./debug.js\";\n\n/**\n * AmplitudeJS Callback Utility\n *\n * @module utilities/callbacks\n */\nlet Callbacks = (function() {\n /**\n * Initializes the callbacks for the player.\n */\n function initialize() {\n /*\n Event: abort\n https://www.w3schools.com/tags/av_event_abort.asp\n */\n config.audio.addEventListener(\"abort\", function() {\n run(\"abort\");\n });\n\n /*\n Event: error\n https://www.w3schools.com/tags/av_event_error.asp\n */\n config.audio.addEventListener(\"error\", function() {\n run(\"error\");\n });\n\n /*\n Event: loadeddata\n https://www.w3schools.com/tags/av_event_loadeddata.asp\n */\n config.audio.addEventListener(\"loadeddata\", function() {\n run(\"loadeddata\");\n });\n\n /*\n Event: loadedmetadata\n https://www.w3schools.com/tags/av_event_loadedmetadata.asp\n */\n config.audio.addEventListener(\"loadedmetadata\", function() {\n run(\"loadedmetadata\");\n });\n\n /*\n Event: loadstart\n https://www.w3schools.com/tags/av_event_loadstart.asp\n */\n config.audio.addEventListener(\"loadstart\", function() {\n run(\"loadstart\");\n });\n\n /*\n Event: pause\n https://www.w3schools.com/tags/av_event_pause.asp\n */\n config.audio.addEventListener(\"pause\", function() {\n run(\"pause\");\n });\n\n /*\n Event: playing\n https://www.w3schools.com/tags/av_event_playing.asp\n */\n config.audio.addEventListener(\"playing\", function() {\n run(\"playing\");\n });\n\n /*\n Event: play\n https://www.w3schools.com/tags/av_event_play.asp\n */\n config.audio.addEventListener(\"play\", function() {\n run(\"play\");\n });\n\n /*\n Event: progress\n https://www.w3schools.com/tags/av_event_progress.asp\n */\n config.audio.addEventListener(\"progress\", function() {\n run(\"progress\");\n });\n\n /*\n Event: ratechange\n https://www.w3schools.com/tags/av_event_ratechange.asp\n */\n config.audio.addEventListener(\"ratechange\", function() {\n run(\"ratechange\");\n });\n\n /*\n Event: seeked\n https://www.w3schools.com/tags/av_event_seeked.asp\n */\n config.audio.addEventListener(\"seeked\", function() {\n run(\"seeked\");\n });\n\n /*\n Event: seeking\n https://www.w3schools.com/tags/av_event_seeking.asp\n */\n config.audio.addEventListener(\"seeking\", function() {\n run(\"seeking\");\n });\n\n /*\n Event: stalled\n https://www.w3schools.com/tags/av_event_stalled.asp\n */\n config.audio.addEventListener(\"stalled\", function() {\n run(\"stalled\");\n });\n\n /*\n Event: suspend\n https://www.w3schools.com/tags/av_event_suspend.asp\n */\n config.audio.addEventListener(\"suspend\", function() {\n run(\"suspend\");\n });\n\n /*\n Event: timeupdate\n https://www.w3schools.com/tags/av_event_timeupdate.asp\n */\n config.audio.addEventListener(\"timeupdate\", function() {\n run(\"timeupdate\");\n });\n\n /*\n Event: volumechange\n https://www.w3schools.com/tags/av_event_volumechange.asp\n */\n config.audio.addEventListener(\"volumechange\", function() {\n run(\"volumechange\");\n });\n\n /*\n Event: waiting\n https://www.w3schools.com/tags/av_event_waiting.asp\n */\n config.audio.addEventListener(\"waiting\", function() {\n run(\"waiting\");\n });\n\n /*\n Event: canplay\n https://www.w3schools.com/tags/av_event_canplay.asp\n */\n config.audio.addEventListener(\"canplay\", function() {\n run(\"canplay\");\n });\n\n /*\n Event: canplaythrough\n https://www.w3schools.com/tags/av_event_canplaythrough.asp\n */\n config.audio.addEventListener(\"canplaythrough\", function() {\n run(\"canplaythrough\");\n });\n\n /*\n Event: durationchange\n https://www.w3schools.com/tags/av_event_durationchange.asp\n */\n config.audio.addEventListener(\"durationchange\", function() {\n run(\"durationchange\");\n });\n\n /*\n Event: ended\n https://www.w3schools.com/tags/av_event_ended.asp\n */\n config.audio.addEventListener(\"ended\", function() {\n run(\"ended\");\n });\n }\n\n /**\n * Runs a user defined callback method\n *\n * Public Accessor: Callbacks.run( callbackName )\n *\n * @access public\n * @param {string} callbackName - The name of the callback we are going to run.\n */\n function run(callbackName) {\n /*\n Checks to see if a user defined a callback method for the\n callback we are running.\n */\n if (config.callbacks[callbackName]) {\n /*\n Build the callback function\n */\n let callbackFunction = config.callbacks[callbackName];\n\n /*\n Write a debug message stating the callback we are running\n */\n Debug.writeMessage(\"Running Callback: \" + callbackName);\n\n /*\n Run the callback function and catch any errors\n */\n try {\n callbackFunction();\n } catch (error) {\n if (error.message == \"CANCEL EVENT\") {\n throw error;\n } else {\n Debug.writeMessage(\"Callback error: \" + error.message);\n }\n }\n }\n }\n\n return {\n initialize: initialize,\n run: run\n };\n})();\n\nexport default Callbacks;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/callbacks.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * These methods help display the audio's meta data\n *\n * @module visual/MetaDataElements\n */\nlet MetaDataElements = (function() {\n /**\n * Displays the active song's metadata. This is called after a song has\n * been changed. This method takes the active song and displays the\n * metadata. So once the new active song is set, we update all of the\n * screen elements.\n *\n * @access public\n */\n function displayMetaData() {\n /*\n\t\t\tDefine the image meta data keys. These are managed separately\n\t\t\tsince we aren't actually changing the inner HTML of these elements.\n\t\t*/\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n\t\t\tGet all of the song info elements\n\t\t*/\n let songInfoElements = document.querySelectorAll(\n \"[data-amplitude-song-info]\"\n );\n\n /*\n\t\t\tIterate over all of the song info elements. We will either\n\t\t\tset these to the new values, or clear them if the active song\n\t\t\tdoesn't have the info set.\n\t\t*/\n for (let i = 0; i < songInfoElements.length; i++) {\n /*\n\t\t\t\tGet the info so we can check if the active meta data has the\n\t\t\t\tkey.\n\t\t\t*/\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n\t\t\t\tGrab the playlist and song index.\n\t\t\t*/\n let playlist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songInfoElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\tEnsure that we don't set any individual elements now. We set this with the\n\t\t\t\tsync meta data method. The reason we don't set them here is because\n\t\t\t\tall individual songs would get the now playing artwork. If the playlists\n\t\t\t\tmatch or the element is a main element meaning it doesn't\n\t\t\t\tbelong to a playlist or a song, then we set the song info.\n\t\t\t*/\n if (\n songIndex == null &&\n (config.active_playlist == playlist ||\n (playlist == null && songIndex == null))\n ) {\n /*\n\t\t\t\t\tIf the active metadata has the key, then we set it,\n\t\t\t\t\totherwise we clear it. If it's an image element then\n\t\t\t\t\twe default it to the default info if needed.\n\t\t\t\t*/\n let val = (config.active_metadata[info] != undefined) ? config.active_metadata[info] : null;\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n val = val || config.default_album_art\n songInfoElements[i].setAttribute(\n \"src\",\n val\n );\n } else {\n val = val || \"\"\n songInfoElements[i].innerHTML = val;\n }\n }\n }\n }\n\n /**\n * Displays the playlist meta data.\n */\n function displayPlaylistMetaData() {\n /*\n\t\t\tDefine the image meta data keys. These are managed separately\n\t\t\tsince we aren't actually changing the inner HTML of these elements.\n\t\t*/\n let imageMetaDataKeys = [\"image_url\"];\n\n /*\n\t\t\tGet all of the playlist info elements\n\t\t*/\n let playlistInfoElements = document.querySelectorAll(\n \"[data-amplitude-playlist-info]\"\n );\n\n /*\n\t\t\tIterate over all of the playlist info elements. We will either\n\t\t\tset these to the new values, or clear them if the active song\n\t\t\tdoesn't have the info set.\n\t\t*/\n for (let i = 0; i < playlistInfoElements.length; i++) {\n /*\n\t\t\t\tGet the info so we can check if the active meta data has the\n\t\t\t\tkey.\n\t\t\t*/\n let info = playlistInfoElements[i].getAttribute(\n \"data-amplitude-playlist-info\"\n );\n let playlist = playlistInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (config.playlists[playlist][info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n playlistInfoElements[i].setAttribute(\n \"src\",\n config.playlists[playlist][info]\n );\n } else {\n playlistInfoElements[i].innerHTML = config.playlists[playlist][info];\n }\n } else {\n /*\n\t\t\t\t\tWe look for the default album art because\n\t\t\t\t\tthe actual key didn't exist. If the default album\n\t\t\t\t\tart doesn't exist then we set the src attribute\n\t\t\t\t\tto null.\n\t\t\t\t*/\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n if (config.default_playlist_art != \"\") {\n playlistInfoElements[i].setAttribute(\n \"src\",\n config.default_playlist_art\n );\n } else {\n playlistInfoElements[i].setAttribute(\"src\", \"\");\n }\n } else {\n playlistInfoElements[i].innerHTML = \"\";\n }\n }\n }\n }\n\n /**\n * Sets the first song in the playlist. This is used to fill in the meta\n * data in the playlist\n *\n * @param {object} song \t\t\t- The song we are setting to be the first song in the playlist\n * @param {string} playlist \t- Key of the playlist we are setting the first song in\n */\n function setFirstSongInPlaylist(song, playlist) {\n /*\n Define the image meta data keys. These are managed separately\n since we aren't actually changing the inner HTML of these elements.\n */\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n Get all of the song info elements\n */\n let songInfoElements = document.querySelectorAll(\n '[data-amplitude-song-info][data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n Iterate over all of the song info elements. We will either\n set these to the new values, or clear them if the active song\n doesn't have the info set.\n */\n for (let i = 0; i < songInfoElements.length; i++) {\n /*\n Get the info so we can check if the active meta data has the\n key.\n */\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Get the song info element playlist.\n */\n let elementPlaylist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n If the playlists match or the element is a main element, then\n we set the song info.\n */\n if (elementPlaylist == playlist) {\n /*\n If the active metadata has the key, then we set it,\n otherwise we clear it. If it's an image element then\n we default it to the default info if needed.\n */\n if (song[info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n songInfoElements[i].setAttribute(\"src\", song[info]);\n } else {\n songInfoElements[i].innerHTML = song[info];\n }\n } else {\n /*\n We look for the default album art because\n the actual key didn't exist. If the default album\n art doesn't exist then we set the src attribute\n to null.\n */\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n if (song.default_album_art != \"\") {\n songInfoElements[i].setAttribute(\"src\", song.default_album_art);\n } else {\n songInfoElements[i].setAttribute(\"src\", \"\");\n }\n } else {\n songInfoElements[i].innerHTML = \"\";\n }\n }\n }\n }\n }\n\n /**\n * Sets the meta data for songs loaded in the songs array\n */\n function syncMetaData() {\n /*\n\t\t Define the image meta data keys. These are managed separately\n\t\t since we aren't actually changing the inner HTML of these elements.\n\t */\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n\t\t Get all of the song info elements\n\t */\n let songInfoElements = document.querySelectorAll(\n \"[data-amplitude-song-info]\"\n );\n\n /*\n\t\t Iterate over all of the song info elements. We will either\n\t\t set these to the new values, or clear them if the active song\n\t\t doesn't have the info set.\n\t */\n for (let i = 0; i < songInfoElements.length; i++) {\n let songIndex = songInfoElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n let playlist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (songIndex != null && playlist == null) {\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Get the song info value referenced on the element. Depending on the type of\n element, we may need to fallback to another value when the direct value\n we want isn't found.\n i.e.\n data-amplitude-song-info=\"cover_art_url\" defaults to using the value\n of \"default_album_art\" when \"cover_art_url\" is missing on the song.\n */\n let val = config.songs[songIndex][info] != undefined ? config.songs[songIndex][info] : null;\n /*\n If it's an image meta data key, then we set the src attribute of\n the element. Otherwise we set the inner HTML of the element.\n */\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n /*\n If this is an image meta data key and the individual song doesn't\n have the key, use the default_album_art\n */\n val = val || config.default_album_art\n songInfoElements[i].setAttribute(\n \"src\",\n val\n );\n } else {\n songInfoElements[i].innerHTML = val;\n }\n }\n\n /*\n If the song index and playlist are not null, continue.\n */\n if (songIndex != null && playlist != null) {\n /*\n Get the info we are displaying.\n */\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Set the meta data accordingly.\n */\n if (config.playlists[playlist].songs[songIndex][info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n songInfoElements[i].setAttribute(\n \"src\",\n config.playlists[playlist].songs[songIndex][info]\n );\n } else {\n songInfoElements[i].innerHTML =\n config.playlists[playlist].songs[songIndex][info];\n }\n }\n }\n }\n\n /*\n Display the playlist meta data.\n */\n displayPlaylistMetaData();\n }\n\n /**\n * Returns publically facing methods\n */\n return {\n displayMetaData: displayMetaData,\n setFirstSongInPlaylist: setFirstSongInPlaylist,\n syncMetaData: syncMetaData,\n displayPlaylistMetaData: displayPlaylistMetaData\n };\n})();\n\nexport default MetaDataElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/metaDataElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the visual syncing to the state of the config for the repeat\n * elements.\n *\n * @module visual/RepeatElements\n */\nlet RepeatElements = (function() {\n /**\n * Syncs repeat for all of the repeat buttons. Users\n * can apply styles to the 'amplitude-repeat-on' and\n * 'amplitude-repeat-off' classes. They represent the state\n * of the player.\n */\n function syncRepeat() {\n /*\n\t\t\tGets all of the repeat classes\n\t\t*/\n let repeatClasses = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\tIterate over all of the repeat classes. If repeat is on,\n\t\t\tthen add the 'amplitude-repeat-on' class and remove the\n\t\t\t'amplitude-repeat-off' class. If it's off, then do the\n\t\t\topposite.\n\t\t*/\n for (let i = 0; i < repeatClasses.length; i++) {\n if (config.repeat) {\n repeatClasses[i].classList.add(\"amplitude-repeat-on\");\n repeatClasses[i].classList.remove(\"amplitude-repeat-off\");\n } else {\n repeatClasses[i].classList.remove(\"amplitude-repeat-on\");\n repeatClasses[i].classList.add(\"amplitude-repeat-off\");\n }\n }\n }\n\n /**\n * Syncs repeat for all of the playlist repeat buttons. Users\n * can apply styles to the `amplitude-repeat-on` and `amplitude-repeat-off`\n * classes. They repreent the state of the playlist in the player.\n */\n function syncRepeatPlaylist(playlist) {\n /*\n\t\t\t Gets all of the repeat buttons.\n\t\t */\n let repeatButtons = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\t Iterate over all of the repeat buttons\n\t\t */\n for (let i = 0; i < repeatButtons.length; i++) {\n /*\n\t\t\t\t Ensure that the repeat button belongs to matches the\n\t\t\t\t playlist we are syncing the state for.\n\t\t\t */\n if (\n repeatButtons[i].getAttribute(\"data-amplitude-playlist\") == playlist\n ) {\n /*\n\t\t\t\t\t If the state of the playlist is shuffled on, true, then\n\t\t\t\t\t we add the 'amplitude-repeat-on' class and remove the\n\t\t\t\t\t 'amplitude-repeat-off' class. If the player is not shuffled\n\t\t\t\t\t then we do the opposite.\n\t\t\t\t */\n if (config.playlists[playlist].repeat) {\n repeatButtons[i].classList.add(\"amplitude-repeat-on\");\n repeatButtons[i].classList.remove(\"amplitude-repeat-off\");\n } else {\n repeatButtons[i].classList.add(\"amplitude-repeat-off\");\n repeatButtons[i].classList.remove(\"amplitude-repeat-on\");\n }\n }\n }\n }\n\n /**\n * Syncs repeat for all of the repeat song buttons. Users\n * can apply styles to the 'amplitude-repeat-song-on' and\n * 'amplitude-repeat-song-off' classes. They represent the state\n * of the player.\n */\n function syncRepeatSong() {\n /*\n\t\t\tGets all of the repeat song classes\n\t\t*/\n let repeatSongClasses = document.getElementsByClassName(\n \"amplitude-repeat-song\"\n );\n\n /*\n\t\t\tIterate over all of the repeat song classes. If repeat is on,\n\t\t\tthen add the 'amplitude-repeat-song-on' class and remove the\n\t\t\t'amplitude-repeat-song-off' class. If it's off, then do the\n\t\t\topposite.\n\t\t*/\n for (let i = 0; i < repeatSongClasses.length; i++) {\n if (config.repeat_song) {\n repeatSongClasses[i].classList.add(\"amplitude-repeat-song-on\");\n repeatSongClasses[i].classList.remove(\"amplitude-repeat-song-off\");\n } else {\n repeatSongClasses[i].classList.remove(\"amplitude-repeat-song-on\");\n repeatSongClasses[i].classList.add(\"amplitude-repeat-song-off\");\n }\n }\n }\n\n /*\n Returns the publically available methods.\n */\n return {\n syncRepeat: syncRepeat,\n syncRepeatPlaylist: syncRepeatPlaylist,\n syncRepeatSong: syncRepeatSong\n };\n})();\n\nexport default RepeatElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/repeatElements.js","/**\n * Handles the visual state for all of the mute elements.\n *\n * @module visual/MuteElements\n */\nlet MuteElements = (function() {\n /**\n * Syncs mute for all of the mute buttons. This represents the\n * state of the player if it's muted or not.\n *\n * @access public\n * @param {string} state \t- The muted state of the player.\n */\n function setMuted(state) {\n /*\n\t\t\tGet all of the mute buttons.\n\t\t*/\n let muteClasses = document.getElementsByClassName(\"amplitude-mute\");\n\n /*\n\t\t\tIterate over all of the mute classes. If the state of the player\n\t\t\tis not-muted then we add the amplitude-not-muted classe and remove\n\t\t\tthe amplitude muted class otherwise we do the opposite.\n\t\t*/\n for (let i = 0; i < muteClasses.length; i++) {\n if (!state) {\n muteClasses[i].classList.add(\"amplitude-not-muted\");\n muteClasses[i].classList.remove(\"amplitude-muted\");\n } else {\n muteClasses[i].classList.remove(\"amplitude-not-muted\");\n muteClasses[i].classList.add(\"amplitude-muted\");\n }\n }\n }\n\n return {\n setMuted: setMuted\n };\n})();\n\nexport default MuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/muteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Keeps the volume slider elements in sync.\n * @module visual/VolumeSliderElements\n */\nlet VolumeSliderElements = (function() {\n /**\n * Visually syncs the volume sliders so they are all the same if there\n * are more than one.\n *\n * @access public\n */\n function sync() {\n let volumeSliders = document.getElementsByClassName(\n \"amplitude-volume-slider\"\n );\n\n /*\n\t\t\tIterates over all of the volume sliders for the song, setting the value\n\t\t\tto the config value.\n\t\t*/\n for (let i = 0; i < volumeSliders.length; i++) {\n volumeSliders[i].value = config.audio.volume * 100;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync\n };\n})();\n\nexport default VolumeSliderElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/volumeSliderElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Repeater utility. Handles setting the repeat for all scenarios.\n *\n * @module utilities/Repeater\n */\nlet Repeater = (function() {\n /**\n * Sets the state of the repeat for a song.\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat should be on or off\n */\n function setRepeat(repeat) {\n /*\n Set the global repeat to be toggled\n */\n config.repeat = repeat;\n }\n\n /**\n * Sets the state of the repeat for a playlist.\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat should be on or off\n * @param {string} playlist - The key of the playlist for repeating\n */\n function setRepeatPlaylist(repeat, playlist) {\n /*\n Set the playlist repeat to be toggled.\n */\n config.playlists[playlist].repeat = repeat;\n }\n\n /**\n * Sets the state of the repeat song\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat shoudl be on or off for the song.\n */\n function setRepeatSong(repeat) {\n config.repeat_song = repeat;\n }\n\n /*\n Returns the public facing methods\n */\n return {\n setRepeat: setRepeat,\n setRepeatPlaylist: setRepeatPlaylist,\n setRepeatSong: setRepeatSong\n };\n})();\n\nexport default Repeater;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/repeater.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Shuffle Module. Handles all of the shuffling functionality for\n * AmplitudeJS\n *\n * @module utilities/Shuffler\n */\nlet Shuffler = (function() {\n /**\n * Sets the shuffle state globally\n *\n * @access public\n * @param {boolean} shuffle - True when we are shuffling, false when we turn it off.\n */\n function setShuffle(shuffle) {\n config.shuffle_on = shuffle;\n\n if (shuffle) {\n shuffleSongs();\n } else {\n config.shuffle_list = [];\n }\n }\n\n /**\n * Toggles the shuffle status globally.\n *\n * @access public\n */\n function toggleShuffle() {\n /*\n If shuffle is on, we toggle it off. If shuffle is off, we\n toggle on.\n */\n if (config.shuffle_on) {\n config.shuffle_on = false;\n config.shuffle_list = [];\n } else {\n config.shuffle_on = true;\n shuffleSongs();\n }\n }\n\n /**\n * Sets the shuffle state for a playlist\n *\n * @access public\n * @param {string} playlist The key of the playlist we are shuffling.\n * @param {boolean} shuffle True when we are shuffling the playlist, false when we turn off shuffle.\n */\n function setShufflePlaylist(playlist, shuffle) {\n config.playlists[playlist].shuffle = shuffle;\n\n if (config.playlists[playlist].shuffle) {\n shufflePlaylistSongs(playlist);\n } else {\n config.playlists[playlist].shuffle_list = [];\n }\n }\n\n /**\n * Sets the shuffle state for a playlist\n *\n * @access public\n * @param {string} playlist The key of the playlist we are shuffling.\n */\n function toggleShufflePlaylist(playlist) {\n /*\n If the playlist shuffled is on, we toggle it off. If the\n playlist shuffled is off, we toggle it on.\n */\n if (config.playlists[playlist].shuffle) {\n config.playlists[playlist].shuffle = false;\n config.playlists[playlist].shuffle_list = [];\n } else {\n config.playlists[playlist].shuffle = true;\n shufflePlaylistSongs(playlist);\n }\n }\n\n /**\n * Shuffles individual songs in the config\n * Based off of: http://www.codinghorror.com/blog/2007/12/the-danger-of-naivete.html\n *\n * Public Accessor: Shuffle.shuffleSongs()\n *\n * @access public\n */\n function shuffleSongs() {\n /*\n\t\t\tBuilds a temporary array with the length of the config.\n\t\t*/\n let shuffleTemp = new Array(config.songs.length);\n\n /*\n\t\t\tSet the temporary array equal to the songs array.\n\t\t*/\n for (let i = 0; i < config.songs.length; i++) {\n shuffleTemp[i] = config.songs[i];\n }\n\n /*\n\t\t\tIterate ove rthe songs and generate random numbers to\n\t\t\tswap the indexes of the shuffle array.\n\t\t*/\n for (let i = config.songs.length - 1; i > 0; i--) {\n let randNum = Math.floor(Math.random() * config.songs.length + 1);\n shuffleSwap(shuffleTemp, i, randNum - 1);\n }\n\n /*\n\t\t\tSet the shuffle list to the shuffle temp.\n\t\t*/\n config.shuffle_list = shuffleTemp;\n }\n\n /**\n * Shuffle songs in a playlist\n *\n * Public Accessor: Shuffle.shufflePlaylistSongs( playlist )\n *\n * @access public\n * @param {string} playlist - The playlist we are shuffling.\n */\n function shufflePlaylistSongs(playlist) {\n /*\n Builds a temporary array with the length of the playlist songs.\n */\n let shuffleTemp = new Array(config.playlists[playlist].songs.length);\n\n /*\n Set the temporary array equal to the playlist array.\n */\n for (let i = 0; i < config.playlists[playlist].songs.length; i++) {\n shuffleTemp[i] = config.playlists[playlist].songs[i];\n }\n\n /*\n Iterate ove rthe songs and generate random numbers to\n swap the indexes of the shuffle array.\n */\n for (let i = config.playlists[playlist].songs.length - 1; i > 0; i--) {\n let randNum = Math.floor(\n Math.random() * config.playlists[playlist].songs.length + 1\n );\n shuffleSwap(shuffleTemp, i, randNum - 1);\n }\n\n /*\n Set the shuffle list to the shuffle temp.\n */\n config.playlists[playlist].shuffle_list = shuffleTemp;\n }\n\n /**\n * Swaps and randomizes the song shuffle.\n *\n * @access private\n * @param {object} shuffleList \t- The list of songs that is going to be shuffled\n * @param {number} original \t\t- The original index of he song in the songs array\n * @param {number} random \t\t\t- The randomized index that will be the new index of the song in the shuffle array.\n */\n function shuffleSwap(shuffleList, original, random) {\n let temp = shuffleList[original];\n shuffleList[original] = shuffleList[random];\n shuffleList[random] = temp;\n }\n\n /**\n * Returns public facing methods\n */\n return {\n setShuffle: setShuffle,\n toggleShuffle: toggleShuffle,\n setShufflePlaylist: setShufflePlaylist,\n toggleShufflePlaylist: toggleShufflePlaylist,\n shuffleSongs: shuffleSongs,\n shufflePlaylistSongs: shufflePlaylistSongs\n };\n})();\n\nexport default Shuffler;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/shuffler.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the visual representation of AmplitudeJS song slider elements.\n * @module visual/SongSliderElements\n */\nlet SongSliderElements = (function() {\n /**\n * Syncs all of the song slider elements.\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n * @param {number} songIndex \t- The index of the song we are adjusting the song slider for.\n */\n function sync(location, playlist, songIndex) {\n syncMain(location);\n syncPlaylist(location, playlist);\n syncSong(location, songIndex);\n syncSongInPlaylist(location, playlist);\n }\n\n /**\n * Syncs the main slider location\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n */\n function syncMain(location) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\tGets the main song sliders\n\t\t*/\n const mainSongSliders = document.querySelectorAll(\".amplitude-song-slider\");\n\n /*\n\t\t\tIterates over all of the main sliders and sets the value to the\n\t\t\tpercentage of the song played.\n\t\t*/\n for (let i = 0; i < mainSongSliders.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlist = mainSongSliders[i].getAttribute(\"data-amplitude-playlist\");\n let song = mainSongSliders[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n This method is responsible for only the global elements,\n so we make sure there are no playlist or songs defined on\n the element.\n */\n if (playlist == null && song == null) {\n mainSongSliders[i].value = location;\n }\n }\n }\n\n /**\n * Syncs playlist song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n */\n function syncPlaylist(location, playlist) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\tGets the playlist song sliders\n\t\t*/\n const playlistSongSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n\t\t\tIterates over all of the playlist sliders and sets the value to the\n\t\t\tpercentage of the song played.\n\t\t*/\n for (let i = 0; i < playlistSongSliders.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlistAttribute = playlistSongSliders[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songAttribute = playlistSongSliders[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\tThis method is responsible for only the playlist elements,\n\t\t\t\tso we make sure the playlist attribute matches what is passed\n\t\t\t\tin.\n\t\t\t*/\n if (playlistAttribute == playlist && songAttribute == null) {\n playlistSongSliders[i].value = location;\n }\n }\n }\n\n /**\n * Syncs individual song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {number} songIndex \t- The index of the song we are adjusting the song slider for.\n */\n function syncSong(location, songIndex) {\n /*\n\t\t\tWe only want to sync song sliders if the playlist is null.\n\t\t*/\n if (config.active_playlist == null) {\n /*\n\t\t\t\tEnsure we have a location that's a number\n\t\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\t\tGets the individual song sliders\n\t\t\t*/\n const songSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-song-index=\"' + songIndex + '\"]'\n );\n\n /*\n\t\t\t\tIterates over all of the individual song sliders and sets the value\n\t\t\t\tto the percentage of the song played.\n\t\t\t*/\n for (let i = 0; i < songSliders.length; i++) {\n /*\n\t Grab the playlist and song attributes from the element.\n\t */\n let playlistAttribute = songSliders[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songAttribute = songSliders[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\t\tThis method is responsible for only the playlist elements,\n\t\t\t\t\tso we make sure the playlist attribute matches what is passed\n\t\t\t\t\tin.\n\t\t\t\t*/\n if (playlistAttribute == null && songAttribute == songIndex) {\n songSliders[i].value = location;\n }\n }\n }\n }\n\n /**\n * Syncs individual song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n */\n function syncSongInPlaylist(location, playlist) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGets the song in playlist sliders\n\t\t*/\n const songInPlaylistSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-playlist=\"' +\n playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tIterates over all of the song in playlist sliders and sets the value\n\t\t\tto the percentage of the song played.\n\t\t*/\n for (let i = 0; i < songInPlaylistSliders.length; i++) {\n songInPlaylistSliders[i].value = location;\n }\n }\n\n /**\n * Visually syncs the song sliders back to 0. This usually happens when\n * a song has changed, we ensure that all song sliders get reset.\n *\n * @access public\n */\n function resetElements() {\n let songSliders = document.getElementsByClassName(\"amplitude-song-slider\");\n\n /*\n\t\t\tIterate over all of the song sliders and set them to\n\t\t\t0 essentially resetting them.\n\t\t*/\n for (let i = 0; i < songSliders.length; i++) {\n songSliders[i].value = 0;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n syncMain: syncMain,\n syncPlaylist: syncPlaylist,\n syncSong: syncSong,\n syncSongInPlaylist: syncSongInPlaylist,\n resetElements: resetElements\n };\n})();\n\nexport default SongSliderElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/songSliderElements.js","/**\n * Imports the AmplitudeJS Current Time\n * @module visual/time/CurrentTimeElements\n */\nimport CurrentTimeElements from \"./time/currentTimeElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Hour Elements\n * @module visual/time/CurrentHourElements\n */\nimport CurrentHourElements from \"./time/currentHourElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Minute Elements\n * @module visual/time/CurrentMinuteElements\n */\nimport CurrentMinuteElements from \"./time/currentMinuteElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Second Elements\n * @module visual/time/CurrentTimeElements\n */\nimport CurrentSecondElements from \"./time/currentSecondElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Count Down Time Elements\n * @module visual/time/DurationCountDownTimeElements\n */\nimport DurationCountDownTimeElements from \"./time/durationCountDownTimeElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Hour Elements\n * @module visual/time/DurationHourElements\n */\nimport DurationHourElements from \"./time/durationHourElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Minute Elements\n * @module visual/time/DurationMinuteElements\n */\nimport DurationMinuteElements from \"./time/durationMinuteElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Second Elements\n * @module visual/time/DurationSecondElements\n */\nimport DurationSecondElements from \"./time/durationSecondElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Time Elements\n * @module visual/time/DurationTimeElements\n */\nimport DurationTimeElements from \"./time/durationTimeElements.js\";\n\n/**\n * Time Elements Interface. This allows us to update all of the sub time elements\n * through one central point.\n * @module visual/TimeElements\n */\nlet TimeElements = (function() {\n /**\n * Resets the current times.\n */\n function resetCurrentTimes() {\n CurrentTimeElements.resetTimes();\n CurrentHourElements.resetTimes();\n CurrentMinuteElements.resetTimes();\n CurrentSecondElements.resetTimes();\n }\n\n /**\n * Syncs the current time elements to the time provided.\n *\n * @param {Object} currentTime - An object representing the current time of the audio.\n */\n function syncCurrentTimes(currentTime) {\n CurrentTimeElements.sync(currentTime);\n CurrentHourElements.sync(currentTime.hours);\n CurrentMinuteElements.sync(currentTime.minutes);\n CurrentSecondElements.sync(currentTime.seconds);\n }\n\n /**\n * Resets the duration times.\n */\n function resetDurationTimes() {\n DurationCountDownTimeElements.resetTimes();\n DurationHourElements.resetTimes();\n DurationMinuteElements.resetTimes();\n DurationSecondElements.resetTimes();\n DurationTimeElements.resetTimes();\n }\n\n /**\n * Syncs the duration times to the times provided.\n *\n * @param {Object} currentTime - An object representing the current time of the audio.\n * @param {Object} songDuration - An object representing the duration of the audio\n */\n function syncDurationTimes(currentTime, songDuration) {\n DurationCountDownTimeElements.sync(currentTime, songDuration);\n DurationTimeElements.sync(songDuration);\n DurationHourElements.sync(songDuration.hours);\n DurationMinuteElements.sync(songDuration.minutes);\n DurationSecondElements.sync(songDuration.seconds);\n }\n\n /**\n * Returns the publically accessible methods.\n */\n return {\n resetCurrentTimes: resetCurrentTimes,\n syncCurrentTimes: syncCurrentTimes,\n resetDurationTimes: resetDurationTimes,\n syncDurationTimes: syncDurationTimes\n };\n})();\n\nexport default TimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/timeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the debug module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Handles the visualizations elements.\n *\n * @module Visualizations\n */\nlet Visualizations = (function() {\n /**\n * Runs all of the visualizations on the screen.\n */\n function run() {\n /*\n Get all of the visualization elements on the page\n */\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n /*\n If the web audio API is available, we display the visualizations.\n */\n if (config.web_audio_api_available) {\n /*\n If the visualization has not started, there are visualizations available,\n and we have at least one visualization element, then we continue.\n */\n if (\n Object.keys(config.visualizations.available).length > 0 &&\n visualizationElements.length > 0\n ) {\n /*\n Iterate over all of the visualizations on the page and activate the\n ones we need.\n */\n for (let i = 0; i < visualizationElements.length; i++) {\n /*\n Grab the playlist and song attributes from the visualization to\n determine which one we run.\n */\n let playlist = visualizationElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = visualizationElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n If the playlist and song are null, it's a global visualization element.\n */\n if (playlist == null && song == null) {\n runGlobalVisualization(visualizationElements[i]);\n }\n\n /*\n if the playlist is not null and the song is null it's a playlist visualization\n element.\n */\n if (playlist != null && song == null) {\n runPlaylistVisualization(visualizationElements[i], playlist);\n }\n\n /*\n If the playlist is null and the song is not null it's a song visualization element.\n */\n if (playlist == null && song != null) {\n runSongVisualization(visualizationElements[i], song);\n }\n\n /*\n If the playlist and song are not null then it's a song in playlist visualization\n element.\n */\n if (playlist != null && song != null) {\n runSongInPlaylistVisualization(\n visualizationElements[i],\n playlist,\n song\n );\n }\n }\n }\n } else {\n displayBackups();\n }\n }\n\n /**\n * Runs a global visualization\n *\n * @param {Node} element The container element that handles the visualization.\n */\n function runGlobalVisualization(element) {\n /*\n Gets the global visualization index and the active song visualization indexes\n so we know which visualization to use. The song will override the global\n */\n let globalVisualizationIndex = config.visualization;\n let activeSongVisualizationIndex =\n config.active_index != null\n ? config.songs[config.active_index].visualization\n : config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n\n /*\n If the active song visualization is defined and the visualization exists,\n use that visualization.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the user defined a global visualization, use that one.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n\n /*\n If the user didn't define a global visualization, use the first visualization\n registered if there is one.\n */\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n\n /**\n * Run a specific playlist visualization.\n *\n * @param {Node} element The container element that handles the visualization.\n * @param {string} playlist The key of the playlist we are running the visualization for.\n */\n function runPlaylistVisualization(element, playlist) {\n /*\n If the playlist is equal to the active playlist, then we continue.\n */\n if (playlist == config.active_playlist) {\n /*\n Checks if the song has a visualization and that visualization exists,\n run that visualization.\n */\n let activeSongVisualizationIndex =\n config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n let activePlaylistVisualizationIndex =\n config.playlists[config.active_playlist].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the actual song has a visualization, we run that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the actual playlist has a visualization, run that.\n */\n } else if (\n activePlaylistVisualizationIndex != undefined &&\n config.visualizations.available[activePlaylistVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activePlaylistVisualizationIndex, element);\n\n /*\n If a global visualization is defined, run that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Run a song specific visualization.\n *\n * @param {Node} element The container element that handles the visualization.\n * @param {string} song The song index that we are running the visualization for.\n */\n function runSongVisualization(element, song) {\n /*\n If the song is equal to the active song, then we continue.\n */\n if (song == config.active_index) {\n /*\n Get the indexes of the song\n */\n let activeSongVisualizationIndex =\n config.songs[config.active_index].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the song has a visualization, run that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the global visualization is set, use that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Run a song in playlist visualization.\n *\n * @param {Node} element - The element containing the visualization.\n * @param {string} playlist - The string of the playlist key.\n * @param {index} song - The index of the song in the playlist.\n */\n function runSongInPlaylistVisualization(element, playlist, song) {\n /*\n If the playlist is the same as the active playlist and the active\n index of the song is the same as the song, then we continue.\n */\n if (\n playlist == config.active_playlist &&\n config.playlists[playlist].active_index == song\n ) {\n /*\n Checks if the song has a visualization and that visualization exists,\n run that visualization.\n */\n let activeSongVisualizationIndex =\n config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n let activePlaylistVisualizationIndex =\n config.playlists[config.active_playlist].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the active song has a visualization, we use that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the active playlist has a visualization, we use that.\n */\n } else if (\n activePlaylistVisualizationIndex != undefined &&\n config.visualizations.available[activePlaylistVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activePlaylistVisualizationIndex, element);\n\n /*\n If the global visualization has been set, we use that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Add a visualization to the array of active visualizations.\n *\n * @param {string} key - The key of the active visualization.\n * @param {Node} element - The element that the visualization will be applied to.\n */\n function addToActiveVisualizations(key, element) {\n let visualization = new config.visualizations.available[key][\"object\"]();\n visualization.setPreferences(\n config.visualizations.available[key][\"preferences\"]\n );\n visualization.startVisualization(element);\n config.visualizations.active.push(visualization);\n }\n\n /**\n * Stops all active visualizations.\n */\n function stop() {\n /*\n Iterates over all of the visualizations and stop the visualization.\n */\n for (let i = 0; i < config.visualizations.active.length; i++) {\n config.visualizations.active[i].stopVisualization();\n }\n\n /*\n Clear the active visualizations.\n */\n config.visualizations.active = [];\n }\n\n /**\n * Registers any visualization we can use.\n *\n * @param {object} visualization The visualization object itself\n * @param {object} preferences User preferences overrides.\n */\n function register(visualization, preferences) {\n /*\n Initialize the new visualization.\n */\n let newVisualization = new visualization();\n\n /*\n\t Adds the visualization to the global config so it knows\n\t it can be used when playing songs.\n\n\t getID is a public function for getting a visualization's id.\n\t It becomes the key to access the visualization.\n\t */\n config.visualizations.available[newVisualization.getID()] = new Array();\n config.visualizations.available[newVisualization.getID()][\n \"object\"\n ] = visualization;\n config.visualizations.available[newVisualization.getID()][\n \"preferences\"\n ] = preferences;\n }\n\n /**\n * Displays the backups for the visualizations.\n */\n function displayBackups() {\n /*\n Get all of the visualization elements on the page\n */\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n if (visualizationElements.length > 0) {\n for (let x = 0; x < visualizationElements.length; x++) {\n /*\n Grab the playlist and song attributes from the visualization to\n determine which one we run.\n */\n let playlist = visualizationElements[x].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = visualizationElements[x].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n If the playlist and song are null, it's a global visualization element.\n */\n if (playlist == null && song == null) {\n displayGlobalBackup(visualizationElements[x]);\n }\n\n /*\n if the playlist is not null and the song is null it's a playlist visualization\n element.\n */\n if (playlist != null && song == null) {\n displayPlaylistBackup(visualizationElements[x], playlist);\n }\n\n /*\n If the playlist is null and the song is not null it's a song visualization element.\n */\n if (playlist == null && song != null) {\n displaySongBackup(visualizationElements[x], song);\n }\n\n /*\n If the playlist and song are not null then it's a song in playlist visualization\n element.\n */\n if (playlist != null && song != null) {\n displaySongInPlaylistBackup(visualizationElements[x], playlist, song);\n }\n }\n }\n }\n\n /**\n * Displays the global backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displayGlobalBackup(element) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n\n /**\n * Displays the playlist backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displayPlaylistBackup(element, playlist) {\n if (config.active_playlist == playlist) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /**\n * Displays the song backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displaySongBackup(element, song) {\n if (config.active_index == song) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /**\n * Displays the song in playlist backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displaySongInPlaylistBackup(element, playlist, song) {\n if (\n config.active_playlist == playlist &&\n config.playlists[active_playlist].active_index == song\n ) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n run: run,\n stop: stop,\n register: register\n };\n})();\n\nexport default Visualizations;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/visualizations.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the initializer\n * @module init/AmplitudeInitializer\n */\nimport AmplitudeInitializer from \"../init/init.js\";\n\n/**\n * These helpers wrap around the basic methods of the Soundcloud API\n * and get the information we need from SoundCloud to make the songs\n * streamable through Amplitude\n *\n * @module soundcloud/SoundCloud\n */\nlet SoundCloud = (function() {\n /**\n * Defines the temporary user config used while we configure soundcloud\n * @type {object}\n */\n let tempUserConfig = {};\n\n /**\n * Loads the soundcloud SDK for use with Amplitude so the user doesn't have\n * to load it themselves.\n * With help from: http://stackoverflow.com/questions/950087/include-a-javascript-file-in-another-javascript-file\n *\n * @access public\n * @param {object} userConfig \t- The config defined by the user for AmplitudeJS\n */\n function loadSoundCloud(userConfig) {\n /*\n\t\t\tSets the temporary config to the config passed by the user so we can make changes\n\t\t\tand not break the actual config.\n\t\t*/\n tempUserConfig = userConfig;\n\n /*\n\t\t\tGets the head tag for the document and create a script element.\n\t\t*/\n let head = document.getElementsByTagName(\"head\")[0];\n let script = document.createElement(\"script\");\n\n script.type = \"text/javascript\";\n\n /*\n\t\t\tURL to the remote soundcloud SDK\n\t\t*/\n script.src = \"https://connect.soundcloud.com/sdk.js\";\n script.onreadystatechange = initSoundcloud;\n script.onload = initSoundcloud;\n\n /*\n\t\t\tAdd the script to the head of the document.\n\t\t*/\n head.appendChild(script);\n }\n\n /**\n * Initializes soundcloud with the key provided.\n *\n * @access private\n */\n function initSoundcloud() {\n /*\n\t\t\tCalls the SoundCloud initialize function\n\t\t\tfrom their API and sends it the client_id\n\t\t\tthat the user passed in.\n\t\t*/\n SC.initialize({\n client_id: config.soundcloud_client\n });\n\n /*\n\t\t\tGets the streamable URLs to run through Amplitue. This is\n\t\t\tVERY important since Amplitude can't stream the copy and pasted\n\t\t\tlink from the SoundCloud page, but can resolve the streaming\n\t\t\tURLs from the link.\n\t\t*/\n getStreamableURLs();\n }\n\n /**\n * Gets the streamable URL from the URL provided for\n * all of the soundcloud links. This will loop through\n * and set all of the information for the soundcloud\n * urls.\n *\n * @access private\n */\n function getStreamableURLs() {\n /*\n\t\t\tDefine the regex to find the soundcloud URLs\n\t\t*/\n let soundcloud_regex = /^https?:\\/\\/(soundcloud.com|snd.sc)\\/(.*)$/;\n\n for (let i = 0; i < config.songs.length; i++) {\n /*\n\t\t\t\tIf the URL matches soundcloud, we grab\n\t\t\t\tthat url and get the streamable link\n\t\t\t\tif there is one.\n\t\t\t*/\n if (config.songs[i].url.match(soundcloud_regex)) {\n config.soundcloud_song_count++;\n resolveStreamable(config.songs[i].url, i);\n }\n }\n }\n\n /**\n * Resolves an individual streamable URL.\n *\n * @param {string} url - The URL of the SoundCloud song to get the streamable URL from.\n * @param {string} playlist - The playlist we are getting the streamable URL for.\n * @param {Integer} index - The index of the song in the playlist or the songs array.\n * @param {boolean} addToShuffleList - Whether we add to the shuffle list for the songs or playlist.\n *\n */\n function resolveIndividualStreamableURL(\n url,\n playlist,\n index,\n addToShuffleList = false\n ) {\n SC.get(\"/resolve/?url=\" + url, function(sound) {\n /*\n If streamable we get the url and bind the client ID to the end\n so Amplitude can just stream the song normally. We then overwrite\n the url the user provided with the streamable URL.\n */\n if (sound.streamable) {\n if (playlist != null) {\n config.playlists[playlist].songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n }\n /*\n If the user want's to use soundcloud art, we overwrite the\n cover_art_url with the soundcloud artwork url.\n */\n if (config.soundcloud_use_art) {\n config.playlists[playlist].songs[index].cover_art_url =\n sound.artwork_url;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[index].cover_art_url =\n sound.artwork_url;\n }\n }\n\n /*\n Grab the extra metadata from soundcloud and bind it to the\n song. The user can get this through the public function:\n getActiveSongMetadata\n */\n config.playlists[playlist].songs[index].soundcloud_data = sound;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[\n index\n ].soundcloud_data = sound;\n }\n } else {\n config.songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n if (addToShuffleList) {\n config.shuffle_list[index].stream_url +\n \"?client_id=\" +\n config.soundcloud_client;\n }\n\n /*\n If the user want's to use soundcloud art, we overwrite the\n cover_art_url with the soundcloud artwork url.\n */\n if (config.soundcloud_use_art) {\n config.songs[index].cover_art_url = sound.artwork_url;\n\n if (addToShuffleList) {\n config.shuffle_list[index].cover_art_url = sound.artwork_url;\n }\n }\n\n /*\n Grab the extra metadata from soundcloud and bind it to the\n song. The user can get this through the public function:\n getActiveSongMetadata\n */\n config.songs[index].soundcloud_data = sound;\n\n if (addToShuffleList) {\n config.shuffle_list[index].soundcloud_data = sound;\n }\n }\n } else {\n if (playlist != null) {\n AmplitudeHelpers.writeDebugMessage(\n config.playlists[playlist].songs[index].name +\n \" by \" +\n config.playlists[playlist].songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n } else {\n /*\n If not streamable, then we print a message to the user stating\n that the song with name X and artist X is not streamable. This\n gets printed ONLY if they have debug turned on.\n */\n AmplitudeHelpers.writeDebugMessage(\n config.songs[index].name +\n \" by \" +\n config.songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n }\n }\n });\n }\n\n /**\n * Due to Soundcloud SDK being asynchronous, we need to scope the\n * index of the song in another function. The privateGetSoundcloudStreamableURLs\n * function does the actual iteration and scoping.\n *\n * @access private\n * @param {string} url \t\t- URL of the soundcloud song\n * @param {number} index \t- The index of the soundcloud song in the songs array.\n */\n function resolveStreamable(url, index) {\n SC.get(\"/resolve/?url=\" + url, function(sound) {\n /*\n\t\t\t\tIf streamable we get the url and bind the client ID to the end\n\t\t\t\tso Amplitude can just stream the song normally. We then overwrite\n\t\t\t\tthe url the user provided with the streamable URL.\n\t\t\t*/\n if (sound.streamable) {\n config.songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n /*\n\t\t\t\t\tIf the user want's to use soundcloud art, we overwrite the\n\t\t\t\t\tcover_art_url with the soundcloud artwork url.\n\t\t\t\t*/\n if (config.soundcloud_use_art) {\n config.songs[index].cover_art_url = sound.artwork_url;\n }\n\n /*\n\t\t\t\t\tGrab the extra metadata from soundcloud and bind it to the\n\t\t\t\t\tsong. The user can get this through the public function:\n\t\t\t\t\tgetActiveSongMetadata\n\t\t\t\t*/\n config.songs[index].soundcloud_data = sound;\n } else {\n /*\n\t\t\t\t\tIf not streamable, then we print a message to the user stating\n\t\t\t\t\tthat the song with name X and artist X is not streamable. This\n\t\t\t\t\tgets printed ONLY if they have debug turned on.\n\t\t\t\t*/\n AmplitudeHelpers.writeDebugMessage(\n config.songs[index].name +\n \" by \" +\n config.songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n }\n /*\n\t\t\t\tIncrements the song ready counter.\n\t\t\t*/\n config.soundcloud_songs_ready++;\n\n /*\n\t\t\t\tWhen all songs are accounted for, then amplitude is ready\n\t\t\t\tto rock and we set the rest of the config.\n\t\t\t*/\n if (config.soundcloud_songs_ready == config.soundcloud_song_count) {\n AmplitudeInitializer.setConfig(tempUserConfig);\n }\n });\n }\n\n /**\n * Determines if a given URL is a SoundCloud URL.\n *\n * @param {string} url - The URL to test if it's a SoundCloud URL.\n */\n function isSoundCloudURL(url) {\n let soundcloud_regex = /^https?:\\/\\/(soundcloud.com|snd.sc)\\/(.*)$/;\n\n return url.match(soundcloud_regex);\n }\n\n /*\n\t\tReturns the publically accessible methods\n\t*/\n return {\n loadSoundCloud: loadSoundCloud,\n resolveIndividualStreamableURL: resolveIndividualStreamableURL,\n isSoundCloudURL: isSoundCloudURL\n };\n})();\n\nexport default SoundCloud;\n\n\n\n// WEBPACK FOOTER //\n// ./src/soundcloud/soundcloud.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the Playback Speed Visual Elements Handler\n * @module visual/PlaybackSpeedElements\n */\nlet PlaybackSpeedElements = (function() {\n /**\n * Sets all of the visual playback speed buttons to have the right class\n * to display the background image that represents the current playback\n * speed.\n *\n * @access public\n */\n function sync() {\n /*\n\t\t\tGets all of the playback speed classes.\n\t\t*/\n let playbackSpeedClasses = document.getElementsByClassName(\n \"amplitude-playback-speed\"\n );\n\n /*\n\t\t\tIterates over all of the playback speed classes\n\t\t\tapplying the right speed class for visual purposes.\n\t\t*/\n for (let i = 0; i < playbackSpeedClasses.length; i++) {\n /*\n\t\t\t\tRemoves all of the old playback speed classes.\n\t\t\t*/\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-10\");\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-15\");\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-20\");\n\n /*\n\t\t\t\tSwitch the current playback speed and apply the appropriate\n\t\t\t\tspeed class.\n\t\t\t*/\n switch (config.playback_speed) {\n case 1:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-10\");\n break;\n case 1.5:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-15\");\n break;\n case 2:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-20\");\n break;\n }\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync\n };\n})();\n\nexport default PlaybackSpeedElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/playbackSpeedElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the shuffle elements\n * @module visual/ShuffleElements\n */\nlet ShuffleElements = (function() {\n /**\n * Syncs the global shuffle button visual state.\n *\n * @access public\n */\n function syncMain() {\n /*\n\t\t\tGets the shuffle buttons.\n\t\t*/\n let shuffleButtons = document.getElementsByClassName(\"amplitude-shuffle\");\n\n /*\n\t\t\tIterate over all of the shuffle buttons.\n\t\t*/\n for (let i = 0; i < shuffleButtons.length; i++) {\n /*\n\t\t\t\tEnsure the shuffle button doesn't belong to a playlist. We have\n\t\t\t\ta separate method for that.\n\t\t\t*/\n if (shuffleButtons[i].getAttribute(\"data-amplitude-playlist\") == null) {\n /*\n\t\t\t\t\tIf the state of the player is shuffled on, true, then\n\t\t\t\t\twe add the 'amplitude-shuffle-on' class and remove the\n\t\t\t\t\t'amplitude-shuffle-off' class. If the player is not shuffled\n\t\t\t\t\tthen we do the opposite.\n\t\t\t\t*/\n if (config.shuffle_on) {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-on\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-off\");\n } else {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-off\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-on\");\n }\n }\n }\n }\n\n /**\n * Syncs the playlist shuffle button visual state.\n *\n * @access public\n * @param {string} playlist - The playlist string the shuffle button belongs to.\n */\n function syncPlaylist(playlist) {\n /*\n\t\t\tGets all of the shuffle buttons.\n\t\t*/\n let shuffleButtons = document.querySelectorAll(\n '.amplitude-shuffle[data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n\t\t\tIterate over all of the shuffle buttons\n\t\t*/\n for (let i = 0; i < shuffleButtons.length; i++) {\n /*\n\t\t\t\tIf the state of the playlist is shuffled on, true, then\n\t\t\t\twe add the 'amplitude-shuffle-on' class and remove the\n\t\t\t\t'amplitude-shuffle-off' class. If the player is not shuffled\n\t\t\t\tthen we do the opposite.\n\t\t\t*/\n if (config.playlists[playlist].shuffle) {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-on\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-off\");\n } else {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-off\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-on\");\n }\n }\n }\n\n /**\n * Returns public facing methods\n */\n return {\n syncMain: syncMain,\n syncPlaylist: syncPlaylist\n };\n})();\n\nexport default ShuffleElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/shuffleElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the syncing of the song played progress elements.\n *\n * @module visual/SongPlayedProgressElements\n */\nlet SongPlayedProgressElements = (function() {\n /**\n * Syncs the song played progress bars. These are HTML5 progress elements.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percentage of the song that has been played.\n */\n function sync(songPlayedPercentage) {\n syncGlobal(songPlayedPercentage);\n syncPlaylist(songPlayedPercentage);\n syncSong(songPlayedPercentage);\n syncSongInPlaylist(songPlayedPercentage);\n }\n\n /**\n * Sync how much has been played with a progress bar. This is the global progress bar.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncGlobal(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n \".amplitude-song-played-progress\"\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is the playlist progress bar.\n *\n * @access public\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncPlaylist(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let song = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (song == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is for an individual song.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncSong(percentage) {\n if (config.active_playlist == null) {\n /*\n\t\t\t\tEnsure that the song completion percentage is a number\n\t\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\t\tGet all of the song progress bars\n\t\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is for an individual song in playlist.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncSongInPlaylist(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n Iterates over all of the song played progress elements\n and sets them accordingly.\n */\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist != null && songIndex != null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sets all of the song played progress bars to 0\n *\n * @access public\n */\n function resetElements() {\n let songPlayedProgressBars = document.getElementsByClassName(\n \"amplitude-song-played-progress\"\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n songPlayedProgressBars[i].value = 0;\n }\n }\n\n return {\n sync: sync,\n resetElements: resetElements\n };\n})();\n\nexport default SongPlayedProgressElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/songPlayedProgressElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Core Module\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * AmplitudeJS SoundCloud Module\n * @module soundcloud/SoundCloud\n */\nimport SoundCloud from \"../soundcloud/soundcloud.js\";\n\n/**\n * Imports the utilities used by the main module.\n */\n/**\n * AmplitudeJS Config State Module\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Checks Module\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * AmplitudeJS Shuffler Module\n * @module utilities/Shuffler\n */\nimport Shuffler from \"../utilities/shuffler.js\";\n\n/**\n * AmplitudeJS Events Module\n * @module events/Events\n */\nimport Events from \"../events/events.js\";\n\n/**\n * AmplitudeJS FX Module\n * @module fx/Fx\n */\nimport Fx from \"../fx/fx.js\";\n\n/**\n * AmplitudeJS Visualizations Module\n * @module fx/Visualizations\n */\nimport Visualizations from \"../fx/visualizations.js\";\n\n/**\n * AmplitudeJS WaveForm Module\n * @module fx/WaveForm\n */\nimport WaveForm from \"../fx/waveform.js\";\n\n/**\n * AmplitudeJS Audio Navigation Module.\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Callbacks Module\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * AmplitudeJS Playlists Initializer Module\n * @module init/Playlists\n */\nimport PlaylistsInitializer from \"./playlists.js\";\n\n/**\n * Imports the AmplitudeJS Shuffle Elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"../visual/shuffleElements.js\";\n\n/**\n * Imports the AmplitudeJS Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Volume Slider\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Imports the AmplitudeJS Time Elements\n * @module visual/TimeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Imports the AmplitudeJS Play/Pause Elements Module.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the AmplitudeJS MetaData Elements Module.\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Imports the AmplitudeJS PlaybackSpeedElements Module.\n * @module visual/PlayBackSpeedElements\n */\nimport PlaybackSpeedElements from \"../visual/playbackSpeedElements.js\";\n\n/**\n * Imports the AmplitudeJS Repeat Element\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * AmplitudeJS Initializer Module. Helps with the handling of all of the\n * initialization for AmplitudeJS.\n *\n * @module init/Initializer\n */\nlet Initializer = (function() {\n /**\n * The main init function. The user will call this through\n * Amplitude.init({}) and pass in their settings.\n *\n * Public Accessor: Amplitude.init( user_config_json )\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function initialize(userConfig) {\n let ready = false;\n\n /*\n\t\t\tReset the config on init so we have a clean slate. This is if the\n\t\t\tuser has to re-init.\n\t\t*/\n ConfigState.resetConfig();\n\n /*\n\t\t\tInitialize event handlers on init. This will clear any old\n\t\t\tevent handlers on the amplitude element and re-bind what is\n\t\t\tnecessary.\n\t\t*/\n Events.initialize();\n\n /*\n Initialize the callbacks we listen to for the audio object.\n */\n Callbacks.initialize();\n\n /*\n\t\t\tInitializes debugging right away so we can use it for the rest\n\t\t\tof the configuration.\n\t\t*/\n config.debug = userConfig.debug != undefined ? userConfig.debug : false;\n\n /*\n Set default artwork, if specified.\n */\n setArt(userConfig)\n\n /*\n\t\t\tChecks to see if the user has songs defined.\n\t\t*/\n if (userConfig.songs) {\n /*\n\t\t\t\tChecks to see if the user has some songs in the songs array.\n\t\t\t*/\n if (userConfig.songs.length != 0) {\n /*\n\t\t\t\t\tCopies over the user defined songs. and prepares\n\t\t\t\t\tAmplitude for the rest of the configuration.\n\t\t\t\t*/\n config.songs = userConfig.songs;\n /*\n\t\t\t\t\tFlag amplitude as ready.\n\t\t\t\t*/\n ready = true;\n } else {\n Debug.writeMessage(\"Please add some songs, to your songs object!\");\n }\n } else {\n Debug.writeMessage(\n \"Please provide a songs object for AmplitudeJS to run!\"\n );\n }\n\n /*\n\t\t\tInitializes the audio context. In this method it checks to see if the\n\t\t\tuser wants to use visualizations or not before proceeding.\n\t\t*/\n if (Fx.webAudioAPIAvailable()) {\n if( Fx.determineUsingAnyFX() ){\n /*\n Configure the Web Audio API If It's available.\n */\n Fx.configureWebAudioAPI();\n\n /*\n Activates the audio context after an event for the user.\n */\n document.documentElement.addEventListener(\n \"mousedown\", function(){\n if (config.context.state !== 'running') {\n config.context.resume();\n }\n });\n\n document.documentElement.addEventListener(\n \"keydown\", function(){\n if (config.context.state !== 'running') {\n config.context.resume();\n }\n });\n\n document.documentElement.addEventListener(\n \"keyup\", function(){\n if (config.context.state !== 'running') {\n config.context.resume();\n }\n });\n \n \n\n /*\n Set the user waveform settings if provided.\n */\n if (\n userConfig.waveforms != undefined &&\n userConfig.waveforms.sample_rate != undefined\n ) {\n config.waveforms.sample_rate = userConfig.waveforms.sample_rate;\n }\n\n /*\n Initialize the waveform.\n */\n WaveForm.init();\n\n /*\n If the user is registering visualizations on init,\n we set them right away.\n */\n if (\n userConfig.visualizations != undefined &&\n userConfig.visualizations.length > 0\n ) {\n /*\n Iterate over all of the visualizations and\n register them in our player.\n */\n for (let i = 0; i < userConfig.visualizations.length; i++) {\n Visualizations.register(\n userConfig.visualizations[i].object,\n userConfig.visualizations[i].params\n );\n }\n }\n }\n } else {\n Debug.writeMessage(\n \"The Web Audio API is not available on this platform. We are using your defined backups!\"\n );\n }\n\n /*\n Initialize default live settings\n */\n initializeDefaultLiveSettings();\n\n /*\n Initialize default song indexes\n */\n initializeDefaultSongIndexes();\n\n /*\n\t\t\tWhen the preliminary config is ready, we are ready to proceed.\n\t\t*/\n if (ready) {\n /*\n\t\t\t\tCopies over the soundcloud information to the global config\n\t\t\t\twhich will determine where we go from there.\n\t\t\t*/\n config.soundcloud_client =\n userConfig.soundcloud_client != undefined\n ? userConfig.soundcloud_client\n : \"\";\n\n /*\n\t\t\t\tChecks if we want to use the art loaded from soundcloud.\n\t\t\t*/\n config.soundcloud_use_art =\n userConfig.soundcloud_use_art != undefined\n ? userConfig.soundcloud_use_art\n : \"\";\n\n /*\n\t\t\t\tIf the user provides a soundcloud client then we assume that\n\t\t\t\tthere are URLs in their songs that will reference SoundCloud.\n\t\t\t\tWe then copy over the user config they provided to the\n\t\t\t\ttemp_user_config so we don't mess up the global or their configs\n\t\t\t\tand load the soundcloud information.\n\t\t\t*/\n let tempUserConfig = {};\n\n /*\n If there's a soundcloud_client key set, we load the SoundCloud data\n for all of the songs in the array.\n */\n if (config.soundcloud_client != \"\") {\n tempUserConfig = userConfig;\n\n /*\n\t\t\t\t\tLoad up SoundCloud for use with AmplitudeJS.\n\t\t\t\t*/\n SoundCloud.loadSoundCloud(tempUserConfig);\n } else {\n /*\n\t\t\t\t\tThe user is not using Soundcloud with Amplitude at this point\n\t\t\t\t\tso we just finish the configuration with the users's preferences.\n\t\t\t\t*/\n setConfig(userConfig);\n }\n }\n\n /*\n\t\t\tDebug out what was initialized with AmplitudeJS.\n\t\t*/\n Debug.writeMessage(\"Initialized With: \");\n Debug.writeMessage(config);\n }\n\n /**\n * Rebinds all of the elements in the display.\n *\n * Public Accessor: Amplitude.rebindDisplay()\n * @access public\n */\n function rebindDisplay() {\n Events.initialize();\n MetaDataElements.displayMetaData();\n }\n\n /**\n * Finishes the initalization of the config. Takes all of the user defined\n * parameters and makes sure they override the defaults. The important\n * config information is assigned in the publicInit() function.\n *\n * This function can be called from 2 different locations:\n * \t1. Right away on init after the important settings are defined.\n *\n * \t2. After all of the Soundcloud URLs are resolved properly and\n *\t \tsoundcloud is configured. We will need the proper URLs from Soundcloud\n * \t\tto stream through Amplitude so we get those right away before we\n * \t\tset the information and the active song\n *\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function setConfig(userConfig) {\n /*\n Checks if the user has any playlists defined. If they do\n we have to initialize the functionality for the playlists.\n */\n if (userConfig.playlists && countPlaylists(userConfig.playlists) > 0) {\n PlaylistsInitializer.initialize(userConfig.playlists);\n }\n\n /*\n\t\t\tCheck to see if the user entered a start song\n\t\t*/\n if (userConfig.start_song != undefined && userConfig.starting_playlist) {\n /*\n\t\t\t\tEnsure what has been entered is an integer.\n\t\t\t*/\n if (Checks.isInt(userConfig.start_song)) {\n AudioNavigation.changeSong(\n config.songs[userConfig.start_song],\n userConfig.start_song\n );\n } else {\n Debug.writeMessage(\n \"You must enter an integer index for the start song.\"\n );\n }\n } else {\n AudioNavigation.changeSong(config.songs[0], 0);\n }\n\n /*\n If the shuffle is on by default, shuffle the songs and\n switch to the shuffled song.\n */\n if (userConfig.shuffle_on != undefined && userConfig.shuffle_on) {\n config.shuffle_on = true;\n Shuffler.shuffleSongs();\n\n AudioNavigation.changeSong(config.shuffle_list[0], 0);\n }\n\n /*\n\t\t\tAllows the user to set whether they want to continue to the next song\n\t\t\twhen the current song finishes or not. In any scenario that's not a playlist,\n\t\t\tcontining to the next song may not be desired.\n\t\t*/\n config.continue_next =\n userConfig.continue_next != undefined ? userConfig.continue_next : true;\n\n /*\n\t\t\tIf the user defined a playback speed, we copy over their\n\t\t\tpreference here, otherwise we default to normal playback\n\t\t\tspeed of 1.0.\n\t\t*/\n config.playback_speed =\n userConfig.playback_speed != undefined ? userConfig.playback_speed : 1.0;\n\n /*\n\t\t\tSets the audio playback speed.\n\t\t*/\n Core.setPlaybackSpeed(config.playback_speed);\n\n /*\n\t\t\tIf the user wants the song to be pre-loaded for instant\n\t\t\tplayback, they set it to true. By default it's set to just\n\t\t\tload the metadata.\n\t\t*/\n config.audio.preload =\n userConfig.preload != undefined ? userConfig.preload : \"auto\";\n\n /*\n\t\t\tInitializes the user defined callbacks. This should be a JSON\n\t\t\tobject that contains a key->value store of the callback name\n\t\t\tand the name of the function the user needs to call.\n\t\t*/\n config.callbacks =\n userConfig.callbacks != undefined ? userConfig.callbacks : {};\n\n /*\n\t\t\tInitializes the user defined key bindings. This should be a JSON\n\t\t\tobject that contains a key->value store of the key event number\n\t\t\tpressed and the method to be run.\n\t\t*/\n config.bindings =\n userConfig.bindings != undefined ? userConfig.bindings : {};\n\n /*\n\t\t\tThe user can define a starting volume in a range of 0-100 with\n\t\t\t0 being muted and 100 being the loudest. After the config is set\n\t\t\tAmplitude sets the active song's volume to the volume defined\n\t\t\tby the user.\n\t\t*/\n config.volume = userConfig.volume != undefined ? userConfig.volume : 50;\n\n /*\n\t\t\tSets the delay between songs if the user has it set. This should be in MS.\n\t\t*/\n config.delay = userConfig.delay != undefined ? userConfig.delay : 0;\n\n /*\n\t\t\tThe user can set the volume increment and decrement values between 1 and 100\n\t\t\tfor when the volume up or down button is pressed. The default is an increase\n\t\t\tor decrease of 5.\n\t\t*/\n config.volume_increment =\n userConfig.volume_increment != undefined\n ? userConfig.volume_increment\n : 5;\n\n config.volume_decrement =\n userConfig.volume_decrement != undefined\n ? userConfig.volume_decrement\n : 5;\n\n /*\n\t\t\tSet the volume to what is defined in the config. The user can define this,\n\t\t\tso we should set it up that way.\n\t\t*/\n Core.setVolume(config.volume);\n\n /*\n Set default artwork, if specified\n */\n setArt(userConfig)\n\n /*\n Initialize the visual elements\n */\n initializeElements();\n\n /*\n\t\t\tIf the user has selected a starting playlist, we need to set the starting playlist\n\t\t\tand sync the visuals\n\t\t*/\n if (\n userConfig.starting_playlist != undefined &&\n userConfig.starting_playlist != \"\"\n ) {\n /*\n\t\t\t\tSet the active playlist to the starting playlist by the user\n\t\t\t*/\n config.active_playlist = userConfig.starting_playlist;\n\n /*\n\t\t\t\tCheck if the user defined a song to start with in the playlist.\n\t\t\t*/\n if (\n userConfig.starting_playlist_song != undefined &&\n userConfig.starting_playlist_song != \"\"\n ) {\n /*\n\t\t\t\t\tEnsure the song is a valid index.\n\t\t\t\t*/\n if (\n typeof userConfig.playlists[userConfig.starting_playlist].songs[\n parseInt(userConfig.starting_playlist_song)\n ] != undefined\n ) {\n /*\n\t\t\t\t\t\tSet the player to the song defined by the user.\n\t\t\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[\n parseInt(userConfig.starting_playlist_song)\n ],\n parseInt(userConfig.starting_playlist_song)\n );\n } else {\n /*\n\t\t\t\t\t\tSet the player to the first song in the playlist\n\t\t\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[0],\n 0\n );\n /*\n\t\t\t\t\t\tDebug that the song index doesn't exist\n\t\t\t\t\t*/\n Debug.writeMessage(\n \"The index of \" +\n userConfig.starting_playlist_song +\n \" does not exist in the playlist \" +\n userConfig.starting_playlist\n );\n }\n } else {\n /*\n\t\t\t\t\tSet the player to the first song in the playlist\n\t\t\t\t*/\n AudioNavigation.changeSong(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[0],\n 0\n );\n }\n\n /*\n\t\t\t\tSync the main and song play pause buttons.\n\t\t\t*/\n PlayPauseElements.sync();\n }\n\n /*\n\t\t\tRun after init callback\n\t\t*/\n Callbacks.run(\"initialized\");\n }\n\n /**\n * Sets the default_album_art and default_playlist_art from the\n * user supplied configuration.\n *\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function setArt(userConfig){\n /*\n If the user defines default album art, this image will display if the active\n song doesn't have album art defined.\n */\n if (userConfig.default_album_art != undefined) {\n config.default_album_art = userConfig.default_album_art;\n } else {\n config.default_album_art = \"\";\n }\n\n /*\n\t\t\tIf the user defines default playlist art, this image will display if the user\n\t\t\ttries to set up a playlist meta data image tag but doesn't have one defined.\n\t\t*/\n if (userConfig.default_playlist_art != undefined) {\n config.default_playlist_art = userConfig.default_playlist_art;\n } else {\n config.default_playlist_art = \"\";\n }\n }\n\n /**\n * Initializes all of the elements on the page to the default starting point\n * to build from there.\n *\n * @access private\n */\n function initializeElements() {\n /*\n\t\t\tVisually sync the shuffle statuses\n\t\t*/\n ShuffleElements.syncMain();\n\n /*\n\t\t\tSync Mute Elements.\n\t\t*/\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\tSync Volume Slider Elements\n\t\t*/\n VolumeSliderElements.sync();\n\n /*\n\t\t\tSyncs all of the playback speed elements.\n\t\t*/\n PlaybackSpeedElements.sync();\n\n /*\n\t\t\tSyncs all of the visual time elements to 00.\n\t\t*/\n TimeElements.resetCurrentTimes();\n\n /*\n\t\t\tSets all of the play pause buttons to pause.\n\t\t*/\n PlayPauseElements.syncToPause();\n\n /*\n\t\t\tSets the meta data for the songs automatically.\n\t\t*/\n MetaDataElements.syncMetaData();\n\n /*\n\t\t\tSets the repeat buttons automatically.\n\t\t*/\n RepeatElements.syncRepeatSong();\n }\n\n /**\n * Counts the number of playlists the user has configured. This ensures\n * that the user has at least 1 playlist so we can validate the songs\n * defined in the playlist are correct and they didn't enter an invalid\n * ID.\n *\n * @access private\n * @param {object} playlists \t-\n */\n function countPlaylists(playlists) {\n /*\n\t\t\tInitialize the placeholders to iterate through the playlists\n\t\t\tand find out how many we have to account for.\n\t\t*/\n let size = 0,\n key;\n\n /*\n\t\t\tIterate over playlists and if the user has the playlist defined,\n\t\t\tincrement the size of playlists.\n\t\t*/\n for (key in playlists) {\n if (playlists.hasOwnProperty(key)) {\n size++;\n }\n }\n\n /*\n\t\t\tDebug how many playlists are in the config.\n\t\t*/\n Debug.writeMessage(\"You have \" + size + \" playlist(s) in your config\");\n\n /*\n\t\t\tReturn the number of playlists in the config.\n\t\t*/\n return size;\n }\n\n /**\n * Intializes the default live settings for all of the songs.\n *\n * @access private\n */\n function initializeDefaultLiveSettings() {\n for (let i = 0; i < config.songs.length; i++) {\n if (config.songs[i].live == undefined) {\n config.songs[i].live = false;\n }\n }\n }\n\n /** \n * Initializes the index of the song in the songs array so\n * we can reference it if needed\n * \n * @access private\n */\n function initializeDefaultSongIndexes(){\n for (let i = 0; i < config.songs.length; i++) {\n config.songs[i].index = i;\n }\n }\n\n\n /*\n\t\tReturns the publicly accessible methods\n\t*/\n return {\n initialize: initialize,\n setConfig: setConfig,\n rebindDisplay: rebindDisplay\n };\n})();\n\nexport default Initializer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/init/init.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Builds a waveform for the current audio.\n * Help from: https://robots.thoughtbot.com/javascript-audio-api\n * https://stackoverflow.com/questions/21347833/html-svg-not-drawing-works-in-other-pages\n */\nlet WaveForm = (function() {\n /*\n Initialize the local variables used in the Waveform.\n */\n let buffer = \"\";\n let sampleRate = config.waveforms.sample_rate;\n let peaks = \"\";\n\n function init() {\n /*\n Grabs all of the waveform elements on the page.\n */\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n\n /*\n If there are waveforms, we iterate over them and set them up to display\n properly.\n */\n if (waveforms.length > 0) {\n /*\n Iterate over all of the waveforms and build the SVG parts.\n */\n for (let i = 0; i < waveforms.length; i++) {\n /*\n Clear the inner HTML of the element if we are replacing the waveform.\n */\n waveforms[i].innerHTML = \"\";\n\n /*\n Inserts an SVG into the element.\n */\n let svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"viewBox\", \"0 -1 \" + sampleRate + \" 2\");\n svg.setAttribute(\"preserveAspectRatio\", \"none\");\n\n /*\n Add a g component to the SVG\n */\n let g = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svg.appendChild(g);\n\n /*\n Add a path component to the g\n */\n let path = document.createElementNS(\n \"http://www.w3.org/2000/svg\",\n \"path\"\n );\n path.setAttribute(\"d\", \"\");\n path.setAttribute(\"id\", \"waveform\");\n\n g.appendChild(path);\n\n /*\n Append the SVG to the waveform.\n */\n waveforms[i].appendChild(svg);\n }\n }\n }\n\n /**\n * Builds each waveform for the page.\n */\n function build() {\n if (config.web_audio_api_available) {\n /*\n If we don't have the wave form built, we need to build the waveform by loading\n the src with an array buffer.\n */\n if (\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ] == undefined\n ) {\n /*\n Initializes a new XML Http Request.\n */\n var req = new XMLHttpRequest();\n\n /*\n Opens the src parameter for the audio file to read in.\n */\n req.open(\"GET\", config.audio.src, true);\n req.responseType = \"arraybuffer\";\n\n /*\n When the ready state changes, check to see if we can render the\n wave form.\n */\n req.onreadystatechange = function(e) {\n /*\n When the request is complete, then we begin decoding the\n audio to build the waveform.\n */\n if (req.readyState == 4) {\n /*\n If the status is 200 means the response is a success and\n we decode the audio data.\n */\n if (req.status == 200) {\n /*\n Decode the audio data and process the waveform.\n */\n config.context.decodeAudioData(req.response, function(\n bufferedAudio\n ) {\n /*\n Set the buffer to the audio returned.\n */\n buffer = bufferedAudio;\n\n /*\n Get the peaks in the audio.\n */\n peaks = getPeaks(sampleRate, buffer);\n\n /*\n Build the SVG\n */\n process(sampleRate, buffer, peaks);\n });\n }\n }\n };\n req.send();\n } else {\n /*\n If we already have a waveform, we grab the waveform that\n was created for the song and display it. We do a simple hash\n of the song URL so it's already unique.\n */\n displayWaveForms(\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ]\n );\n }\n }\n }\n\n /**\n * Processes the audio and generates the waveform.\n *\n * @param {sampleRate} sampleRate - The rate we should sample the audio.\n * @param {arraybuffer} buffer - The Web Audio API\n * @param {array} peaks - The peaks in the audio.\n */\n function process(sampleRate, buffer, peaks) {\n /*\n If we have a buffer, we find the peaks in the audio.\n */\n if (buffer) {\n /*\n Get the total peaks in the song.\n */\n let totalPeaks = peaks.length;\n\n /*\n Figure out the depth of the peak.\n */\n let d = \"\";\n for (let peakNumber = 0; peakNumber < totalPeaks; peakNumber++) {\n if (peakNumber % 2 === 0) {\n d += ` M${~~(peakNumber / 2)}, ${peaks.shift()}`;\n } else {\n d += ` L${~~(peakNumber / 2)}, ${peaks.shift()}`;\n }\n }\n\n /*\n Add the waveform to the built waveforms array.\n */\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ] = d;\n\n /*\n Display the waveform.\n */\n displayWaveForms(\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ]\n );\n }\n }\n\n /**\n * Get the peaks of the audio for the waveform.\n *\n * @param {number} length - The sample size of the audio.\n * @param {array} buffer - The array buffer used to find the peaks in the audio.\n */\n function getPeaks(length, buffer) {\n /*\n Set the parameters needed to build the SVG.\n */\n const sampleSize = buffer.length / length;\n const sampleStep = ~~(sampleSize / 10) || 1;\n const numberOfChannels = buffer.numberOfChannels;\n const mergedPeaks = [];\n\n /*\n Iterate over the channels and find the peaks.\n */\n for (\n let channelNumber = 0;\n channelNumber < numberOfChannels;\n channelNumber++\n ) {\n /*\n Initialize the peaks array and set the channel data to what\n the buffer has in its channel data.\n */\n const peaks = [];\n const channelData = buffer.getChannelData(channelNumber);\n\n /*\n Iterate over peaks with respect to the sample size.\n */\n for (let peakNumber = 0; peakNumber < length; peakNumber++) {\n /*\n Gt the start and end peak.\n */\n const start = ~~(peakNumber * sampleSize);\n const end = ~~(start + sampleSize);\n\n /*\n Set min and max to the channel data first peak.\n */\n let min = channelData[0];\n let max = channelData[0];\n\n /*\n Iterate over the parts of the song starting to the\n ending to display the waveform.\n */\n for (\n let sampleIndex = start;\n sampleIndex < end;\n sampleIndex += sampleStep\n ) {\n const value = channelData[sampleIndex];\n\n if (value > max) {\n max = value;\n }\n if (value < min) {\n min = value;\n }\n }\n\n /*\n Set the max and min for the peak.\n */\n peaks[2 * peakNumber] = max;\n peaks[2 * peakNumber + 1] = min;\n\n /*\n Merge the peaks\n */\n if (channelNumber === 0 || max > mergedPeaks[2 * peakNumber]) {\n mergedPeaks[2 * peakNumber] = max;\n }\n\n if (channelNumber === 0 || min < mergedPeaks[2 * peakNumber + 1]) {\n mergedPeaks[2 * peakNumber + 1] = min;\n }\n }\n }\n\n /*\n Returns the merged peaks.\n */\n return mergedPeaks;\n }\n\n /**\n * Displays all of the waveforms necessary.\n *\n * @param {path} svg - The drawing of the waveform.\n */\n function displayWaveForms(svg) {\n let waveformElements = document.querySelectorAll(\".amplitude-wave-form\");\n\n /*\n Iterate over all of the waveform elements and\n display the waveform.\n */\n for (let i = 0; i < waveformElements.length; i++) {\n /*\n Get the playlist attribute of the waveform element.\n */\n let playlist = waveformElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Get the song index attribute of the waveform element.\n */\n let song = waveformElements[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n If the playlist is null and the song is null it's a global element.\n */\n if (playlist == null && song == null) {\n displayGlobalWaveform(waveformElements[i], svg);\n }\n\n /*\n If the playlist is defined but the song is null it's a playlist element.\n */\n if (playlist != null && song == null) {\n displayPlaylistWaveform(waveformElements[i], svg, playlist);\n }\n\n /*\n If the playlist is not defined and the song is not null it's a song\n element.\n */\n if (playlist == null && song != null) {\n displaySongWaveform(waveformElements[i], svg, song);\n }\n\n /*\n If the playlist and song are defined it's a song in the playlist element.\n */\n if (playlist != null && song != null) {\n displaySongInPlaylistWaveform(waveformElements[i], svg, playlist, song);\n }\n }\n }\n\n /**\n * Displays a global wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n */\n function displayGlobalWaveform(element, svg) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n\n /**\n * Displays a playlist wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {string} playlist - The playlist we are displaying the waveform for.\n */\n function displayPlaylistWaveform(element, svg, playlist) {\n /*\n Ensure the playlist is the active playlist.\n */\n if (config.active_playlist == playlist) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Displays a song wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {Integer} song - The index of the song we are displaying the\n * waveform for.\n */\n function displaySongWaveform(element, svg, song) {\n /*\n Ensure it's the active song being displayed.\n */\n if (config.active_index == song) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Displays a song in playlist waveform.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {String} playlist - The playlist the waveform is in.\n * @param {Integer} song - The index of the song we are displaying the waveform for.\n */\n function displaySongInPlaylistWaveform(element, svg, playlist, song) {\n /*\n Ensure it's the active song in the active playlist.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[config.active_playlist].active_index == song\n ) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Determines if the user is using waveforms\n */\n function determineIfUsingWaveforms(){\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n\n if( waveforms.length > 0 ){\n return true;\n }else{\n return false;\n }\n }\n\n /*\n Return the public methods.\n */\n return {\n init: init,\n build: build,\n determineIfUsingWaveforms: determineIfUsingWaveforms\n };\n})();\n\nexport default WaveForm;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/waveform.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * The utility to handle the computation of time in AmplitudeJS.\n * @module utilities/Time\n */\nlet Time = (function() {\n /**\n * Computes the current song time. Breaks down where the song is into\n * hours, minutes, seconds and formats it to be displayed to the user.\n *\n * @access public\n */\n function computeCurrentTimes() {\n /*\n\t\t\tInitialize the current time object that will be returned.\n\t\t*/\n let currentTime = {};\n\n /*\n\t\t\tComputes the current seconds for the song.\n\t\t*/\n let currentSeconds =\n (Math.floor(config.audio.currentTime % 60) < 10 ? \"0\" : \"\") +\n Math.floor(config.audio.currentTime % 60);\n\n /*\n\t\t\tComputes the current minutes for the song.\n\t\t*/\n let currentMinutes = Math.floor(config.audio.currentTime / 60);\n\n /*\n\t\t\tInitialize the current hours variable.\n\t\t*/\n let currentHours = \"00\";\n\n /*\n\t\t\tIf the current minutes is less than 10, we add a leading 0.\n\t\t*/\n if (currentMinutes < 10) {\n currentMinutes = \"0\" + currentMinutes;\n }\n\n /*\n\t\t\tIf the user is more than 60 minutes into the song, then\n\t\t\twe extract the hours.\n\t\t*/\n if (currentMinutes >= 60) {\n currentHours = Math.floor(currentMinutes / 60);\n currentMinutes = currentMinutes % 60;\n\n /*\n\t\t\t\tIf the user is less than 10 minutes in, we append the\n\t\t\t\tadditional 0 to the minutes.\n\t\t\t*/\n if (currentMinutes < 10) {\n currentMinutes = \"0\" + currentMinutes;\n }\n }\n\n /*\n\t\t\tBuild a clean current time object and send back the appropriate information.\n\t\t*/\n currentTime.seconds = currentSeconds;\n currentTime.minutes = currentMinutes;\n currentTime.hours = currentHours;\n\n return currentTime;\n }\n\n /**\n * Computes the current song duration. Breaks down where the song is into\n * hours, minutes, seconds and formats it to be displayed to the user.\n *\n * @access public\n */\n function computeSongDuration() {\n /*\n\t\t\tInitialize the song duration object that will be returned.\n\t\t*/\n let songDuration = {};\n\n /*\n\t\t\tComputes the duration of the song's seconds.\n\t\t*/\n let songDurationSeconds =\n (Math.floor(config.audio.duration % 60) < 10 ? \"0\" : \"\") +\n Math.floor(config.audio.duration % 60);\n\n /*\n\t\t\tComputes the duration of the song's minutes.\n\t\t*/\n let songDurationMinutes = Math.floor(config.audio.duration / 60);\n\n /*\n\t\t\tInitialize the hours duration variable.\n\t\t*/\n var songDurationHours = \"00\";\n\n /*\n\t\t\tIf the song duration minutes is less than 10, we add a leading 0.\n\t\t*/\n if (songDurationMinutes < 10) {\n songDurationMinutes = \"0\" + songDurationMinutes;\n }\n\n /*\n\t\t\tIf there is more than 60 minutes in the song, then we\n\t\t\textract the hours.\n\t\t*/\n if (songDurationMinutes >= 60) {\n songDurationHours = Math.floor(songDurationMinutes / 60);\n songDurationMinutes = songDurationMinutes % 60;\n\n /*\n\t\t\t\tIf the song duration minutes is less than 10 we append\n\t\t\t\tthe additional 0.\n\t\t\t*/\n if (songDurationMinutes < 10) {\n songDurationMinutes = \"0\" + songDurationMinutes;\n }\n }\n\n /*\n\t\t\tBuild a clean song duration object and send back the appropriate information.\n\t\t*/\n songDuration.seconds = isNaN(songDurationSeconds)\n ? \"00\"\n : songDurationSeconds;\n songDuration.minutes = isNaN(songDurationMinutes)\n ? \"00\"\n : songDurationMinutes;\n songDuration.hours = isNaN(songDurationHours)\n ? \"00\"\n : songDurationHours.toString();\n\n return songDuration;\n }\n\n /**\n * Computes the song completion percentage.\n *\n * @access public\n */\n function computeSongCompletionPercentage() {\n return (config.audio.currentTime / config.audio.duration) * 100;\n }\n\n /**\n * Sets the current time for the audio.\n *\n * @access public\n */\n function setCurrentTime(time) {\n /*\n If the song is not live, we can set the current time.\n */\n if (!config.active_metadata.live) {\n /*\n Makes sure the number is finite to set the time.\n */\n if (isFinite(time)) {\n config.audio.currentTime = time;\n }\n }\n }\n\n /**\n * Defines what is returned by the module\n */\n return {\n computeCurrentTimes: computeCurrentTimes,\n computeSongDuration: computeSongDuration,\n computeSongCompletionPercentage: computeSongCompletionPercentage,\n setCurrentTime: setCurrentTime\n };\n})();\n\nexport default Time;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/time.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Visual Handler for Buffered Progress Elements\n *\n * @module visual/BufferedProgressElements\n */\nlet BufferedProgressElements = (function() {\n /**\n * Syncs the buffered progress bars to the current percentage in the config\n *\n * @access public\n */\n function sync() {\n syncGlobal();\n syncPlaylist();\n syncSong();\n syncSongInPlaylist();\n }\n\n /**\n * Sync the global song buffered progress elements.\n */\n function syncGlobal() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBars = document.getElementsByClassName(\n \"amplitude-buffered-progress\"\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBars.length; i++) {\n let playlist = songBufferedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = songBufferedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && song == null) {\n songBufferedProgressBars[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the playlist song buffered progress elements.\n */\n function syncPlaylist() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsPlaylist = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsPlaylist.length; i++) {\n let song = songBufferedProgressBarsPlaylist[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (song == null) {\n songBufferedProgressBarsPlaylist[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the song song buffered progress elements.\n */\n function syncSong() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsSongs = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsSongs.length; i++) {\n let playlist = songBufferedProgressBarsSongs[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n songBufferedProgressBarsSongs[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the song in playlist song buffered progress elements.\n */\n function syncSongInPlaylist() {\n let activePlaylistIndex =\n config.active_playlist != null && config.active_playlist != \"\"\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsSongsInPlaylist = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsSongsInPlaylist.length; i++) {\n songBufferedProgressBarsSongsInPlaylist[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n\n /**\n * Sets all of the song buffered progress bars to 0\n *\n * @access public\n */\n function reset() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n let songBufferedProgressBars = document.getElementsByClassName(\n \"amplitude-buffered-progress\"\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBars.length; i++) {\n songBufferedProgressBars[i].value = 0;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n reset: reset\n };\n})();\n\nexport default BufferedProgressElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/bufferedProgressElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the Callback Utility\n * @module utilities/callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * AmplitudeJS Ended Module. Handles the ended event on the audio.\n *\n * @module events/Ended\n */\nlet Ended = (function() {\n /**\n * When the song has ended, handles what to do next\n *\n * HANDLER FOR: ended\n *\n * @access public\n */\n function handle() {\n /*\n Sets the time out for song ended. This determines if\n we should go to the next song or delay between songs.\n */\n setTimeout(function() {\n /*\n If we continue next, we should move to the next song in the playlist.\n */\n if (config.continue_next) {\n /*\n\t\t\t\t\tIf the active playlist is not set, we set the\n\t\t\t\t\tnext song that's in the songs array.\n\t\t\t\t*/\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext(true);\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist, true);\n }\n } else {\n if (!config.is_touch_moving) {\n /*\n\t\t\t\t\t\tStops the active song.\n\t\t\t\t\t*/\n AmplitudeCore.stop();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n }, config.delay);\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Ended;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/ended.js","/*\n\tImport the necessary classes and config to use\n\twith the events.\n*/\nimport config from \"../config.js\";\n\n/**\n * Imports all of the handler objects used by the events.\n */\nimport KeyDown from \"./keydown.js\";\nimport TimeUpdate from \"./timeUpdate.js\";\nimport Ended from \"./ended.js\";\nimport Progress from \"./progress.js\";\nimport Play from \"./play.js\";\nimport Pause from \"./pause.js\";\nimport PlayPause from \"./playPause.js\";\nimport Stop from \"./stop.js\";\nimport Mute from \"./mute.js\";\nimport VolumeUp from \"./volumeUp.js\";\nimport VolumeDown from \"./volumeDown.js\";\nimport SongSlider from \"./songSlider.js\";\nimport VolumeSlider from \"./volumeSlider.js\";\nimport Next from \"./next.js\";\nimport Prev from \"./prev.js\";\nimport Repeat from \"./repeat.js\";\nimport RepeatSong from \"./repeatSong.js\";\nimport PlaybackSpeed from \"./playbackSpeed.js\";\nimport Shuffle from \"./shuffle.js\";\nimport SkipTo from \"./skipTo.js\";\nimport WaveForm from \"../fx/waveform.js\";\n\n/**\n * Imports the utility classes used by the evnets.\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Events Module. Handles all of the events we listen to in\n * AmplitudeJS.\n *\n * @module events/Events\n */\nvar Events = (function() {\n /**\n * Initializes the handlers for the events listened to by Amplitude\n *\n * @access public\n */\n function initialize() {\n /*\n\t\t\tWrite out debug message\n\t\t*/\n Debug.writeMessage(\"Beginning initialization of event handlers..\");\n\n /*\n\t\t\tSets flag that the screen is moving and not a tap\n\t\t*/\n document.addEventListener(\"touchmove\", function() {\n config.is_touch_moving = true;\n });\n\n /*\n\t\t\tOn touch end if it was a touch move event, set moving to\n\t\t\tfalse\n\t\t*/\n document.addEventListener(\"touchend\", function() {\n if (config.is_touch_moving) {\n config.is_touch_moving = false;\n }\n });\n\n /*\n\t\t\tOn time update for the audio element, update visual displays that\n\t\t\trepresent the time on either a visualized element or time display.\n\t\t*/\n bindTimeUpdate();\n\n /*\n\t\t\tBinds key down event handlers for matching key codes to functions.\n\t\t*/\n bindKeyDownEventHandlers();\n\n /*\n\t\t\tWhen the audio element has ended playing, we handle the song\n\t\t\tending. In a single song or multiple modular song instance,\n\t\t\tthis just synchronizes the visuals for time and song time\n\t\t\tvisualization, but for a playlist it determines whether\n\t\t\tit should play the next song or not.\n\t\t*/\n bindSongEnded();\n\n /*\n\t\t\tBinds progress event so we can see how much of the song is loaded.\n\t\t*/\n bindProgress();\n\n /*\n\t\t\tBinds 'amplitude-play' event handlers\n\t\t*/\n bindPlay();\n\n /*\n\t\t\tBinds 'amplitude-pause' event handlers.\n\t\t*/\n bindPause();\n\n /*\n\t\t\tBinds 'amplitude-play-pause' event handlers.\n\t\t*/\n bindPlayPause();\n\n /*\n\t\t\tBinds 'amplitude-stop' event handlers.\n\t\t*/\n bindStop();\n\n /*\n\t\t\tBinds 'amplitude-mute' event handlers.\n\t\t*/\n bindMute();\n\n /*\n\t\t\tBinds 'amplitude-volume-up' event handlers\n\t\t*/\n bindVolumeUp();\n\n /*\n\t\t\tBinds 'amplitude-volume-down' event handlers\n\t\t*/\n bindVolumeDown();\n\n /*\n\t\t\tBinds 'amplitude-song-slider' event handlers\n\t\t*/\n bindSongSlider();\n\n /*\n\t\t\tBinds 'amplitude-volume-slider' event handlers.\n\t\t*/\n bindVolumeSlider();\n\n /*\n\t\t\tBinds 'amplitude-next' event handlers.\n\t\t*/\n bindNext();\n\n /*\n\t\t\tBinds 'amplitude-prev' event handlers.\n\t\t*/\n bindPrev();\n\n /*\n\t\t\tBinds 'amplitude-shuffle' event handlers.\n\t\t*/\n bindShuffle();\n\n /*\n\t\t\tBinds 'amplitude-repeat' event handlers.\n\t\t*/\n bindRepeat();\n\n /*\n\t\t\tBinds 'amplitude-repeat-song' event handlers.\n\t\t*/\n bindRepeatSong();\n\n /*\n\t\t\tBinds 'amplitude-playback-speed' event handlers.\n\t\t*/\n bindPlaybackSpeed();\n\n /*\n\t\t\tBinds 'amplitude-skip-to' event handlers.\n\t\t*/\n bindSkipTo();\n\n /*\n\t\t\tBinds `canplaythrough` event to build the waveform.\n\t\t*/\n bindCanPlayThrough();\n }\n\n /**\n * On time update for the audio element, update visual displays that\n * represent the time on either a visualized element or time display.\n *\n * @access private\n */\n function bindTimeUpdate() {\n /*\n\t\t\tBind for time update\n\t\t*/\n config.audio.removeEventListener(\"timeupdate\", TimeUpdate.handle);\n config.audio.addEventListener(\"timeupdate\", TimeUpdate.handle);\n\n /*\n\t\t\tBind for duration change\n\t\t*/\n config.audio.removeEventListener(\"durationchange\", TimeUpdate.handle);\n config.audio.addEventListener(\"durationchange\", TimeUpdate.handle);\n }\n\n /**\n * On keydown, we listen to what key got pressed so we can map the key to\n * a function. This allows the user to map pause and play, next, etc. to key\n * presses.\n *\n * @access private\n */\n function bindKeyDownEventHandlers() {\n document.removeEventListener(\"keydown\", KeyDown.handle);\n document.addEventListener(\"keydown\", KeyDown.handle);\n }\n\n /**\n * When the audio element has ended playing, we handle the song\n * ending. In a single song or multiple modular song instance,\n * this just synchronizes the visuals for time and song time\n * visualization, but for a playlist it determines whether\n * it should play the next song or not.\n *\n * @access private\n */\n function bindSongEnded() {\n config.audio.removeEventListener(\"ended\", Ended.handle);\n config.audio.addEventListener(\"ended\", Ended.handle);\n }\n\n /**\n * As the audio is loaded, the progress event gets fired. We bind into this\n * to grab the buffered percentage of the song. We can then add more elements\n * to show the buffered amount.\n *\n * @access private\n */\n function bindProgress() {\n config.audio.removeEventListener(\"progress\", Progress.handle);\n config.audio.addEventListener(\"progress\", Progress.handle);\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS play buttons\n *\n * @access private\n */\n function bindPlay() {\n /*\n\t\t\tGets all of the elements with the class amplitude-play\n\t\t*/\n var play_classes = document.getElementsByClassName(\"amplitude-play\");\n\n /*\n\t\t\tIterates over all of the play classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < play_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n play_classes[i].removeEventListener(\"touchend\", Play.handle);\n play_classes[i].addEventListener(\"touchend\", Play.handle);\n } else {\n play_classes[i].removeEventListener(\"click\", Play.handle);\n play_classes[i].addEventListener(\"click\", Play.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS pause buttons.\n *\n * @access private\n */\n function bindPause() {\n /*\n\t\t\tGets all of the elements with the class amplitude-pause\n\t\t*/\n var pause_classes = document.getElementsByClassName(\"amplitude-pause\");\n\n /*\n\t\t\tIterates over all of the pause classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < pause_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n pause_classes[i].removeEventListener(\"touchend\", Pause.handle);\n pause_classes[i].addEventListener(\"touchend\", Pause.handle);\n } else {\n pause_classes[i].removeEventListener(\"click\", Pause.handle);\n pause_classes[i].addEventListener(\"click\", Pause.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS play pause buttons\n *\n * @access private\n */\n function bindPlayPause() {\n /*\n\t\t\tGets all of the elements with the class amplitude-play-pause\n\t\t*/\n var play_pause_classes = document.getElementsByClassName(\n \"amplitude-play-pause\"\n );\n\n /*\n\t\t\tIterates over all of the play/pause classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < play_pause_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n play_pause_classes[i].removeEventListener(\"touchend\", PlayPause.handle);\n play_pause_classes[i].addEventListener(\"touchend\", PlayPause.handle);\n } else {\n play_pause_classes[i].removeEventListener(\"click\", PlayPause.handle);\n play_pause_classes[i].addEventListener(\"click\", PlayPause.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS stop buttons\n *\n * @access private\n */\n function bindStop() {\n /*\n\t\t\tGets all of the elements with the class amplitude-stop\n\t\t*/\n var stop_classes = document.getElementsByClassName(\"amplitude-stop\");\n\n /*\n\t\t\tIterates over all of the stop classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < stop_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n stop_classes[i].removeEventListener(\"touchend\", Stop.handle);\n stop_classes[i].addEventListener(\"touchend\", Stop.handle);\n } else {\n stop_classes[i].removeEventListener(\"click\", Stop.handle);\n stop_classes[i].addEventListener(\"click\", Stop.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS mute buttons\n *\n * @access private\n */\n function bindMute() {\n /*\n\t\t\tGets all of the elements with the class amplitue-mute\n\t\t*/\n var mute_classes = document.getElementsByClassName(\"amplitude-mute\");\n\n /*\n\t\t\tIterates over all of the mute classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < mute_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n mute_classes[i].removeEventListener(\"touchend\", Mute.handle);\n mute_classes[i].addEventListener(\"touchend\", Mute.handle);\n }\n } else {\n mute_classes[i].removeEventListener(\"click\", Mute.handle);\n mute_classes[i].addEventListener(\"click\", Mute.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS Volume Up Buttons\n *\n * @access private\n */\n function bindVolumeUp() {\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-up\n\t\t*/\n var volume_up_classes = document.getElementsByClassName(\n \"amplitude-volume-up\"\n );\n\n /*\n\t\t\tIterates over all of the volume up classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < volume_up_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n volume_up_classes[i].removeEventListener(\"touchend\", VolumeUp.handle);\n volume_up_classes[i].addEventListener(\"touchend\", VolumeUp.handle);\n }\n } else {\n volume_up_classes[i].removeEventListener(\"click\", VolumeUp.handle);\n volume_up_classes[i].addEventListener(\"click\", VolumeUp.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS Volume Down Buttons\n *\n * @access private\n */\n function bindVolumeDown() {\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-down\n\t\t*/\n var volume_down_classes = document.getElementsByClassName(\n \"amplitude-volume-down\"\n );\n\n /*\n\t\t\tIterates over all of the volume down classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < volume_down_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n volume_down_classes[i].removeEventListener(\n \"touchend\",\n VolumeDown.handle\n );\n volume_down_classes[i].addEventListener(\n \"touchend\",\n VolumeDown.handle\n );\n }\n } else {\n volume_down_classes[i].removeEventListener(\"click\", VolumeDown.handle);\n volume_down_classes[i].addEventListener(\"click\", VolumeDown.handle);\n }\n }\n }\n\n /**\n * Binds change and input events for AmplitudeJS Song Slider Inputs\n *\n * @access private\n */\n function bindSongSlider() {\n /*\n\t\t\tGets browser so if we need to apply overrides, like we usually\n\t\t\thave to do for anything cool in IE, we can do that.\n\t\t*/\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n /*\n\t\t\tGets all of the elements with the class amplitude-song-slider\n\t\t*/\n var song_sliders = document.getElementsByClassName(\"amplitude-song-slider\");\n\n /*\n\t\t\tIterates over all of the song slider classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is IE we listen to the change event\n\t\t\twhere if it is anything else, it's the input method.\n\t\t*/\n for (var i = 0; i < song_sliders.length; i++) {\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n song_sliders[i].removeEventListener(\"change\", SongSlider.handle);\n song_sliders[i].addEventListener(\"change\", SongSlider.handle);\n } else {\n song_sliders[i].removeEventListener(\"input\", SongSlider.handle);\n song_sliders[i].addEventListener(\"input\", SongSlider.handle);\n }\n }\n }\n\n /**\n * Binds change and input events fro AmplitudeJS Volume Slider inputs\n *\n * @access private\n */\n function bindVolumeSlider() {\n /*\n\t\t\tGets browser so if we need to apply overrides, like we usually\n\t\t\thave to do for anything cool in IE, we can do that.\n\t\t*/\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-slider\n */\n var volume_sliders = document.getElementsByClassName(\n \"amplitude-volume-slider\"\n );\n\n /*\n\t\t\tIterates over all of the volume slider classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is IE we listen to the change event\n\t\t\twhere if it is anything else, it's the input method.\n\t\t*/\n for (var i = 0; i < volume_sliders.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n volume_sliders[i].removeEventListener(\"change\", VolumeSlider.handle);\n volume_sliders[i].addEventListener(\"change\", VolumeSlider.handle);\n } else {\n volume_sliders[i].removeEventListener(\"input\", VolumeSlider.handle);\n volume_sliders[i].addEventListener(\"input\", VolumeSlider.handle);\n }\n }\n }\n }\n\n /**\n * Binds click and touchend events fro AmplitudeJS Next buttons\n *\n * @access private\n */\n function bindNext() {\n /*\n\t\t\tGets all of the elements with the class amplitude-next\n */\n var next_classes = document.getElementsByClassName(\"amplitude-next\");\n\n /*\n\t\t\tIterates over all of the next classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < next_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n next_classes[i].removeEventListener(\"touchend\", Next.handle);\n next_classes[i].addEventListener(\"touchend\", Next.handle);\n } else {\n next_classes[i].removeEventListener(\"click\", Next.handle);\n next_classes[i].addEventListener(\"click\", Next.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS prev buttons.\n *\n * @access private\n */\n function bindPrev() {\n /*\n\t\t\tGets all of the elements with the class amplitude-prev\n\t\t*/\n var prev_classes = document.getElementsByClassName(\"amplitude-prev\");\n\n /*\n\t\t\tIterates over all of the prev classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < prev_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n prev_classes[i].removeEventListener(\"touchend\", Prev.handle);\n prev_classes[i].addEventListener(\"touchend\", Prev.handle);\n } else {\n prev_classes[i].removeEventListener(\"click\", Prev.handle);\n prev_classes[i].addEventListener(\"click\", Prev.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS shuffle buttons.\n *\n * @access private\n */\n function bindShuffle() {\n /*\n\t\t\tGets all of the elements with the class amplitude-shuffle\n\t\t*/\n var shuffle_classes = document.getElementsByClassName(\"amplitude-shuffle\");\n\n /*\n\t\t\tIterates over all of the shuffle classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < shuffle_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the shuffle control.\n\t\t\t*/\n shuffle_classes[i].classList.remove(\"amplitude-shuffle-on\");\n shuffle_classes[i].classList.add(\"amplitude-shuffle-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n shuffle_classes[i].removeEventListener(\"touchend\", Shuffle.handle);\n shuffle_classes[i].addEventListener(\"touchend\", Shuffle.handle);\n } else {\n shuffle_classes[i].removeEventListener(\"click\", Shuffle.handle);\n shuffle_classes[i].addEventListener(\"click\", Shuffle.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS repeat buttons.\n *\n * @access private\n */\n function bindRepeat() {\n /*\n\t\t\tGets all of the elements with the class amplitude-repeat\n\t\t*/\n var repeat_classes = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\tIterates over all of the repeat classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < repeat_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the repeat control.\n\t\t\t*/\n repeat_classes[i].classList.remove(\"amplitude-repeat-on\");\n repeat_classes[i].classList.add(\"amplitude-repeat-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n repeat_classes[i].removeEventListener(\"touchend\", Repeat.handle);\n repeat_classes[i].addEventListener(\"touchend\", Repeat.handle);\n } else {\n repeat_classes[i].removeEventListener(\"click\", Repeat.handle);\n repeat_classes[i].addEventListener(\"click\", Repeat.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS repeat song buttons.\n *\n * @access private\n */\n function bindRepeatSong() {\n /*\n\t\t\tGets all of the elements with the class amplitude-repeat-song\n\t\t*/\n var repeat_song_classes = document.getElementsByClassName(\n \"amplitude-repeat-song\"\n );\n\n /*\n\t\t\tIterates over all of the repeat song classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < repeat_song_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the repeat control.\n\t\t\t*/\n repeat_song_classes[i].classList.remove(\"amplitude-repeat-on\");\n repeat_song_classes[i].classList.add(\"amplitude-repeat-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n repeat_song_classes[i].removeEventListener(\n \"touchend\",\n RepeatSong.handle\n );\n repeat_song_classes[i].addEventListener(\"touchend\", RepeatSong.handle);\n } else {\n repeat_song_classes[i].removeEventListener(\"click\", RepeatSong.handle);\n repeat_song_classes[i].addEventListener(\"click\", RepeatSong.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS playback speed buttons\n *\n * @access private\n */\n function bindPlaybackSpeed() {\n /*\n\t\t\tGets all of the elements with the class amplitude-playback-speed\n\t\t*/\n var playback_speed_classes = document.getElementsByClassName(\n \"amplitude-playback-speed\"\n );\n\n /*\n\t\t\tIterates over all of the playback speed classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < playback_speed_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n playback_speed_classes[i].removeEventListener(\n \"touchend\",\n PlaybackSpeed.handle\n );\n playback_speed_classes[i].addEventListener(\n \"touchend\",\n PlaybackSpeed.handle\n );\n } else {\n playback_speed_classes[i].removeEventListener(\n \"click\",\n PlaybackSpeed.handle\n );\n playback_speed_classes[i].addEventListener(\n \"click\",\n PlaybackSpeed.handle\n );\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS skip to buttons.\n *\n * @access private\n */\n function bindSkipTo() {\n /*\n\t\t\tGets all of the skip to elements with the class 'amplitude-skip-to'\n\t\t*/\n var skipToClasses = document.getElementsByClassName(\"amplitude-skip-to\");\n\n /*\n\t\t\tIterates over all of the skip to classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it's a click.\n\t\t*/\n for (var i = 0; i < skipToClasses.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n skipToClasses[i].removeEventListener(\"touchend\", SkipTo.handle);\n skipToClasses[i].addEventListener(\"touchend\", SkipTo.handle);\n } else {\n skipToClasses[i].removeEventListener(\"click\", SkipTo.handle);\n skipToClasses[i].addEventListener(\"click\", SkipTo.handle);\n }\n }\n }\n\n /**\n * Binds can play through to a song.\n *\n * @access private\n */\n function bindCanPlayThrough() {\n if( WaveForm.determineIfUsingWaveforms() ){\n config.audio.removeEventListener(\"canplaythrough\", WaveForm.build);\n config.audio.addEventListener(\"canplaythrough\", WaveForm.build);\n }\n }\n\n /*\n\t\tReturns the public facing functions.\n\t*/\n return {\n initialize: initialize\n };\n})();\n\nexport default Events;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/events.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the core of AmplitudeJS\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Shuffle Utility\n * @module utilities/Shuffle\n */\nimport Shuffle from \"../utilities/shuffler.js\";\n\n/**\n * Imports the Repeater Utility\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the Repeat Elements Visual Handler\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * Imports the Play Pause Elements Visual Handler\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * AmplitudeJS Key Down event handler\n *\n * @module events/KeyDown\n */\nlet KeyDown = (function() {\n /**\n * When the keydown event is fired, we determine which function should be run\n * based on what was passed in.\n *\n * HANDLER FOR: keydown\n *\n * @access public\n * @prop {object} event The event object being passed in.\n */\n function handle(event) {\n runKeyEvent(event.which);\n }\n\n /**\n * Runs an event on key down\n *\n * @access public\n * @param {number} key \t- The key code the event is bound to.\n */\n function runKeyEvent(key) {\n /*\n\t\t\tChecks to see if the user bound an event to the code pressed.\n\t\t*/\n if (config.bindings[key] != undefined) {\n /*\n\t\t\t\tDetermine which event should be run if bound.\n\t\t\t*/\n switch (config.bindings[key]) {\n /*\n\t\t\t\t\tFires a play pause event.\n\t\t\t\t*/\n case \"play_pause\":\n runPlayPauseKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a next event.\n\t\t\t\t*/\n case \"next\":\n runNextKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a previous event.\n\t\t\t\t*/\n case \"prev\":\n runPrevKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a stop event.\n\t\t\t\t*/\n case \"stop\":\n runStopKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a shuffle event.\n\t\t\t\t*/\n case \"shuffle\":\n runShuffleKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a repeat event.\n\t\t\t\t*/\n case \"repeat\":\n runRepeatKeyDownEvent();\n break;\n }\n }\n }\n\n /**\n * Runs the play pause method for key down.\n */\n function runPlayPauseKeyDownEvent() {\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Runs the next method for key down.\n */\n function runNextKeyDownEvent() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Runs the previous method for key down.\n */\n function runPrevKeyDownEvent() {\n /*\n Check to see if the current playlist has been set\n or null and set the previous song.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Runs the stop method for key down.\n */\n function runStopKeyDownEvent() {\n /*\n Syncs all of the play pause elements to pause.\n */\n PlayPauseElements.syncToPause();\n\n /*\n Stops the active song.\n */\n Core.stop();\n }\n\n /**\n * Runs the shuffle method for key down.\n */\n function runShuffleKeyDownEvent() {\n /*\n Check to see if the current playlist has been set\n or null and set the previous song.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n Shuffle.toggleShuffle();\n } else {\n Shuffle.toggleShufflePlaylist(config.active_playlist);\n }\n }\n\n /**\n * Run the repeat method for key down.\n */\n function runRepeatKeyDownEvent() {\n /*\n Toggles the repeat\n */\n Repeater.setRepeat(!config.repeat);\n\n /*\n Visually sync repeat\n */\n RepeatElements.syncRepeat();\n }\n\n /**\n * Returns the public methods for the handler.\n */\n return {\n handle: handle\n };\n})();\n\nexport default KeyDown;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/keydown.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a mute event.\n * @module events/Mute\n */\nlet Mute = (function() {\n /**\n * Handles an event for a mute element\n *\n * HANDLER FOR: class=\"amplitude-mute\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tIf the current volume in the config is 0, we set the volume to the\n\t\t\t\tpre_mute level. This means that the audio is already muted and\n\t\t\t\tneeds to be restored to the pre_mute level.\n\n\t\t\t\tOtherwise, we set pre_mute volume to the current volume\n\t\t\t\tand set the config volume to 0, muting the audio.\n\t\t\t*/\n if (config.volume == 0) {\n Core.setVolume(config.pre_mute_volume);\n } else {\n config.pre_mute_volume = config.volume;\n Core.setVolume(0);\n }\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\t\tSyncs the volume sliders so the visuals align up with the functionality.\n\t\t\t\tIf the volume is at 0, then the sliders should represent that so the user\n\t\t\t\thas the right starting point.\n\t\t\t*/\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Mute;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/mute.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core module.\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Play Pause Elements Module.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Callbacks Module\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports the Amplitude Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Next Event Handler\n *\n * @module events/Next\n */\nlet Next = (function() {\n /**\n * Handles an event on the next button\n *\n * HANDLER FOR: class=\"amplitude-next\"\n *\n * GLOBAL: class=\"amplitude-next\"\n * PLAYLIST: class=\"amplitude-next\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global next.\n */\n if (playlist == null) {\n handleGlobalNext();\n }\n\n /*\n If the playlist is set, we handle the playlist next.\n */\n if (playlist != null) {\n handlePlaylistNext(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global enxt button.\n *\n * @access private\n */\n function handleGlobalNext() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode. If we are in playlist mode,\n we set next on the playlist.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Handles an event on a next playlist button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the next for.\n */\n function handlePlaylistNext(playlist) {\n /*\n Ensure the playlist is the same as the active playlist. To get to change\n the scope to a new playlist, you need to play that playlist.\n */\n if (playlist == config.active_playlist) {\n AudioNavigation.setNextPlaylist(playlist);\n } else {\n Debug.writeMessage(\n \"You can not go to the next song on a playlist that is not being played!\"\n );\n }\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Next;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/next.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the ConfigState module.\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the pause events\n * @module events/Pause\n */\nlet Pause = (function() {\n /**\n * Handles an event on a pause button\n *\n * HANDLER FOR: class=\"amplitude-pause\"\n *\n * GLOBAL: class=\"amplitude-pause\"\n * PLAYLIST: class=\"amplitude-pause\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-pause\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-pause\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Gets the attribute for song index so we can check if\n there is a need to change the song. In some scenarios\n there might be multiple pause classes on the page. In that\n case it is possible the user could click a different pause\n class.\n */\n let songIndexAttribute = this.getAttribute(\"data-amplitude-song-index\");\n let playlistAttribute = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n Handle a global pause button.\n */\n if (playlistAttribute == null && songIndexAttribute == null) {\n handleGlobalPause();\n }\n\n /*\n Handle a playlist pause button.\n */\n if (playlistAttribute != null && songIndexAttribute == null) {\n handlePlaylistPause(playlistAttribute);\n }\n\n /*\n Handle a song pause button.\n */\n if (playlistAttribute == null && songIndexAttribute != null) {\n handleSongPause(songIndexAttribute);\n }\n\n /*\n Handle a song in playlist pause button.\n */\n if (playlistAttribute != null && songIndexAttribute != null) {\n handleSongInPlaylistPause(playlistAttribute, songIndexAttribute);\n }\n\n ConfigState.setPlayerState();\n }\n }\n\n /**\n * Handles global pause button which pauses whatever song is\n * active.\n *\n * @access private\n */\n function handleGlobalPause() {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the playlist pause.\n *\n * @access private\n * @param {string} playlist The playlist the pause button belongs to.\n */\n function handlePlaylistPause(playlist) {\n /*\n Checks to see if the active playlist is the same\n */\n if (config.active_playlist == playlist) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /**\n * Handles the song pause.\n *\n * @access private\n * @param {integer} song The song the pause button belongs to.\n */\n function handleSongPause(song) {\n /*\n Checks to see if the active playlist is null and the song matches\n the active index.\n */\n if (\n (config.active_playlist == \"\" || config.active_playlist == null) &&\n config.active_index == song\n ) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /**\n * Handles the song in playlist pause.\n *\n * @access private\n * @param {string} playlist The playlist the pause button belongs to.\n * @param {integer} song The song the pause button belongs to.\n */\n function handleSongInPlaylistPause(playlist, song) {\n /*\n Checks to see if the active song matches the song and the\n active playlist matches the playlist. This means the pause button is\n for the song in the playlist.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[playlist].active_index == song\n ) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /*\n Returns the public facing elements\n */\n return {\n handle: handle\n };\n})();\n\nexport default Pause;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/pause.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the config state utility.\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the play events\n * @module events/Play\n */\nlet Play = (function() {\n /**\n * Handles an event on a play button in Amplitude.\n *\n * HANDLER FOR: class=\"amplitude-play\"\n *\n * GLOBAL: class=\"amplitude-play\"\n * PLAYLIST: class=\"amplitude-play\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-play\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-play\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Gets the attribute for song index so we can check if\n there is a need to change the song. In some scenarios\n there might be multiple play classes on the page. In that\n case it is possible the user could click a different play\n class and change the song.\n */\n let songIndexAttribute = this.getAttribute(\"data-amplitude-song-index\");\n let playlistAttribute = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n Handle a global play button.\n */\n if (playlistAttribute == null && songIndexAttribute == null) {\n handleGlobalPlay();\n }\n\n /*\n Handle a playlist play button.\n */\n if (playlistAttribute != null && songIndexAttribute == null) {\n handlePlaylistPlay(playlistAttribute);\n }\n\n /*\n Handle a song play button.\n */\n if (playlistAttribute == null && songIndexAttribute != null) {\n handleSongPlay(songIndexAttribute);\n }\n\n /*\n Handle a song in playlist play button.\n */\n if (playlistAttribute != null && songIndexAttribute != null) {\n handleSongInPlaylistPlay(playlistAttribute, songIndexAttribute);\n }\n\n ConfigState.setPlayerState();\n }\n }\n\n /**\n * Handles global play button which plays whatever song is\n * active.\n *\n * @access private\n */\n function handleGlobalPlay() {\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handle the playlist play.\n *\n * @access private\n * @param {string} playlist The playlist the play button belongs to.\n */\n function handlePlaylistPlay(playlist) {\n /*\n Checks if we have a new playlist.\n */\n if (Checks.newPlaylist(playlist)) {\n /*\n Sets the active playlist to what belongs to the playlist.\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n Play first song in the playlist since we just\n switched playlists, we start from the first song.\n\n If the user has shuffle on for the playlist, then\n we go from the first song in the shuffle playlist array.\n */\n if (config.playlists[playlist].shuffle) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].shuffle_list[0],\n 0\n );\n } else {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[0],\n 0\n );\n }\n }\n\n /*\n Plays the song.\n */\n Core.play();\n\n /*\n Syncs the play pause elements since they are dependent upon this state\n of the player.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the song play button.\n *\n * @access private\n * @param {integer} song The index of the song we are playing.\n */\n function handleSongPlay(song) {\n /*\n There can be multiple playlists on the page and there can be\n multiple songs on the page AND there can be songs in multiple\n playlists, so we have some checking to do.\n */\n\n /*\n Check to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n */\n if (Checks.newPlaylist(null)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(null);\n\n /*\n We then change the song to the index selected.\n */\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n Check to see if the song has changed. If it has,\n set the active song. If it was in a playlist, the\n song wouldn't change here, since we already set the\n song when we checked for a playlist.\n */\n if (Checks.newSong(null, song)) {\n /*\n The song selected is different, so we change the\n song.\n */\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Syncs the play pause elements since they are dependent upon this state\n of the player.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the song in playlist play.\n *\n * @access private\n * @param {string} playlist The playlist the play button belongs to.\n * @param {integer} song The song the play button belongs to.\n */\n function handleSongInPlaylistPlay(playlist, song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(playlist, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /*\n Returns the public facing elements\n */\n return {\n handle: handle\n };\n})();\n\nexport default Play;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/play.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Import the config state utility.\n * @module utilities/configState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the play pause events\n * @module events/PlayPause\n */\nlet PlayPause = (function() {\n /**\n * Handles an event on a play/pause button\n *\n * HANDLER FOR: class=\"amplitude-play-pause\"\n *\n * GLOBAL: class=\"amplitude-play-pause\"\n * PLAYLIST: class=\"amplitude-play-pause\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-play-pause\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-play-pause\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Get the playlist and song from the element. It's alright if these\n are null.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let song = this.getAttribute(\"data-amplitude-song-index\");\n\n /*\n Handle a global play pause button\n */\n if (playlist == null && song == null) {\n handleGlobalPlayPause();\n }\n\n /*\n Handle a playlist play pause button\n */\n if (playlist != null && song == null) {\n handlePlaylistPlayPause(playlist);\n }\n\n /*\n Handle a song play pause button\n */\n if (playlist == null && song != null) {\n handleSongPlayPause(song);\n }\n\n /*\n Handle a song in playlist play pause button\n */\n if (playlist != null && song != null) {\n handleSongInPlaylistPlayPause(playlist, song);\n }\n\n ConfigState.setPlayerState();\n }\n }\n\n /**\n * Sets the main play pause buttons to the current state of the song.\n * @access private\n */\n function handleGlobalPlayPause() {\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the playlist main play pause buttons to the current state of the song.\n * @access private\n * @param {string} playlist The playlist the main play pause button controls\n */\n function handlePlaylistPlayPause(playlist) {\n /*\n The only thing that can change when you click a playlist\n play pause is the playlist. Main play pauses have no change\n in song, song play pauses can change playlist and song.\n */\n if (Checks.newPlaylist(playlist)) {\n /*\n If there's a new playlist, then we set the new playlist.\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n Play first song in the playlist since we just\n switched playlists, we start from the first song.\n\n If the user has shuffle on for the playlist, then\n we go from the first song in the shuffle playlist array.\n */\n if (config.playlists[playlist].shuffle) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].shuffle_list[0],\n 0\n );\n } else {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[0],\n 0\n );\n }\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the playlist main play pause buttons to the current state of the song.\n * @access private\n * @param {string} song The index of the song being played/paused\n */\n function handleSongPlayPause(song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(null)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(null);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(null, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the song in playlist play pause buttons to the current\n * state of the song.\n * @access private\n * @param {string} playlist The playlist the song is a part of\n * @param {number} song The index of the song being played/paused\n */\n function handleSongInPlaylistPlayPause(playlist, song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(playlist, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default PlayPause;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/playPause.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Amplitude Core module\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Playback Speed Visual Elements\n * @module visual/PlaybackSpeedElements\n */\nimport PlaybackSpeedElements from \"../visual/playbackSpeedElements.js\";\n\n/**\n * AmplitudeJS Playback Speed Event Handler\n *\n * @module events/PlaybackSpeed\n */\nlet PlaybackSpeed = (function() {\n /**\n * Handles an event on the playback speed button\n *\n * HANDLER FOR: class=\"amplitude-playback-speed\"\n *\n * @access public\n */\n function handle() {\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tWe increment the speed by .5 everytime we click\n\t\t\t\tthe button to change the playback speed. Once we are\n\t\t\t\tactively playing back at 2, we start back at 1 which\n\t\t\t\tis normal speed.\n\t\t\t*/\n switch (config.playback_speed) {\n case 1:\n Core.setPlaybackSpeed(1.5);\n break;\n case 1.5:\n Core.setPlaybackSpeed(2);\n break;\n case 2:\n Core.setPlaybackSpeed(1);\n break;\n }\n\n /*\n\t\t\t\tVisually sync the playback speed.\n\t\t\t*/\n PlaybackSpeedElements.sync();\n }\n }\n\n /*\n Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default PlaybackSpeed;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/playbackSpeed.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Amplitude Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Prev Event Handler\n *\n * @module events/Prev\n */\nlet Prev = (function() {\n /**\n * Handles an event on the previous button\n *\n * HANDLER FOR: class=\"amplitude-prev\"\n *\n * GLOBAL: class=\"amplitude-prev\"\n * PLAYLIST: class=\"amplitude-prev\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global prev.\n */\n if (playlist == null) {\n handleGlobalPrev();\n }\n\n /*\n If the playlist is set, we handle the playlist prev.\n */\n if (playlist != null) {\n handlePlaylistPrev(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global previous button.\n *\n * @access private\n */\n function handleGlobalPrev() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode. If we are in playlist mode,\n we set prev on the playlist.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Handles an event on a previous playlist button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the previous for.\n */\n function handlePlaylistPrev(playlist) {\n /*\n Ensure the playlist is the same as the active playlist. To get to change\n the scope to a new playlist, you need to play that playlist.\n */\n if (playlist == config.active_playlist) {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n } else {\n Debug.writeMessage(\n \"You can not go to the previous song on a playlist that is not being played!\"\n );\n }\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Prev;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/prev.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the BufferedProgressElements visual handler\n * @module visual/bufferedProgressElements.js\n */\nimport BufferedProgressElements from \"../visual/bufferedProgressElements.js\";\n\n/**\n * AmplitudeJS Event Handler for progress\n *\n * @module events/Progress\n */\nlet Progress = (function() {\n /**\n * As the song is buffered, we can display the buffered percentage in\n * a progress bar.\n *\n * HANDLER FOR: progress\n *\n * @access public\n */\n function handle() {\n /*\n Help from: http://jsbin.com/badimipi/1/edit?html,js,output\n */\n if (config.audio.buffered.length - 1 >= 0) {\n let bufferedEnd = config.audio.buffered.end(\n config.audio.buffered.length - 1\n );\n let duration = config.audio.duration;\n\n /*\n Set the computed song buffered value to the config.\n */\n config.buffered = (bufferedEnd / duration) * 100;\n }\n\n /*\n Sync the buffered progress bars.\n */\n BufferedProgressElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Progress;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/progress.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the repeater utility module.\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the visual repeat elements module\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * AmplitudeJS Repeat Event Handler\n *\n * @module events/Repeat\n */\nlet Repeat = (function() {\n /**\n * Handles an event on the repeat button\n *\n * HANDLER FOR: class=\"amplitude-repeat\"\n *\n * GLOBAL: class=\"amplitude-repeat\"\n * PLAYLIST: class=\"amplitude-repeat\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global repeat.\n */\n if (playlist == null) {\n handleGlobalRepeat();\n }\n\n /*\n If the playlist is set, we handle the playlist repeat.\n */\n if (playlist != null) {\n handlePlaylistRepeat(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global repeat button.\n *\n * @access private\n */\n function handleGlobalRepeat() {\n /*\n Sets repeat to the opposite of what it was set to\n */\n Repeater.setRepeat(!config.repeat);\n\n /*\n Visually sync repeat\n */\n RepeatElements.syncRepeat();\n }\n\n /**\n * Handles an event on a playlist repeat button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the repeat store.\n */\n function handlePlaylistRepeat(playlist) {\n /*\n Sets repeat to the opposite of what it was set to for the playlist.\n */\n Repeater.setRepeatPlaylist(!config.playlists[playlist].repeat, playlist);\n\n /*\n Visually sync playlist repeat\n */\n RepeatElements.syncRepeatPlaylist(playlist);\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Repeat;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/repeat.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the repeat utility\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the AmplitudeJS Repeat Element\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * Handles an event on the Amplitude Repeat Song.\n *\n * @module events/RepeatSong\n */\nlet RepeatSong = (function() {\n /**\n * Handles an event on the repeat song button\n *\n * HANDLER FOR: 'amplitude-repeat-song'\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tSets repeat song to the opposite of what it was set to\n\t\t\t*/\n Repeater.setRepeatSong(!config.repeat_song);\n\n /*\n\t\t\t\tVisually sync repeat song\n\t\t\t*/\n RepeatElements.syncRepeatSong();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default RepeatSong;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/repeatSong.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the shuffler utility\n * @module utilities/Shuffler\n */\nimport Shuffler from \"../utilities/shuffler.js\";\n\n/**\n * Imports the visual shuffle elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"../visual/shuffleElements.js\";\n\n/**\n * Handles all of the shuffle events\n * @module events/Shuffle\n */\nlet Shuffle = (function() {\n /**\n * Handles an event on the shuffle button\n *\n * HANDLER FOR: class=\"amplitude-shuffle\"\n *\n * GLOBAL: class=\"amplitude-shuffle\"\n * PLAYLIST: class=\"amplitude-shuffle\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Get the playlist attribute\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n\t\t\t\tCheck to see if the shuffle button belongs to a playlist\n\t\t\t*/\n if (playlist == null) {\n handleGlobalShuffle();\n } else {\n handlePlaylistShuffle(playlist);\n }\n }\n }\n\n /**\n * Handles the event on the global shuffle button.\n */\n function handleGlobalShuffle() {\n /*\n Either shuffles or removes shuffle on the global state.\n */\n Shuffler.toggleShuffle();\n\n /*\n Visualize the shuffle state change.\n */\n ShuffleElements.syncMain(config.shuffle_on);\n }\n\n /**\n * Handles the event on the playlist shuffle button.\n *\n * @param {string} playlist - The playlist string the shuffle button belongs to.\n */\n function handlePlaylistShuffle(playlist) {\n /*\n Either shuffles or removes shuffle on the playlist state.\n */\n Shuffler.toggleShufflePlaylist(playlist);\n\n /*\n Visually sync the playlist shuffle statuses.\n */\n ShuffleElements.syncPlaylist(playlist);\n }\n\n /**\n * Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Shuffle;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/shuffle.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports AmplitudeJS Debug Utility\n * @module utilities/debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS play pause elements.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles the skip to event.\n *\n * @module events/SkipTo\n */\nlet SkipTo = (function() {\n /**\n * Handles an event on a skip to button.\n *\n * HANDLER FOR: class=\"amplitude-skip-to\"\n *\n * GLOBAL: class=\"amplitude-skip-to\" amplitude-song-index=\"song_index\" amplitude-location=\"seconds\"\n * PLAYLIST: class=\"amplitude-skip-to\" amplitude-playlist=\"playlist_key\" amplitude-song-index=\"song_index\" amplitude-location=\"seconds\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Extracts the needed attributes from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let songIndex = this.getAttribute(\"data-amplitude-song-index\");\n let location = this.getAttribute(\"data-amplitude-location\");\n\n /*\n If the location is null, write a message. We can't skip to a location\n that is null\n */\n if (location == null) {\n Debug.writeMessage(\n \"You must add an 'data-amplitude-location' attribute in seconds to your 'amplitude-skip-to' element.\"\n );\n }\n\n /*\n If the song index is null, write a debug message. We can't skip to a location\n of a null song.\n */\n if (songIndex == null) {\n Debug.writeMessage(\n \"You must add an 'data-amplitude-song-index' attribute to your 'amplitude-skip-to' element.\"\n );\n }\n\n /*\n If the location and song index are set, continue.\n */\n if (location != null && songIndex != null) {\n /*\n \t\t\t\tDetermines if the skip to button is in the scope of a playlist.\n \t\t\t*/\n if (playlist == null) {\n handleSkipToSong(parseInt(songIndex), parseInt(location));\n } else {\n handleSkipToPlaylist(\n playlist,\n parseInt(songIndex),\n parseInt(location)\n );\n }\n }\n }\n }\n\n /**\n * Handles the skipping to a specific song\n *\n * @access private\n * @param {string} songIndex - The index of the song being skipped to\n * @param {number} location - The seconds location of the song in the playlist.\n */\n function handleSkipToSong(songIndex, location) {\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSong(config.songs[songIndex], songIndex);\n Core.play();\n\n /*\n Syncs all of the play pause buttons now that we've skipped.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(location);\n }\n\n /**\n * Handles the skipping to a song that's in a playlist.\n *\n * @access private\n * @param {string} playlist - The playlist being skipped to\n * @param {string} songIndex - The index of the song in the playlist\n * @param {number} location - The seconds location of the song in the playlist.\n */\n function handleSkipToPlaylist(playlist, songIndex, location) {\n /*\n Checks if we are skipping to a new playlist\n */\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n }\n\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[songIndex],\n songIndex\n );\n Core.play();\n\n /*\n Sync all of the play pause elements.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncPlaylist();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(location);\n }\n\n /**\n * Return public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default SkipTo;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/skipTo.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the time utility\n * @module utilities/Time\n */\nimport Time from \"../utilities/time.js\";\n\n/**\n * Imports the song slider elements.\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Handles the song slider to event.\n *\n * @module events/SongSlider\n */\nlet SongSlider = (function() {\n /**\n * Handles a song slider element.\n *\n * HANDLER FOR: class=\"amplitude-song-slider\"\n *\n * GLOBAL: class=\"amplitude-song-slider\"\n * PLAYLIST: class=\"amplitude-song-slider\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-song-slider\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-song-slider\" amplitude-playlist=\"playlist_key\" amplitude-song-index=\"song_index\"\n *\n * @access public\n */\n function handle() {\n /*\n\t\t\tGets the percentage of the song we will be setting the location for.\n\t\t*/\n let locationPercentage = this.value;\n\n /*\n Computes the time in seconds for the current song.\n */\n let computedTime = config.audio.duration * (locationPercentage / 100);\n\n /*\n Gets the attributes for playlist and index for the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let song = this.getAttribute(\"data-amplitude-song-index\");\n\n /*\n If no playlist or song is defined, then it's a global song slider.\n */\n if (playlist == null && song == null) {\n handleGlobalSongSlider(computedTime, locationPercentage);\n }\n\n /*\n If a playlist but no song is defined, then it's playlist slider.\n */\n if (playlist != null && song == null) {\n handlePlaylistSongSlider(computedTime, locationPercentage, playlist);\n }\n\n /*\n If no playlist but a song is defined, then it's a song slider.\n */\n if (playlist == null && song != null) {\n handleSongSongSlider(computedTime, locationPercentage, song);\n }\n\n /*\n If playlist and song are defined then it's a song in a playlist\n slider.\n */\n if (playlist != null && song != null) {\n handleSongInPlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist,\n song\n );\n }\n }\n\n /**\n * Handles a change on a global audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n */\n function handleGlobalSongSlider(computedTime, locationPercentage) {\n /*\n\t\t\tIf the active song is not live, set the current time and adjust the slider.\n\t\t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n config.active_playlist,\n config.active_index\n );\n }\n }\n\n /**\n * Handles a change on a playlist audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {string} playlist = The playlist the song slider belongs to.\n */\n function handlePlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist\n ) {\n /*\n\t\t\tWe don't want to song slide a playlist that's not the\n\t\t\tactive placylist.\n\t\t*/\n if (config.active_playlist == playlist) {\n /*\n \t\t\tIf the active song is not live, set the current time\n \t\t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n playlist,\n config.active_index\n );\n }\n }\n }\n\n /**\n * Handles a change on a song audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {integer} songIndex = The song being navigated.\n */\n function handleSongSongSlider(computedTime, locationPercentage, songIndex) {\n /*\n We only want to move the slider if the active song is the\n same as the song being selected.\n */\n if (config.active_index == songIndex && config.active_playlist == null) {\n /*\n \t\tIf the active song is not live, set the current time\n \t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n config.active_playlist,\n songIndex\n );\n }\n }\n }\n\n /**\n * Handles a change on a song audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {integer} playlist = The playlist the song belongs to.\n * @param {integer} songIndex = The song being navigated.\n */\n function handleSongInPlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist,\n songIndex\n ) {\n /*\n We only want to move the slider if the active song is the\n same as the song being selected and the active playlist is the same\n as the playlist selected.\n */\n if (\n config.playlists[playlist].active_index == songIndex &&\n config.active_playlist == playlist\n ) {\n /*\n \t\tIf the active song is not live, set the current time\n \t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(locationPercentage, playlist, songIndex);\n }\n }\n }\n\n /*\n Return public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default SongSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/songSlider.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the config state module.\n * @module utilities/configState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Handles all of the stop events\n * @module events/Stop\n */\nlet Stop = (function() {\n /**\n * Handles an event on a stop element.\n *\n * HANDLER FOR: class=\"amplitude-stop\"\n *\n * @access public\n */\n function handle() {\n /*\n If touch is not moving, we run. We don't want to accidentally press\n stop if touch is moving.\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tSets all of the play/pause buttons to pause\n\t\t\t*/\n PlayPauseElements.syncToPause();\n\n /*\n\t\t\t\tStops the active song.\n\t\t\t*/\n Core.stop();\n\n /*\n Set the state of the player.\n */\n ConfigState.setPlayerState();\n }\n }\n\n /**\n * Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Stop;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/stop.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Buffered Progress Elements visual class\n * @module visual/bufferedProgressElements\n */\nimport BufferedProgressElements from \"../visual/bufferedProgressElements.js\";\n\n/**\n * Imports the Time Elements visual class.\n * @module visual/timeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Imports the Song Slider Elements visual class.\n * @module visual/songSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Imports the Song Played Progress Elements visual class.\n * @module visual/songPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"../visual/songPlayedProgressElements.js\";\n\n/**\n * Imports the Time utility class\n * @module utilities/Time\n */\nimport Time from \"../utilities/time.js\";\n\n/**\n * Imports the Callback utility class\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * AmplitudeJS Event Handler for Time Update\n *\n * @module events/TimeUpdate\n */\nlet TimeUpdate = (function() {\n /**\n * When the time updates on the active song, we sync the current time displays\n *\n * HANDLER FOR: timeupdate\n *\n * @access public\n */\n function handle() {\n /*\n Computes the buffered time.\n */\n computeBufferedTime();\n\n /*\n Sync the buffered progress elements.\n */\n BufferedProgressElements.sync();\n\n /*\n Updates the current time information.\n */\n updateTimeInformation();\n\n /*\n Run time callbacks\n */\n runTimeCallbacks();\n }\n\n /**\n * Computes the buffered time\n */\n function computeBufferedTime() {\n /*\n Help from: http://jsbin.com/badimipi/1/edit?html,js,output\n */\n if (config.audio.buffered.length - 1 >= 0) {\n let bufferedEnd = config.audio.buffered.end(\n config.audio.buffered.length - 1\n );\n let duration = config.audio.duration;\n\n config.buffered = (bufferedEnd / duration) * 100;\n }\n }\n\n /**\n * Updates the current time information.\n * @access private\n */\n function updateTimeInformation() {\n /*\n If the current song is not live, then\n we can update the time information. Otherwise the\n current time updates wouldn't mean much since the time\n is infinite.\n */\n if (!config.active_metadata.live) {\n /*\n Compute the current time\n */\n let currentTime = Time.computeCurrentTimes();\n\n /*\n Compute the song completion percentage\n */\n let songCompletionPercentage = Time.computeSongCompletionPercentage();\n\n /*\n Computes the song duration\n */\n let songDuration = Time.computeSongDuration();\n\n /*\n Sync the current time elements with the current\n location of the song and the song duration elements with\n the duration of the song.\n */\n TimeElements.syncCurrentTimes(currentTime);\n\n /*\n Sync the song slider elements.\n */\n SongSliderElements.sync(\n songCompletionPercentage,\n config.active_playlist,\n config.active_index\n );\n\n /*\n Sync the song played progress elements.\n */\n SongPlayedProgressElements.sync(songCompletionPercentage);\n\n /*\n Sync the duration time elements.\n */\n TimeElements.syncDurationTimes(currentTime, songDuration);\n }\n }\n\n /**\n * Runs a callback at a certain time in the song.\n */\n function runTimeCallbacks() {\n /*\n Gets the current seconds into the song.\n */\n let currentSeconds = Math.floor(config.audio.currentTime);\n\n /*\n Checks to see if there is a callback at the certain seconds into the song.\n */\n if (\n config.active_metadata.time_callbacks != undefined &&\n config.active_metadata.time_callbacks[currentSeconds] != undefined\n ) {\n /*\n Checks to see if the callback has been run. Since the time updates more than\n one second, we don't want the callback to run X times.\n */\n if (!config.active_metadata.time_callbacks[currentSeconds].run) {\n config.active_metadata.time_callbacks[currentSeconds].run = true;\n config.active_metadata.time_callbacks[currentSeconds]();\n }\n } else {\n /*\n Iterate over all of the callbacks for a song. If the song has one, we flag\n the run as false. This occurs because we have passed the active second for\n the callback, so we flag it as not run. It will either run again if the user\n seeks back or not run in the future.\n */\n for (var seconds in config.active_metadata.time_callbacks) {\n if (config.active_metadata.time_callbacks.hasOwnProperty(seconds)) {\n config.active_metadata.time_callbacks[seconds].run = false;\n }\n }\n }\n }\n /**\n * Returns public functions\n */\n return {\n handle: handle\n };\n})();\n\nexport default TimeUpdate;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/timeUpdate.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume down event.\n * @module events/VolumeDown\n */\nlet VolumeDown = (function() {\n /**\n * Handles a click on a volume down element.\n *\n * HANDLER FOR: class=\"amplitude-volume-down\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tThe volume range is from 0 to 1 for an audio element. We make this\n\t\t\t\ta base of 100 for ease of working with.\n\n\t\t\t\tIf the new value is less than 100, we use the new calculated\n\t\t\t\tvalue which gets converted to the proper unit for the audio element.\n\n\t\t\t\tIf the new value is greater than 100, we set the volume to 1 which\n\t\t\t\tis the max for the audio element.\n\t\t\t*/\n let volume = null;\n\n if (config.volume - config.volume_increment > 0) {\n volume = config.volume - config.volume_increment;\n } else {\n volume = 0;\n }\n\n /*\n\t\t\t\tCalls the core function to set the volume to the computed value\n\t\t\t\tbased on the user's intent.\n\t\t\t*/\n Core.setVolume(volume);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n Sync Volume Slider Elements\n */\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeDown;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeDown.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume up event.\n * @module events/VolumeSlider\n */\nlet VolumeSlider = (function() {\n /**\n * Handles a change on the volume slider\n *\n * HANDLER FOR: class=\"amplitude-volume-slider\"\n *\n * @access public\n */\n function handle() {\n /*\n\t\t\tCalls the core function to set the volume to the computed value\n\t\t\tbased on the user's intent.\n\t\t*/\n Core.setVolume(this.value);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\tSync the volume slider locations\n\t\t*/\n VolumeSliderElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeSlider.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume up event.\n * @module events/VolumeUp\n */\nlet VolumeUp = (function() {\n /**\n * Handles a click on a volume up element.\n *\n * HANDLER FOR: class=\"amplitude-volume-up\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tThe volume range is from 0 to 1 for an audio element. We make this\n\t\t\t\ta base of 100 for ease of working with.\n\n\t\t\t\tIf the new value is less than 100, we use the new calculated\n\t\t\t\tvalue which gets converted to the proper unit for the audio element.\n\n\t\t\t\tIf the new value is greater than 100, we set the volume to 1 which\n\t\t\t\tis the max for the audio element.\n\t\t\t*/\n let volume = null;\n\n if (config.volume + config.volume_increment <= 100) {\n volume = config.volume + config.volume_increment;\n } else {\n volume = 100;\n }\n\n /*\n\t\t\t\tCalls the core function to set the volume to the computed value\n\t\t\t\tbased on the user's intent.\n\t\t\t*/\n Core.setVolume(volume);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n Sync Volume Slider Elements\n */\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeUp;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeUp.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS FX Module. Helps with configuring and setting up visualizations\n * and any other features of the Web Audio API that Amplitude takes advantage\n * of.\n *\n * @module fx/FX\n */\nlet Fx = (function() {\n /**\n * Configures the Web Audio API to work with AmplitudeJS\n */\n function configureWebAudioAPI() {\n /*\n\t\t\tGets the context for the browser. If this is null, the Web Audio\n\t\t\tAPI is unavailable.\n\t\t*/\n let browserContext =\n window.AudioContext ||\n window.webkitAudioContext ||\n window.mozAudioContext ||\n window.oAudioContext ||\n window.msAudioContext;\n\n /*\n\t\t\tIf we have a context, the Web Audio API is available and we can continue,\n\t\t\totherwise, we alert the user if they have debug turned on.\n\t\t*/\n if (browserContext) {\n /*\n\t\t\t\tWeb Audio API is available, set the context in our config.\n\t\t\t*/\n config.context = new browserContext();\n \n /*\n\t\t\t\tCreate an analyzer that we will use in the context.\n\t\t\t*/\n config.analyser = config.context.createAnalyser();\n\n /*\n\t\t\t\tSet cross origin to anonymous so we have a better chance of being able\n\t\t\t\tto use the power of the Web Audio API.\n\t\t\t*/\n config.audio.crossOrigin = \"anonymous\";\n \n /*\n\t\t\t\tBind the source to the Javascript Audio Element.\n\t\t\t*/\n config.source = config.context.createMediaElementSource(config.audio);\n\n /*\n\t\t\t\tConnect the analyser to the source\n\t\t\t*/\n config.source.connect(config.analyser);\n\n /*\n\t\t\t\tConnect the context destination to the analyser.\n\t\t\t*/\n config.analyser.connect(config.context.destination);\n } else {\n AmplitudeHelpers.writeDebugMessage(\n \"Web Audio API is unavailable! We will set any of your visualizations with your back up definition!\"\n );\n }\n }\n\n /**\n * Determines if the web audio API is available or not.\n */\n function webAudioAPIAvailable() {\n /*\n\t\t\tGets the context for the browser. If this is null, the Web Audio\n\t\t\tAPI is unavailable.\n\t\t*/\n let browserContext =\n window.AudioContext ||\n window.webkitAudioContext ||\n window.mozAudioContext ||\n window.oAudioContext ||\n window.msAudioContext;\n config.web_audio_api_available = false;\n\n /*\n\t\t\tDetermines if the Web Audio API is available or not.\n\t\t*/\n if (browserContext) {\n /*\n\t\t\t\tSet the flag in the config that the Web Audio API is available\n\t\t\t*/\n config.web_audio_api_available = true;\n return true;\n } else {\n /*\n\t\t\t\tSet the flag in the config that the Web Audio API is not available\n\t\t\t*/\n config.web_audio_api_available = false;\n return false;\n }\n }\n\n /**\n * Determines if the user is using any of the web audio API features.\n */\n function determineUsingAnyFX(){\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n if( waveforms.length > 0 || visualizationElements.length > 0 ){\n return true;\n }else{\n return false;\n }\n }\n\n /*\n\t\tReturns the publicly accessible methods\n\t*/\n return {\n configureWebAudioAPI: configureWebAudioAPI,\n webAudioAPIAvailable: webAudioAPIAvailable,\n determineUsingAnyFX: determineUsingAnyFX\n };\n})();\n\nexport default Fx;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/fx.js","/**\n * @name \t\tAmplitude.js\n * @author \tDan Pastori (521 Dimensions) \n */\n/**\n * AmplitudeJS Initializer Module\n *\n * @module init/AmplitudeInitializer\n */\nimport Initializer from \"./init/init.js\";\n\n/****************************************************\n * Config\n ****************************************************/\n/**\n * Imports the config module\n * @module config\n */\nimport config from \"./config.js\";\n\n/****************************************************\n * Core\n ****************************************************/\n/**\n * AmplitudeJS Core Module\n *\n * @module core/Core\n */\nimport Core from \"./core/core.js\";\n\n/****************************************************\n * Utilities\n ****************************************************/\n/**\n * Shuffler Module\n * @module utilities/Shuffler\n */\nimport Shuffler from \"./utilities/shuffler.js\";\n\n/**\n * Imports the config state module.\n * @module ConfigState\n */\nimport ConfigState from \"./utilities/configState.js\";\n\n/**\n * Imports the audio navigation\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"./utilities/audioNavigation.js\";\n\n/**\n * Repeater Module\n *\n * @module utilities/Repeater\n */\nimport Repeater from \"./utilities/repeater.js\";\n\n/**\n * Imports the checks\n * @module utilities/Checks\n */\nimport Checks from \"./utilities/checks.js\";\n\n/****************************************************\n * FX Modules\n ****************************************************/\n/**\n * Imports the visualizations module\n * @module fx/Visualizations\n */\nimport Visualizations from \"./fx/visualizations.js\";\n\n/****************************************************\n * Elements\n ****************************************************/\n/**\n * Visual Shuffle Elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"./visual/shuffleElements.js\";\n\n/**\n * Visual Repeat Elements\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"./visual/repeatElements.js\";\n\n/**\n * Song Slider Elements\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"./visual/songSliderElements.js\";\n\n/**\n * Song Played Progress Elements\n * @module visual/SongPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"./visual/songPlayedProgressElements.js\";\n\n/**\n * Time Elements\n * @module visual/TimeElements\n */\nimport TimeElements from \"./visual/timeElements.js\";\n\n/**\n * Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"./visual/playPauseElements.js\";\n\n/**\n * Meta Data Elements\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"./visual/metaDataElements.js\";\n\n/** \n * Playback Speed Elements\n * @module visual/PlaybackSpeedElements\n */\nimport PlaybackSpeedElements from \"./visual/playbackSpeedElements.js\";\n\nimport Debug from \"./utilities/debug.js\";\n\nimport SoundCloud from \"./soundcloud/soundcloud.js\";\n\n/**\n * Amplitude should just be an interface to the public functions.\n * Everything else should be handled by other objects\n *\n * @module Amplitude\n */\nlet Amplitude = (function() {\n /**\n * The main init function. The user will call this through\n * Amplitude.init({}) and pass in their settings.\n *\n * Public Accessor: Amplitude.init( user_config_json );\n *\n * @access public\n * @param {object} userConfig \t- A JSON object of user defined values that helps configure and initialize AmplitudeJS.\n */\n function init(userConfig) {\n Initializer.initialize(userConfig);\n }\n\n /**\n * Returns the current config for AmplitudeJS\n */\n function getConfig() {\n return config;\n }\n\n /**\n * Binds new elements that were added to the page.\n *\n * Public Accessor: Amplitude.bindNewElements()\n *\n * @access public\n */\n function bindNewElements() {\n Initializer.rebindDisplay();\n }\n\n /**\n * Returns the active playlist.\n *\n * Public Accessor: Amplitude.getActivePlaylist()\n *\n * @access public\n */\n function getActivePlaylist() {\n return config.active_playlist;\n }\n\n /**\n * Returns the current playback speed.\n *\n * Public Accessor: Amplitude.getPlaybackSpeed()\n *\n * @access public\n */\n function getPlaybackSpeed() {\n return config.playback_speed;\n }\n\n /**\n * Sets the playback speed\n * \n * Public Accessor: Amplitude.setPlaybackSpeed( speed )\n * \n * @access public\n */\n function setPlaybackSpeed( speed ) {\n /*\n Increments are set in .5 We only accept values\n 1, 1.5, 2\n\n 1 -> Regular Speed\n 1.5 -> 50% faster\n 2 -> Twice as fast\n */\n Core.setPlaybackSpeed( speed );\n\n /*\n Visually sync the playback speed.\n */\n PlaybackSpeedElements.sync();\n }\n\n /**\n * Gets the repeat state of the player.\n *\n * Public Accessor: Amplitude.getRepeat()\n *\n * @access public\n */\n function getRepeat() {\n return config.repeat;\n }\n\n /**\n * Gets the repeat state for a playlist\n *\n * Public Accessor: Amplitude.getRepeatPlaylist()\n *\n * @access public\n */\n function getRepeatPlaylist(playlistKey) {\n return config.playlists[playlistKey].repeat;\n }\n\n /**\n * Returns the shuffle state of the player.\n *\n * Public Accessor: Amplitude.getShuffle()\n *\n * @access public\n */\n function getShuffle() {\n return config.shuffle_on;\n }\n\n /**\n * Returns the shuffle state of the playlist.\n *\n * Public Accessor: Amplitude.getShufflePlaylist( playlist )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to see if it's shuffled or not.\n */\n function getShufflePlaylist(playlist) {\n return config.playlists[playlist].shuffle;\n }\n\n /**\n * Sets the shuffle state for the player.\n *\n * Public Accessor: Amplitude.setShuffle()\n *\n * @param {boolean} shuffle \t- True when we are shuffling the songs, false when we turn off shuffle.\n *\n * @access public\n */\n function setShuffle(shuffle) {\n Shuffler.setShuffle(shuffle);\n\n ShuffleElements.syncMain();\n }\n\n /**\n * Sets the shuffle state for the playlist\n *\n * Public Accessor: Amplitude.setShufflePlaylist( playlist )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to to shuffle the playlist.\n * @param {boolean} shuffle \t- True when we are shuffling the playlist, false when we turn off shuffle.\n */\n function setShufflePlaylist(playlist, shuffle) {\n Shuffler.setShufflePlaylist(playlist, shuffle);\n\n ShuffleElements.syncMain();\n ShuffleElements.syncPlaylist(playlist);\n }\n\n /**\n * Sets the repeat state for the player.\n *\n * Public Accessor: Amplitude.setRepeat()\n *\n * @access public\n * @param {boolean} repeatState \t- The state you want the repeat song to be in.\n */\n function setRepeat(repeatState) {\n Repeater.setRepeat(repeatState);\n RepeatElements.syncRepeat();\n }\n\n /**\n * Sets the repeat state for a playlist.\n *\n * Public Accessor: Amplitude.setRepeatPlaylist( playlistKey )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to to shuffle the playlist.\n * @param {boolean} repeatState - The state you want the repeat playlist to be in.\n */\n function setRepeatPlaylist(playlist, repeatState) {\n Repeater.setRepeatPlaylist(repeatState, playlist);\n RepeatElements.syncRepeatPlaylist(playlist);\n }\n\n /**\n * Sets the repeat state for the song.\n *\n * Public Accessor: Amplitude.setRepeatSong()\n *\n * @access public\n * @param {boolean} repeatState \t- The state you want the repeat song status to be in.\n */\n function setRepeatSong(repeatState) {\n if (!config.is_touch_moving) {\n /*\n\t\t\t Sets repeat to the opposite of what it was set to\n\t\t\t*/\n Repeater.setRepeatSong(!config.repeat_song);\n\n /*\n\t\t\t\tVisually sync repeat song\n\t\t\t*/\n RepeatElements.syncRepeatSong();\n }\n }\n\n /**\n * Gets the default album art for the player\n *\n * Public Accessor: Amplitude.getDefaultAlbumArt()\n *\n * @access public\n */\n function getDefaultAlbumArt() {\n return config.default_album_art;\n }\n\n /**\n * Gets the default playlist art for the playlists\n *\n * Public Accessor: Amplitude.getDefaultPlaylistArt()\n *\n * @access public\n */\n function getDefaultPlaylistArt(){\n return config.default_playlist_art;\n }\n\n /**\n * Sets the default album art for the player\n *\n * Public Accessor: Amplitude.setDefaultAlbumArt( url )\n *\n * @access public\n * @param {string} url \t- A string representing the URL of the new default album art.\n */\n function setDefaultAlbumArt(url) {\n config.default_album_art = url;\n }\n\n /**\n * Sets the default playlist art for the player\n *\n * Public Accessor: Amplitude.setDefaultPlaylistArt( url )\n *\n * @access public\n * @param {string} url - A string representing the URL of the new default playlist art.\n */\n function setDefaultPlaylistArt(url){\n config.default_plalist_art = url;\n }\n\n /**\n * Allows the user to get the percentage of the song played.\n *\n * Public Accessor: Amplitude.getSongPlayedPercentage();\n *\n * @access public\n */\n function getSongPlayedPercentage() {\n /*\n\t\t\tReturns the percentage of the song played.\n\t\t*/\n return (config.audio.currentTime / config.audio.duration) * 100;\n }\n\n /**\n * Allows the user to get the amount of seconds the song has played.\n *\n * Public Accessor: Amplitude.getSongPlayed();\n *\n * @access public\n */\n function getSongPlayedSeconds() {\n /*\n\t\t\tReturns the amount of seconds the song has played.\n\t\t*/\n return config.audio.currentTime;\n }\n\n /**\n * Allows the user to get the duration of the current song\n *\n * Public Accessor: Amplitude.getSongPlayed();\n *\n * @access public\n */\n function getSongDuration() {\n /*\n\t\t\tReturns the duration of the current song\n\t\t*/\n return config.audio.duration;\n }\n\n /**\n * Allows the user to set how far into the song they want to be. This is\n * helpful for implementing custom range sliders. Only works on the current song.\n *\n * Public Accessor: Amplitude.setSongPlayedPercentage( float );\n *\n * @access public\n * @param {number} percentage \t- The percentage of the song played\n */\n function setSongPlayedPercentage(percentage) {\n /*\n\t\t\tEnsures the percentage is a number and is between 0 and 100.\n\t\t*/\n if (typeof percentage == \"number\" && (percentage > 0 && percentage < 100)) {\n /*\n\t\t\t\t\tSets the current time of the song to the percentage.\n\t\t\t\t*/\n config.audio.currentTime = config.audio.duration * (percentage / 100);\n }\n }\n\n /**\n * Allows the user to turn on debugging.\n *\n * Public Accessor: Amplitude.setDebug( bool );\n *\n * @access public\n * @param {boolean} state \t\t- Turns debugging on and off.\n */\n function setDebug(state) {\n /*\n\t\t\tSets the global config debug on or off.\n\t\t*/\n config.debug = state;\n }\n\n /**\n * Returns the active song meta data for the user to do what is\n * needed.\n *\n * Public Accessor: Amplitude.getActiveSongMetadata();\n *\n * @access public\n * @returns {object} JSON Object with the active song information\n */\n function getActiveSongMetadata() {\n return config.active_metadata;\n }\n\n /**\n * Returns the active playlist meta data for the for the user to use.\n *\n * Public Accessor: Amplitude.getActivePlaylistMetadata();\n *\n * @access public\n * @returns {object} JSON representation for the active playlist\n */\n function getActivePlaylistMetadata() {\n return config.playlists[config.active_playlist];\n }\n\n /**\n * Returns a song in the songs array at that index\n *\n * Public Accessor: Amplitude.getSongAtIndex( song_index )\n *\n * @access public\n * @param {number} index \t- The integer for the index of the song in the songs array.\n * @returns {object} JSON representation for the song at a specific index.\n */\n function getSongAtIndex(index) {\n return config.songs[index];\n }\n\n /**\n * Returns a song at a playlist index\n *\n * Public Accessor: Amplitude.getSongAtPlaylistIndex( playlist, index\n *\n * @access public\n * @param {number} index \t\t\t- The integer for the index of the song in the playlist.\n * @param {string} playlist\t\t- The key of the playlist we are getting the song at the index for\n * @returns {object} JSON representation for the song at a specific index.\n */\n function getSongAtPlaylistIndex(playlist, index) {\n let song = config.playlists[playlist].songs[index];\n\n return song;\n }\n\n /**\n * Adds a song to the end of the config array. This will allow Amplitude\n * to play the song in a playlist type setting.\n *\n * Public Accessor: Amplitude.addSong( song_json )\n *\n * @access public\n * @param {object} song \t- JSON representation of a song.\n * @returns {number} New index of the song.\n */\n function addSong(song) {\n /*\n\t\t\tEnsures we have a songs array to push to.\n\t\t*/\n if (config.songs == undefined) {\n config.songs = [];\n }\n\n config.songs.push(song);\n\n if (config.shuffle_on) {\n config.shuffle_list.push(song);\n }\n\n if (SoundCloud.isSoundCloudURL(song.url)) {\n SoundCloud.resolveIndividualStreamableURL(\n song.url,\n null,\n config.songs.length - 1,\n config.shuffle_on\n );\n }\n\n return config.songs.length - 1;\n }\n\n /**\n * Adds a song to a playlist. This will allow Amplitude to play the song in the\n * playlist\n *\n * Public Accessor: Amplitude.addSongToPlaylist( song_json, playlist_key )\n *\n * @access public\n * @param {object} song \t\t\t- JSON representation of a song.\n * @param {string} playlist\t\t- Playlist we are adding the song to.\n * @returns {mixed} New index of song in playlist or null if no playlist exists\n */\n function addSongToPlaylist(song, playlist) {\n if (config.playlists[playlist] != undefined) {\n config.playlists[playlist].songs.push(song);\n\n if (config.playlists[playlist].shuffle) {\n config.playlists[playlist].shuffle_list.push(song);\n }\n\n if (SoundCloud.isSoundCloudURL(song.url)) {\n SoundCloud.resolveIndividualStreamableURL(\n song.url,\n playlist,\n config.playlists[playlist].songs.length - 1,\n config.playlists[playlist].shuffle\n );\n }\n\n return config.playlists[playlist].songs.length - 1;\n } else {\n Debug.writeMessage(\"Playlist doesn't exist!\");\n return null;\n }\n }\n\n /**\n * Adds a playlist to Amplitude.\n *\n * @param {string} key - The key of the playlist we are adding.\n * @param {object} data - The data relating to the playlist\n * @param {array} songs - The songs to add to the playlist\n */\n function addPlaylist(key, data, songs) {\n /*\n Ensures the playlist is not already defined.\n */\n if (config.playlists[key] == undefined) {\n /*\n Initialize the new playlist object.\n */\n config.playlists[key] = {};\n\n /*\n Define the ignored keys that we don't want to copy over.\n */\n let ignoredKeys = [\"repeat\", \"shuffle\", \"shuffle_list\", \"songs\", \"src\"];\n\n /*\n Iterate over all of the keys defined by the user and\n set them on the playlist.\n */\n for (let dataKey in data) {\n if (ignoredKeys.indexOf(dataKey) < 0) {\n config.playlists[key][dataKey] = data[dataKey];\n }\n }\n\n /*\n Initialize the default parameters for the playlist and set the songs.\n */\n config.playlists[key].songs = songs;\n config.playlists[key].active_index = null;\n config.playlists[key].repeat = false;\n config.playlists[key].shuffle = false;\n config.playlists[key].shuffle_list = [];\n\n return config.playlists[key];\n } else {\n Debug.writeMessage(\"A playlist already exists with that key!\");\n return null;\n }\n }\n\n /**\n * Removes a song from the song array\n *\n * Public Accessor: Amplitude.removeSong( index )\n *\n * @access public\n * @param {integer} index - Index of the song being removed\n * @returns {boolean} True if removed false if not.\n */\n function removeSong(index) {\n config.songs.splice(index, 1);\n }\n\n /**\n * Removes a song from the playlist\n *\n * Public Accessor: Amplitude.removeSongFromPlaylist( index, playlist )\n *\n * @access public\n * @param {integer} index \t\t\t- Index of the song being removed from the playlist.\n * @param {string} playlist\t\t\t- Playlist we are removing the song from.\n * @returns {boolean} True if removed false if not.\n */\n function removeSongFromPlaylist(index, playlist) {\n if (config.playlists[playlist] != undefined) {\n config.playlists[playlist].songs.splice(index, 1);\n }\n }\n\n /**\n * When you pass a song object it plays that song right awawy. It sets\n * the active song in the config to the song you pass in and synchronizes\n * the visuals.\n *\n * Public Accessor: Amplitude.playNow( song )\n *\n * @access public\n * @param {object} song \t- JSON representation of a song.\n */\n function playNow(song) {\n /*\n\t\t\tMakes sure the song object has a URL associated with it\n\t\t\tor there will be nothing to play.\n\t\t*/\n if (song.url) {\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n } else {\n /*\n\t\t\t\tWrite error message since the song passed in doesn't\n\t\t\t\thave a URL.\n\t\t\t*/\n Debug.writeMessage(\"The song needs to have a URL!\");\n }\n\n /*\n\t\t\tPlays the song.\n\t\t*/\n Core.play();\n\n /*\n\t\t\tSets the main song control status visual\n\t\t*/\n PlayPauseElements.sync();\n\n /*\n\t\t\tUpdate the song meta data\n\t\t*/\n MetaDataElements.displayMetaData();\n\n /*\n\t\t\tReset the song sliders, song progress bar info, and\n\t\t\treset times. This ensures everything stays in sync.\n\t\t*/\n SongSliderElements.resetElements();\n\n /*\n\t\t\tReset the song played progress elements.\n\t\t*/\n SongPlayedProgressElements.resetElements();\n\n /*\n\t\t\tReset all of the current time elements.\n\t\t*/\n TimeElements.resetCurrentTimes();\n\n /*\n\t\t\tReset all of the duration time elements.\n\t\t*/\n TimeElements.resetDurationTimes();\n\n /*\n Sets the state of the player.\n */\n ConfigState.setPlayerState();\n }\n\n /**\n * Plays a song at the index passed in from the songs array.\n *\n * Public Accessor: Amplitude.playSongAtIndex( index )\n *\n * @access public\n * @param {number} index \t- The number representing the song in the songs array.\n */\n function playSongAtIndex(index) {\n /*\n\t\t\t Stop the current song.\n\t\t*/\n Core.stop();\n\n /*\n\t\t\t Determine if there is a new playlist, if so set the active playlist and change the song.\n\t\t*/\n if (Checks.newPlaylist(null)) {\n AudioNavigation.setActivePlaylist(null);\n\n AudioNavigation.changeSong(config.songs[index], index);\n }\n\n /*\n\t\t\t Check if the song is new. If so, change the song.\n\t\t*/\n if (Checks.newSong(null, index)) {\n AudioNavigation.changeSong(config.songs[index], index);\n }\n\n /*\n\t\t\tPlay the song\n\t\t*/\n Core.play();\n\n /*\n Sets the state of the player.\n */\n ConfigState.setPlayerState();\n\n /*\n\t\t\tSync all of the play pause buttons.\n\t\t*/\n PlayPauseElements.sync();\n }\n\n /**\n * Plays a song at the index passed in for the playlist provided. The index passed\n * in should be the index of the song in the playlist and not the songs array.\n *\n * @access public\n * @param {number} index \t\t- The number representing the song in the playlist array.\n * @param {string} playlist - The key string representing the playlist we are playing the song from.\n *\n */\n function playPlaylistSongAtIndex(index, playlist) {\n Core.stop();\n\n /*\n\t\t\tDetermine if there is a new playlist, if so set the active playlist and change the song.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[index],\n index\n );\n }\n\n /*\n\t\t\tCheck if the song is new. If so, change the song.\n\t\t*/\n if (Checks.newSong(playlist, index)) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[index],\n index\n );\n }\n\n /*\n\t\t\tSync all of the play pause buttons.\n\t\t*/\n PlayPauseElements.sync();\n\n /*\n\t\t\tPlay the song\n\t\t*/\n Core.play();\n\n /*\n\t\t\tSet the state of the player\n\t\t*/\n ConfigState.setPlayerState();\n }\n\n /**\n * Allows the user to play whatever the active song is directly\n * through Javascript. Normally ALL of Amplitude functions that access\n * the core features are called through event handlers.\n *\n * Public Accessor: Amplitude.play();\n *\n * @access public\n */\n function play() {\n Core.play();\n\n ConfigState.setPlayerState();\n }\n\n /**\n * Allows the user to pause whatever the active song is directly\n * through Javascript. Normally ALL of Amplitude functions that access\n * the core features are called through event handlers.\n *\n * Public Accessor: Amplitude.pause();\n *\n * @access public\n */\n function pause() {\n Core.pause();\n\n ConfigState.setPlayerState();\n }\n\n /**\n * Returns the audio object used to play the audio\n *\n * Public Accessor: Amplitude.getAudio();\n *\n * @access public\n */\n function getAudio() {\n return config.audio;\n }\n\n /**\n * Returns the Web Audio API ANalyser used for visualizations.\n *\n * Public Accessor: Amplitude.getAnalyser()\n *\n * @access public\n */\n function getAnalyser() {\n return config.analyser;\n }\n\n /**\n * Plays the next song either in the playlist or globally.\n *\n * Public Accessor: Amplitude.next( playlist );\n *\n * @access public\n * @param {string} [playlist = null \t- The playlist key\n */\n function next(playlist = null) {\n let nextData = {};\n /*\n\t\t\tIf the playlist is empty or null, then we check the active\n\t\t\tplaylist\n\t\t*/\n if (playlist == \"\" || playlist == null) {\n /*\n\t\t\t\tIf the active playlist is null, then we set the next global\n\t\t\t\tsong or we set the next in the playlist.\n\t\t\t*/\n if (config.active_playlist == null || config.active_playlist == \"\") {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n } else {\n AudioNavigation.setNextPlaylist(playlist);\n }\n }\n\n /**\n * Plays the prev song either in the playlist or globally.\n *\n * Public Accessor: Amplitude.prev( playlist );\n *\n * @access public\n * @param {string} [playlist = null] \t- The playlist key\n */\n function prev(playlist = null) {\n let prevData = {};\n\n /*\n\t\t\tIf the playlist is empty or null, then we check the active\n\t\t\tplaylist\n\t\t*/\n if (playlist == \"\" || playlist == null) {\n /*\n\t\t\t\tIf the active playlist is null, then we set the prev global\n\t\t\t\tsong or we set the prev in the playlist.\n\t\t\t*/\n if (config.active_playlist == null || config.active_playlist == \"\") {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n } else {\n AudioNavigation.setPreviousPlaylist(playlist);\n }\n }\n\n /**\n * Gets all of the songs in the songs array\n *\n * Public Accessor: Amplitude.getSongs( );\n *\n * @access public\n */\n function getSongs() {\n return config.songs;\n }\n\n /**\n * Gets all of the songs in a playlist\n *\n * Public Accessor: Amplitude.getSongsInPlaylist( playlist );\n *\n * @access public\n * @param {string} playlist \t- The playlist key\n */\n function getSongsInPlaylist(playlist) {\n return config.playlists[playlist].songs;\n }\n\n /**\n * Get current state of songs. If shuffled, this will return the shuffled\n * songs.\n *\n * Public Accessor: Amplitude.getSongsState();\n *\n * @access public\n */\n function getSongsState() {\n if (config.shuffle_on) {\n return config.shuffle_list;\n } else {\n return config.songs;\n }\n }\n\n /**\n * Get current state of songs in playlist. If shuffled, this will return the\n * shuffled songs.\n *\n * Public Accessor: Amplitude.getSongsStatePlaylist( playlist );\n *\n * @access public\n * @param {string} playlist \t- The playlist key\n */\n function getSongsStatePlaylist(playlist) {\n if (config.playlists[playlist].shuffle) {\n return config.playlists[playlist].shuffle_list;\n } else {\n return config.playlists[playlist].songs;\n }\n }\n\n /**\n * Gets the active index of the player\n *\n * Public Accessor: Amplitude.getActiveIndex()\n *\n * @access public\n */\n function getActiveIndex() {\n return parseInt(config.active_index);\n }\n\n /**\n * Get the version of AmplitudeJS\n *\n * Public Accessor: Amplitude.getVersion()\n *\n * @access public\n */\n function getVersion() {\n return config.version;\n }\n\n /**\n * Get the buffered amount for the current song\n *\n * Public Accessor: Amplitude.getBuffered()\n *\n * @access public\n */\n function getBuffered() {\n return config.buffered;\n }\n\n /**\n * Skip to a certain location in a selected song.\n *\n * Public Accessor: Amplitude.getBuffered()\n *\n * @access public\n * @param {number} seconds \t\t\t\t\t\t- The amount of seconds we should skip to in the song.\n * @param {number} songIndex \t\t\t\t\t- The index of the song in the songs array.\n * @param {string} [playlist = null]\t- The playlist the song we are skipping to belogns to.\n */\n function skipTo(seconds, songIndex, playlist = null) {\n seconds = parseInt(seconds);\n\n if (playlist != null) {\n /*\n Checks if we are skipping to a new playlist\n */\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n }\n\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[songIndex],\n songIndex\n );\n Core.play();\n\n /*\n Sync all of the play pause elements.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncPlaylist();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(seconds);\n } else {\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSong(config.songs[songIndex], songIndex);\n Core.play();\n\n /*\n Syncs all of the play pause buttons now that we've skipped.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(seconds);\n }\n }\n\n /**\n * Sets the meta data for a song in the songs array. This will set any\n * meta data for a song besides the URL. The URL could cause issues if the\n * song was playing.\n *\n * Public Accessor: Amplitude.setSongMetaData()\n *\n * @access public\n * @param {number} index\t\t\t\t\t- The index of the song in the songs array.\n * @param {object} metaData \t\t\t- The object containing the meta data we are updating.\n * @param {string} playlist - The playlist we are updating the song meta data for.\n */\n function setSongMetaData(index, metaData, playlist = null) {\n /*\n Update the meta data for a song in a playlist.\n */\n if (\n playlist != \"\" &&\n playlist != null &&\n config.playlists[playlist] != undefined\n ) {\n /*\n Set all of the defined meta data properties\n */\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (key != \"url\" && key != \"URL\" && key != \"live\" && key != \"LIVE\") {\n config.playlists[playlist].songs[index][key] = metaData[key];\n }\n }\n }\n } else {\n /*\n Update the meta data for a song.\n */\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (key != \"url\" && key != \"URL\" && key != \"live\" && key != \"LIVE\") {\n config.songs[index][key] = metaData[key];\n }\n }\n }\n }\n\n /*\n Display the updates on the screen.\n */\n MetaDataElements.displayMetaData();\n MetaDataElements.syncMetaData();\n }\n\n function setPlaylistMetaData(playlist, metaData) {\n if (config.playlists[playlist] != undefined) {\n /*\n \t\t\tThese are the ignored keys that we won't be worrying about displaying.\n \t\t\tEvery other key in the playlist object can be displayed.\n \t\t*/\n let ignoredKeys = [\"repeat\", \"shuffle\", \"shuffle_list\", \"songs\", \"src\"];\n\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (ignoredKeys.indexOf(key) < 0) {\n config.playlists[playlist][key] = metaData[key];\n }\n }\n }\n\n MetaDataElements.displayPlaylistMetaData();\n } else {\n Debug.writeMessage(\"You must provide a valid playlist key!\");\n }\n }\n\n /**\n * Sets the delay between the songs when they are finished.\n *\n * Public Accessor: Amplitude.setDelay()\n *\n * @access public\n * @param {number} delay \t- The millisecond delay time between songs\n */\n function setDelay(time) {\n config.delay = time;\n }\n\n /**\n * Returns the current delay between songs.\n *\n * Public Accessor: Amplitude.getDelay()\n *\n * @access public\n */\n function getDelay() {\n return config.delay;\n }\n\n /**\n * Returns the state of the player.\n *\n * Public Accessor: Amplitude.getPlayerState();\n */\n function getPlayerState() {\n return config.player_state;\n }\n\n /**\n * Registers a visualization and sets that visualization's\n * preferences. When creating a visualization, you can set certain\n * preferences that the user can overwrite similar to Amplitude.\n * Public Accessor: Amplitude.registerVisualization( visualization, preferences )\n *\n * @param {object} visualzation A visualization object that gets registered\n * with Amplitude\n *\n * @param {object} preferences A JSON object of preferences relating to the\n * visualization\n */\n function registerVisualization(visualization, preferences) {\n Visualizations.register(visualization, preferences);\n }\n\n /**\n * Set the visualization for the playlist\n *\n * @param {string} playlist - The playlist we are setting the visualization for.\n * @param {string} visualizationKey - The key of the visualization we are adding to the playlist.\n */\n function setPlaylistVisualization(playlist, visualizationKey) {\n if (config.playlists[playlist] != undefined) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.playlists[playlist].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"The playlist for the key provided does not exist\");\n }\n }\n\n /**\n * Set a visualization for the song.\n *\n * @param {number} songIndex - The index of the song in the songs array we are setting the visualization for.\n * @param {string} visualizationKey - The key of the visualization we are adding to the playlist.\n */\n function setSongVisualization(songIndex, visualizationKey) {\n if (config.songs[songIndex]) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.songs[songIndex].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"A song at that index is undefined\");\n }\n }\n\n /**\n * Set song in playlist visualization.\n *\n * @param {string} playlist - The playlist we are setting the song visualization for.\n * @param {number} songIndex - The index we are setting the visualization for.\n * @param {strong} visualizationKey - The key of the visualization we are adding to the song in the playlist.\n */\n function setSongInPlaylistVisualization(\n playlist,\n songIndex,\n visualizationKey\n ) {\n if (config.playlists[playlist].songs[songIndex] != undefined) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.playlists[playlist].songs[\n songIndex\n ].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"The song in the playlist at that key is not defined\");\n }\n }\n\n /**\n * Sets the global visualization default.\n */\n function setGlobalVisualization(visualizationKey) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n }\n\n /**\n * Sets the active volume.\n * @param {number} volumeLevel - A number between 1 and 100 as a percentage of\n * min to max for a volume level.\n */\n function setVolume( volumeLevel ){\n Core.setVolume( volumeLevel );\n }\n\n /**\n * Gets the active volume.\n */\n function getVolume(){\n return config.volume;\n }\n\n /*\n\t\tReturns all of the publically accesible methods.\n\t*/\n return {\n init: init,\n getConfig: getConfig,\n bindNewElements: bindNewElements,\n getActivePlaylist: getActivePlaylist,\n getPlaybackSpeed: getPlaybackSpeed,\n setPlaybackSpeed: setPlaybackSpeed,\n getRepeat: getRepeat,\n getRepeatPlaylist: getRepeatPlaylist,\n getShuffle: getShuffle,\n getShufflePlaylist: getShufflePlaylist,\n setShuffle: setShuffle,\n setShufflePlaylist: setShufflePlaylist,\n setRepeat: setRepeat,\n setRepeatSong: setRepeatSong,\n setRepeatPlaylist: setRepeatPlaylist,\n getDefaultAlbumArt: getDefaultAlbumArt,\n setDefaultAlbumArt: setDefaultAlbumArt,\n getDefaultPlaylistArt: getDefaultPlaylistArt,\n setDefaultPlaylistArt: setDefaultPlaylistArt,\n getSongPlayedPercentage: getSongPlayedPercentage,\n setSongPlayedPercentage: setSongPlayedPercentage,\n getSongPlayedSeconds: getSongPlayedSeconds,\n getSongDuration: getSongDuration,\n setDebug: setDebug,\n getActiveSongMetadata: getActiveSongMetadata,\n getActivePlaylistMetadata: getActivePlaylistMetadata,\n getSongAtIndex: getSongAtIndex,\n getSongAtPlaylistIndex: getSongAtPlaylistIndex,\n addSong: addSong,\n addSongToPlaylist: addSongToPlaylist,\n removeSong: removeSong,\n removeSongFromPlaylist: removeSongFromPlaylist,\n playNow: playNow,\n playSongAtIndex: playSongAtIndex,\n playPlaylistSongAtIndex: playPlaylistSongAtIndex,\n play: play,\n pause: pause,\n getAudio: getAudio,\n getAnalyser: getAnalyser,\n next: next,\n prev: prev,\n getSongs: getSongs,\n getSongsInPlaylist: getSongsInPlaylist,\n getSongsState: getSongsState,\n getSongsStatePlaylist: getSongsStatePlaylist,\n getActiveIndex: getActiveIndex,\n getVersion: getVersion,\n getBuffered: getBuffered,\n skipTo: skipTo,\n setSongMetaData: setSongMetaData,\n setPlaylistMetaData: setPlaylistMetaData,\n setDelay: setDelay,\n getDelay: getDelay,\n getPlayerState: getPlayerState,\n addPlaylist: addPlaylist,\n registerVisualization: registerVisualization,\n setPlaylistVisualization: setPlaylistVisualization,\n setSongVisualization: setSongVisualization,\n setSongInPlaylistVisualization: setSongInPlaylistVisualization,\n setGlobalVisualization: setGlobalVisualization,\n getVolume: getVolume,\n setVolume: setVolume\n };\n})();\n\nexport default Amplitude;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Checks Utility.\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * AmplitudeJS Visual Meta Data Elements Module\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * AmplitudeJS SoundCloud Meta module\n * @module soundcloud/Soundcloud\n */\nimport SoundCloud from \"../soundcloud/soundcloud.js\";\n\n/**\n * Handles the initialization of the playlists.\n *\n * @module init/PlaylistsInitializer\n */\nlet PlaylistsInitializer = (function() {\n /**\n * Initializes the playlists for AmplitudeJS\n *\n * @param {Object} playlists - The playlists defined by the user.\n */\n function initialize(playlists) {\n /*\n Copy the playlists over to Amplitude\n */\n config.playlists = playlists;\n\n /*\n Copy songs over from songs array.\n */\n copySongsToPlaylists();\n\n /*\n Grab any SoundCloud Data for the playlist songs if needed.\n */\n grabSoundCloudData();\n\n /*\n Initialize a scoped active index for each playlist.\n */\n initializePlaylistActiveIndexes();\n\n /*\n Initialize the shuffle status of the playlists.\n */\n initializePlaylistShuffleStatuses();\n\n /*\n Initialize the repeat status for the playlits.\n */\n initializePlaylistsRepeatStatuses();\n\n /*\n Initialize temporary place holders for shuffle lists.\n */\n initializePlaylistShuffleLists();\n\n /*\n Initializes the first song in the playlist\n */\n initializeFirstSongInPlaylistMetaData();\n }\n\n /**\n * Initializes a scoped active index for each playlist.\n *\n * @access private\n */\n function initializePlaylistActiveIndexes() {\n /*\n \t\tIterate over all of the playlists defined by the user\n and add an active index.\n\t\t*/\n for (let key in config.playlists) {\n config.playlists[key].active_index = null;\n }\n }\n\n /**\n * Ensures the indexes in the playlists are valid indexes. The song has\n * to exist in the Amplitude config to be played correctly. If the index\n * is an integer, we ensure it exists and coy it to the array.\n *\n * @access private\n */\n function copySongsToPlaylists() {\n /*\n Iterate over all of the config's playlists\n */\n for (let key in config.playlists) {\n /*\n Checks if the playlist key is accurate.\n */\n if (config.playlists.hasOwnProperty(key)) {\n /*\n Checks if the playlist has songs.\n */\n if (config.playlists[key].songs) {\n /*\n Iterate over all of the songs in the playlist\n */\n for (let i = 0; i < config.playlists[key].songs.length; i++) {\n if (Checks.isInt(config.playlists[key].songs[i])) {\n config.playlists[key].songs[i] =\n config.songs[config.playlists[key].songs[i]];\n\n config.playlists[key].songs[i].index = i;\n }\n /*\n Check to see if the index for the song in the playlist\n exists in the songs config.\n */\n if (\n Checks.isInt(config.playlists[key].songs[i]) &&\n !config.songs[config.playlists[key].songs[i]]\n ) {\n Debug.writeMessage(\n \"The song index: \" +\n config.playlists[key].songs[i] +\n \" in playlist with key: \" +\n key +\n \" is not defined in your songs array!\"\n );\n }\n\n /*\n If not an int, then is a dedicated song, just set the index.\n */\n if (!Checks.isInt(config.playlists[key].songs[i]) ){\n config.playlists[key].songs[i].index = i;\n }\n }\n }\n }\n }\n }\n\n /**\n * Grabs the SoundCloud data for any song in the playlist that\n * the user needs to grab data for.\n *\n * @access private\n */\n function grabSoundCloudData() {\n /*\n Iterate over all of the config's playlists\n */\n for (let key in config.playlists) {\n /*\n Checks if the playlist key is accurate.\n */\n if (config.playlists.hasOwnProperty(key)) {\n /*\n Iterate over all of the songs in the playlist and see if\n they need to grab the SoundCloud data for the song.\n */\n for (let i = 0; i < config.playlists[key].songs.length; i++) {\n /*\n Only Grab the data if the URL is a SoundCloud URL.\n */\n if (SoundCloud.isSoundCloudURL(config.playlists[key].songs[i].url)) {\n /*\n Only grab the data if the SoundCloud data has not already been\n grabbed for the audio. This could happen if the user defined the\n song in the songs array and was grabbed before.\n */\n if (config.playlists[key].songs[i].soundcloud_data == undefined) {\n SoundCloud.resolveIndividualStreamableURL(\n config.playlists[key].songs[i].url,\n key,\n i\n );\n }\n }\n }\n }\n }\n }\n\n /**\n * Initializes the shuffle statuses for each of the playlists. These will\n * be referenced when we shuffle individual playlists.\n *\n * @access private\n */\n function initializePlaylistShuffleStatuses() {\n /*\n\t\t\tIterate over all of the playlists the user defined adding\n\t\t\tthe playlist key to the shuffled playlist array and creating\n\t\t\tand empty object to house the statuses.\n\t\t*/\n for (let key in config.playlists) {\n config.playlists[key].shuffle = false;\n }\n }\n\n /**\n * Initializes the repeat statuses for each of the playlists. These will\n * be referenced when we repeat individual playlits.\n *\n * @access private\n */\n function initializePlaylistsRepeatStatuses() {\n /*\n Iterate over all of the playlists the user defined adding\n the playlist key to the repeated playlist array and creating\n and empty object to house the statuses.\n */\n for (let key in config.playlists) {\n config.playlists[key].repeat = false;\n }\n }\n\n /**\n * Initializes the shuffled playlist placeholders. These will be set for\n * playlists that are shuffled and contain the shuffled songs.\n *\n * @access private\n */\n function initializePlaylistShuffleLists() {\n /*\n \t\t\tIterate over all of the playlists the user defined adding\n \t\t\tthe playlist key to the shuffled playlists array and creating\n \t\t\tand empty object to house the shuffled playlists\n \t\t*/\n for (let key in config.playlists) {\n config.playlists[key].shuffle_list = [];\n }\n }\n\n /**\n * Intializes the display for the first song in the playlist meta data.\n *\n * @access private\n */\n function initializeFirstSongInPlaylistMetaData() {\n /*\n\t\t\tIterates over all of the playlists setting the meta data for the\n\t\t\tfirst song.\n\t\t*/\n for (let key in config.playlists) {\n MetaDataElements.setFirstSongInPlaylist(\n config.playlists[key].songs[0],\n key\n );\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n initialize: initialize\n };\n})();\n\nexport default PlaylistsInitializer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/init/playlists.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the container elements.\n *\n * @param visual/ContainerElements\n */\nlet ContainerElements = (function() {\n /**\n * Applies the class 'amplitude-active-song-container' to the element\n * containing visual information regarding the active song.\n *\n * @access public\n */\n function setActive() {\n /*\n Gets all of the song container elements.\n */\n let songContainers = document.getElementsByClassName(\n \"amplitude-song-container\"\n );\n\n /*\n\t\t\tRemoves all of the active song containrs.\n\t\t*/\n for (let i = 0; i < songContainers.length; i++) {\n songContainers[i].classList.remove(\"amplitude-active-song-container\");\n }\n\n /*\n\t\t\tFinds the active index and adds the active song container to the element\n\t\t\tthat represents the song at the index.\n\t\t*/\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n let activeIndex = '';\n\n if( config.shuffle_on ){\n activeIndex = config.shuffle_list[ config.active_index ].index;\n }else{\n activeIndex = config.active_index;\n }\n\n if (\n document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activeIndex +\n '\"]'\n )\n ) {\n let songContainers = document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activeIndex +\n '\"]'\n );\n\n for (let i = 0; i < songContainers.length; i++) {\n if (!songContainers[i].hasAttribute(\"data-amplitude-playlist\")) {\n songContainers[i].classList.add(\"amplitude-active-song-container\");\n }\n }\n }\n } else {\n if( config.active_playlist != null && config.active_playlist != '' ){\n var activePlaylistIndex = config.playlists[ config.active_playlist ].active_index;\n }else{\n var activePlaylistIndex = '';\n\n if( config.playlists[ config.active_playlist ].shuffle ){\n activePlaylistIndex = config.playlists[ config.active_playlist ].shuffle_list[ config.playlists[config.active_playlist].active_index ].index;\n }else{\n activePlaylistIndex = config.playlists[ config.active_playlist ].active_index;\n }\n }\n\n if (\n document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n )\n ) {\n let songContainers = document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < songContainers.length; i++) {\n songContainers[i].classList.add(\"amplitude-active-song-container\");\n }\n }\n }\n }\n\n return {\n setActive: setActive\n };\n})();\n\nexport default ContainerElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/containerElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time hour elements.\n *\n * @module visual/time/CurrentHourElements\n */\nlet CurrentHourElements = (function() {\n function sync(hours) {\n syncGlobal(hours);\n syncPlaylist(hours);\n syncSong(hours);\n syncSongInPlaylist(hours);\n }\n\n /**\n * Updates any elements that display the current hour for the song.\n *\n * @access public\n * @param {number} hours \t- An integer conaining how many hours into the song.\n */\n function syncGlobal(hours) {\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourSelectors = document.querySelectorAll(\n \".amplitude-current-hours\"\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourSelectors.length; i++) {\n let playlist = currentHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the playlist current hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncPlaylist(hours) {\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourPlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourPlaylistSelectors.length; i++) {\n let songIndex = currentHourPlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (songIndex == null) {\n currentHourPlaylistSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the song hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncSong(hours) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the hour selectors\n \t\t*/\n const currentHourSongSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current hour selector's inner html to hours passed in.\n \t\t*/\n for (let i = 0; i < currentHourSongSelectors.length; i++) {\n let playlist = currentHourSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (playlist == null) {\n currentHourSongSelectors[i].innerHTML = hours;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist song hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncSongInPlaylist(hours) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourPlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourPlaylistSongSelectors.length; i++) {\n currentHourPlaylistSongSelectors[i].innerHTML = hours;\n }\n }\n\n /**\n * Reset the current hour elements.\n */\n function resetTimes() {\n /*\n Gets the hour display elements\n */\n let hourSelectors = document.querySelectorAll(\".amplitude-current-hours\");\n\n /*\n Iterates over all of the hour selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < hourSelectors.length; i++) {\n hourSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentHourElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentHourElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time minutes elements.\n *\n * @module visual/time/CurrentMinuteElements\n */\nlet CurrentMinuteElements = (function() {\n /**\n * Syncs the current minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function sync(minutes) {\n syncGlobal(minutes);\n syncPlaylist(minutes);\n syncSong(minutes);\n syncSongInPlaylist(minutes);\n }\n\n /**\n * Syncs the global current minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncGlobal(minutes) {\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinuteSelectors = document.querySelectorAll(\n \".amplitude-current-minutes\"\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinuteSelectors.length; i++) {\n let playlist = currentMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the playlist minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncPlaylist(minutes) {\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinutePlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinutePlaylistSelectors.length; i++) {\n let songIndex = currentMinutePlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (songIndex == null) {\n currentMinutePlaylistSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the current song minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncSong(minutes) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the minute selectors\n \t\t*/\n const currentMinuteSongSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current minute selector's inner html to minutes passed in.\n \t\t*/\n for (let i = 0; i < currentMinuteSongSelectors.length; i++) {\n let playlist = currentMinuteSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (playlist == null) {\n currentMinuteSongSelectors[i].innerHTML = minutes;\n }\n }\n }\n }\n\n /**\n * Syncs the current song in playlist minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncSongInPlaylist(minutes) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinutePlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinutePlaylistSongSelectors.length; i++) {\n currentMinutePlaylistSongSelectors[i].innerHTML = minutes;\n }\n }\n\n /**\n * Reset the current times.\n */\n function resetTimes() {\n /*\n Gets the minute display elements\n */\n let minuteSelectors = document.querySelectorAll(\n \".amplitude-current-minutes\"\n );\n\n /*\n Iterates over all of the minute selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < minuteSelectors.length; i++) {\n minuteSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentMinuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentMinuteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time seconds elements.\n *\n * @module visual/time/CurrentSecondElements\n */\nlet CurrentSecondElements = (function() {\n /**\n * Syncs the current seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function sync(seconds) {\n syncGlobal(seconds);\n syncPlaylist(seconds);\n syncSong(seconds);\n syncSongInPlaylist(seconds);\n }\n\n /**\n * Syncs the global current seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncGlobal(seconds) {\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondSelectors = document.querySelectorAll(\n \".amplitude-current-seconds\"\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondSelectors.length; i++) {\n let playlist = currentSecondSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the playlist seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncPlaylist(seconds) {\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondPlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondPlaylistSelectors.length; i++) {\n let songIndex = currentSecondPlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (songIndex == null) {\n currentSecondPlaylistSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the current song seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncSong(seconds) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the second selectors\n \t\t*/\n const currentSecondSongSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current second selector's inner html to seconds passed in.\n \t\t*/\n for (let i = 0; i < currentSecondSongSelectors.length; i++) {\n let playlist = currentSecondSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (playlist == null) {\n currentSecondSongSelectors[i].innerHTML = seconds;\n }\n }\n }\n }\n\n /**\n * Syncs the current song in playlist seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncSongInPlaylist(seconds) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondPlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondPlaylistSongSelectors.length; i++) {\n currentSecondPlaylistSongSelectors[i].innerHTML = seconds;\n }\n }\n\n /**\n * Reset the current seconds elements.\n */\n function resetTimes() {\n /*\n Gets the second display elements\n */\n let secondSelectors = document.querySelectorAll(\n \".amplitude-current-seconds\"\n );\n\n /*\n Iterates over all of the second selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < secondSelectors.length; i++) {\n secondSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentSecondElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentSecondElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * These methods help sync visual time elements.\n *\n * @module visual/CurrentTimeElements\n */\nlet CurrentTimeElements = (function() {\n /**\n * Visually displays the current time on the screen. This is called on\n * time update for the current song.\n *\n * @access public\n * @param {object} currentTime \t\t\t\t\t- An object containing the current time for the song in seconds, minutes, and hours.\n */\n function sync(currentTime) {\n /*\n\t\t\tSet current time display.\n\t\t*/\n syncGlobal(currentTime);\n syncPlaylist(currentTime);\n syncSong(currentTime);\n syncSongInPlaylist(currentTime);\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncGlobal(time) {\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n \".amplitude-current-time\"\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let playlist = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncPlaylist(time) {\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let songIndex = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncSong(time) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the time selectors.\n \t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the time selector's inner html to the current time for the song. The current\n \t\t\ttime is computed by joining minutes and seconds.\n \t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let playlist = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncSongInPlaylist(time) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n\n /**\n * Resets the current time displays to 00:00\n *\n * @access public\n */\n function resetTimes() {\n /*\n\t\t\tGets the time selector display elements\n\t\t*/\n let timeSelectors = document.querySelectorAll(\".amplitude-current-time\");\n\n /*\n\t\t\tIterates over all of the time selectors and sets the inner HTML\n\t\t\tto 00.\n\t\t*/\n for (let i = 0; i < timeSelectors.length; i++) {\n timeSelectors[i].innerHTML = \"00:00\";\n }\n }\n\n /**\n * Returns the publically facing methods\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentTimeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration countdown elements.\n *\n * @module visual/time/DurationCountDownTimeElements.\n */\nlet DurationCountDownTimeElements = (function() {\n /**\n * Syncs all of the countdown time elements.\n *\n * @param {object} countDownTime - The current time of the audio.\n * @param {object} songDuration - The song duration of the audio.\n */\n function sync(countDownTime, songDuration) {\n let timeRemaining = computeTimeRemaining(countDownTime, songDuration);\n\n syncGlobal(timeRemaining);\n syncPlaylist(timeRemaining);\n syncSong(timeRemaining);\n syncSongInPlaylist(timeRemaining);\n }\n\n /**\n * Syncs the global count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncGlobal(timeRemaining) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n \".amplitude-time-remaining\"\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let playlist = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n\n /**\n * Syncs the playlist count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncPlaylist(timeRemaining) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let songIndex = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n\n /**\n * Syncs the song count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncSong(timeRemaining) {\n if (config.active_playlist == null) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let playlist = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncSongInPlaylist(timeRemaining) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n\n /**\n * Resets the count down times.\n */\n function resetTimes() {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n \".amplitude-time-remaining\"\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n durationTimeRemainingSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Computes the time remaining for the audio.\n *\n * @param {object} currentTime - The current time of the audio.\n * @param {object} songDuration - The duration of the audio.\n */\n function computeTimeRemaining(currentTime, songDuration) {\n let timeRemaining = \"00:00\";\n\n /*\n Initialize the total current seconds and total duration seconds\n */\n let totalCurrentSeconds =\n parseInt(currentTime.seconds) +\n parseInt(currentTime.minutes) * 60 +\n parseInt(currentTime.hours) * 60 * 60;\n let totalDurationSeconds =\n parseInt(songDuration.seconds) +\n parseInt(songDuration.minutes) * 60 +\n parseInt(songDuration.hours) * 60 * 60;\n\n /*\n If the two variables are numbers we continue the computing.\n */\n if (!isNaN(totalCurrentSeconds) && !isNaN(totalDurationSeconds)) {\n /*\n Find the total remaining seconds.\n */\n let timeRemainingTotalSeconds =\n totalDurationSeconds - totalCurrentSeconds;\n\n var remainingHours = Math.floor(timeRemainingTotalSeconds / 3600);\n var remainingMinutes = Math.floor(\n (timeRemainingTotalSeconds - remainingHours * 3600) / 60\n );\n var remainingSeconds =\n timeRemainingTotalSeconds -\n remainingHours * 3600 -\n remainingMinutes * 60;\n\n timeRemaining =\n (remainingMinutes < 10 ? \"0\" + remainingMinutes : remainingMinutes) +\n \":\" +\n (remainingSeconds < 10 ? \"0\" + remainingSeconds : remainingSeconds);\n\n if (remainingHours > 0) {\n timeRemaining = remainingHours + \":\" + timeRemaining;\n }\n }\n\n return timeRemaining;\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationCountDownTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationCountDownTimeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration hours elements.\n *\n * @module visual/time/DurationHourElements.\n */\nlet DurationHourElements = (function() {\n /**\n * Sync the duration hours elements.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function sync(hours) {\n syncGlobal(hours);\n syncPlaylist(hours);\n syncSong(hours);\n syncSongInPlaylist(hours);\n }\n\n /**\n * Syncs the global duration hours elements.\n *\n * @param {Integer} hours - the duration hours for the audio.\n */\n function syncGlobal(hours) {\n let durationHourSelectors = document.querySelectorAll(\n \".amplitude-duration-hours\"\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let playlist = durationHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the playlist duration hours for the audio.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function syncPlaylist(hours) {\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let songIndex = durationHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the song duration hours.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function syncSong(hours) {\n if (config.active_playlist == null) {\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let playlist = durationHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration hours.\n *\n * @param {Integer} hours - The duration hours of the audio.\n */\n function syncSongInPlaylist(hours) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n\n /**\n * Resets the duration shours elements to '00'\n */\n function resetTimes() {\n let durationHourSelectors = document.querySelectorAll(\n \".amplitude-duration-hours\"\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n durationHourSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationHourElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationHourElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration minutes elements.\n *\n * @module visual/time/DurationMinuteElements.\n */\nlet DurationMinuteElements = (function() {\n /**\n * Sync the duration minutes elements.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function sync(minutes) {\n syncGlobal(minutes);\n syncPlaylist(minutes);\n syncSong(minutes);\n syncSongInPlaylist(minutes);\n }\n\n /**\n * Syncs the global duration minutes elements.\n *\n * @param {Integer} minutes - the duration minutes for the audio.\n */\n function syncGlobal(minutes) {\n let durationMinuteSelectors = document.querySelectorAll(\n \".amplitude-duration-minutes\"\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let playlist = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the playlist duration minutes for the audio.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function syncPlaylist(minutes) {\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let songIndex = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the song duration minutes.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function syncSong(minutes) {\n if (config.active_playlist == null) {\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let playlist = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration minutes.\n *\n * @param {Integer} minutes - The duration minutes of the audio.\n */\n function syncSongInPlaylist(minutes) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n\n /**\n * Resets the duration minutes elements to '00'\n */\n function resetTimes() {\n let durationMinuteSelectors = document.querySelectorAll(\n \".amplitude-duration-minutes\"\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n durationMinuteSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationMinuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationMinuteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration seconds elements.\n *\n * @module visual/time/DurationSecondElements.\n */\nlet DurationSecondElements = (function() {\n /**\n * Sync the duration seconds elements.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function sync(seconds) {\n syncGlobal(seconds);\n syncPlaylist(seconds);\n syncSong(seconds);\n syncSongInPlaylist(seconds);\n }\n\n /**\n * Syncs the global duration seconds elements.\n *\n * @param {Integer} seconds - the duration seconds for the audio.\n */\n function syncGlobal(seconds) {\n let durationSecondSelectors = document.querySelectorAll(\n \".amplitude-duration-seconds\"\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let playlist = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the playlist duration seconds for the audio.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function syncPlaylist(seconds) {\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let songIndex = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the song duration seconds.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function syncSong(seconds) {\n if (config.active_playlist == null) {\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let playlist = durationSecondSelectors[i].getAttribute(\n \"data--amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration seconds.\n *\n * @param {Integer} seconds - The duration seconds of the audio.\n */\n function syncSongInPlaylist(seconds) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n\n /**\n * Resets the duration seconds elements to '00'\n */\n function resetTimes() {\n let durationSecondSelectors = document.querySelectorAll(\n \".amplitude-duration-seconds\"\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n durationSecondSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationSecondElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationSecondElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration time elements.\n *\n * @module visual/time/DurationTimeElements.\n */\nlet DurationTimeElements = (function() {\n /**\n * Syncs the duration time for all elements.\n *\n * @param {Object} durationTime - The object containing all of the song duration times.\n */\n function sync(durationTime) {\n let durationText = computeDurationText(durationTime);\n\n syncGlobal(durationText);\n syncPlaylist(durationText);\n syncSong(durationText);\n syncSongInPlaylist(durationText);\n }\n\n /**\n * Sync the global song duration elements.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncGlobal(durationText) {\n let durationTimeSelectors = document.querySelectorAll(\n \".amplitude-duration-time\"\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let playlist = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n\n /**\n * Sync the playlist duration times.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncPlaylist(durationText) {\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let songIndex = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n\n /**\n * Sync the song duration times.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncSong(durationText) {\n if (config.active_playlist == null) {\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let playlist = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n }\n\n /**\n * Sync the song in playlist duration times.\n *\n * @param {Object} durationText - An object containing the duration text.\n */\n function syncSongInPlaylist(durationText) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n\n /**\n * Resets all of the duration times to empty.\n */\n function resetTimes() {\n let durationTimeSelectors = document.querySelectorAll(\n \".amplitude-duration-time\"\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n durationTimeSelectors[i].innerHTML = \"00:00\";\n }\n }\n\n /**\n * Computes the duration text\n *\n * @param {Object} durationTime - An object containint the duration times.\n */\n function computeDurationText(durationTime) {\n var durationText = \"00:00\";\n\n if (!isNaN(durationTime.minutes) && !isNaN(durationTime.seconds)) {\n durationText = durationTime.minutes + \":\" + durationTime.seconds;\n if (!isNaN(durationTime.hours) && durationTime.hours > 0) {\n durationText = durationTime.hours + \":\" + durationText;\n }\n }\n\n return durationText;\n }\n\n /**\n * Return publically accessible methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationTimeElements.js","module.exports = {\"name\":\"amplitudejs\",\"version\":\"5.0.2\",\"description\":\"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs\",\"main\":\"dist/amplitude.js\",\"devDependencies\":{\"babel-core\":\"^6.26.3\",\"babel-loader\":\"^7.1.5\",\"babel-plugin-add-module-exports\":\"0.2.1\",\"babel-polyfill\":\"^6.26.0\",\"babel-preset-es2015\":\"^6.18.0\",\"husky\":\"^1.3.1\",\"jest\":\"^23.6.0\",\"prettier\":\"1.15.1\",\"pretty-quick\":\"^1.11.1\",\"watch\":\"^1.0.2\",\"webpack\":\"^2.7.0\"},\"directories\":{\"doc\":\"docs\"},\"files\":[\"dist\"],\"scripts\":{\"build\":\"node_modules/.bin/webpack\",\"watch\":\"watch 'node_modules/.bin/webpack' dist\",\"prettier\":\"npx pretty-quick\",\"test\":\"jest\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/521dimensions/amplitudejs.git\"},\"keywords\":[\"webaudio\",\"html5\",\"javascript\",\"audio-player\"],\"author\":\"521 Dimensions (https://521dimensions.com)\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/521dimensions/amplitudejs/issues\"},\"homepage\":\"https://github.com/521dimensions/amplitudejs#readme\"}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./package.json\n// module id = 59\n// module chunks = 0 1"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/amplitude.min.js b/dist/amplitude.min.js index 145d08e7..58f653a5 100644 --- a/dist/amplitude.min.js +++ b/dist/amplitude.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Amplitude",[],t):"object"==typeof exports?exports.Amplitude=t():e.Amplitude=t()}(this,function(){return function(e){function t(l){if(a[l])return a[l].exports;var u=a[l]={i:l,l:!1,exports:{}};return e[l].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var a={};return t.m=e,t.c=a,t.i=function(e){return e},t.d=function(e,a,l){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=47)}([function(e,t,a){"use strict";var l=a(59);e.exports={version:l.version,audio:new Audio,active_metadata:{},active_album:"",active_index:0,active_playlist:null,playback_speed:1,callbacks:{},songs:[],playlists:{},start_song:"",starting_playlist:"",starting_playlist_song:"",repeat:!1,repeat_song:!1,shuffle_list:{},shuffle_on:!1,default_album_art:"",default_playlist_art:"",debug:!1,volume:.5,pre_mute_volume:.5,volume_increment:5,volume_decrement:5,soundcloud_client:"",soundcloud_use_art:!1,soundcloud_song_count:0,soundcloud_songs_ready:0,is_touch_moving:!1,buffered:0,bindings:{},continue_next:!0,delay:0,player_state:"stopped",web_audio_api_available:!1,context:null,source:null,analyser:null,visualizations:{available:[],active:[],backup:""},waveforms:{sample_rate:100,built:[]}}},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(5),d=(l(i),a(3)),s=(l(d),a(2)),o=(l(s),a(8)),f=(l(o),a(7)),r=l(f),c=a(4),p=l(c),v=a(16),y=l(v),g=function(){function e(){y.default.stop(),y.default.run(),n.default.active_metadata.live&&s(),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&!n.default.paused&&s();var e=n.default.audio.play();void 0!==e&&e.then(function(e){}).catch(function(e){}),n.default.audio.play(),n.default.audio.playbackRate=n.default.playback_speed}function t(){y.default.stop(),n.default.audio.pause(),n.default.paused=!0,n.default.active_metadata.live&&d()}function a(){y.default.stop(),0!=n.default.audio.currentTime&&(n.default.audio.currentTime=0),n.default.audio.pause(),n.default.active_metadata.live&&d(),r.default.run("stop")}function l(e){n.default.audio.muted=0==e,n.default.volume=e,n.default.audio.volume=e/100}function u(e){n.default.active_metadata.live||(n.default.audio.currentTime=n.default.audio.duration*(e/100))}function i(e){n.default.audio.addEventListener("canplaythrough",function(){n.default.audio.duration>=e&&e>0?n.default.audio.currentTime=e:p.default.writeMessage("Amplitude can't skip to a location greater than the duration of the audio or less than 0")},{once:!0})}function d(){n.default.audio.src="",n.default.audio.load()}function s(){n.default.audio.src=n.default.active_metadata.url,n.default.audio.load()}function o(e){n.default.playback_speed=e,n.default.audio.playbackRate=n.default.playback_speed}return{play:e,pause:t,stop:a,setVolume:l,setSongLocation:u,skipToLocation:i,disconnectStream:d,reconnectStream:s,setPlaybackSpeed:o}}();t.default=g,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){t(),a(),l(),n()}function t(){for(var e=u.default.audio.paused?"paused":"playing",t=document.querySelectorAll(".amplitude-play-pause"),a=0;a0&&void 0!==arguments[0]&&arguments[0],t=null,a={},l=!1;n.default.repeat_song?n.default.shuffle_on?(t=n.default.shuffle_list[n.default.active_index].index,a=n.default.shuffle_list[t]):(t=n.default.active_index,a=n.default.songs[t]):n.default.shuffle_on?(parseInt(n.default.active_index)+11&&void 0!==arguments[1]&&arguments[1],a=null,l={},u=!1;n.default.repeat_song?n.default.playlists[e].shuffle?(a=n.default.playlists[e].active_index,l=n.default.playlists[e].shuffle_list[a]):(a=n.default.playlists[e].active_index,l=n.default.playlists[e].songs[a]):n.default.playlists[e].shuffle?(parseInt(n.default.playlists[e].active_index)+1=0?parseInt(n.default.active_index-1):parseInt(n.default.songs.length-1),t=n.default.shuffle_on?n.default.shuffle_list[e]:n.default.songs[e]),u(t,e),d.default.play(),p.default.sync(),o.default.run("prev"),n.default.repeat_song&&o.default.run("song_repeated")}function l(e){var t=null,a={};n.default.repeat_song?n.default.playlists[e].shuffle?(t=n.default.playlists[e].active_index,a=n.default.playlists[e].shuffle_list[t]):(t=n.default.playlists[e].active_index,a=n.default.playlists[e].songs[t]):(t=parseInt(n.default.playlists[e].active_index)-1>=0?parseInt(n.default.playlists[e].active_index-1):parseInt(n.default.playlists[e].songs.length-1),a=n.default.playlists[e].shuffle?n.default.playlists[e].shuffle_list[t]:n.default.playlists[e].songs[t]),c(e),i(e,a,t),d.default.play(),p.default.sync(),o.default.run("prev"),n.default.repeat_song&&o.default.run("song_repeated")}function u(e,t){s(e),n.default.audio.src=e.url,n.default.active_metadata=e,n.default.active_album=e.album,n.default.active_index=parseInt(t),f()}function i(e,t,a){s(t),n.default.audio.src=t.url,n.default.active_metadata=t,n.default.active_album=t.album,n.default.active_index=null,n.default.playlists[e].active_index=parseInt(a),f()}function s(e){d.default.stop(),p.default.syncToPause(),y.default.resetElements(),m.default.resetElements(),h.default.resetCurrentTimes(),r.default.newAlbum(e)&&o.default.run("album_change")}function f(){A.default.displayMetaData(),M.default.setActive(),h.default.resetDurationTimes(),o.default.run("song_change")}function c(e){n.default.active_playlist!=e&&(o.default.run("playlist_changed"),n.default.active_playlist=e,null!=e&&(n.default.playlists[e].active_index=0))}return{setNext:e,setNextPlaylist:t,setPrevious:a,setPreviousPlaylist:l,changeSong:u,changeSongPlaylist:i,setActivePlaylist:c}}();t.default=P,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e){u.default.debug&&console.log(e)}return{writeMessage:e}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e,t){return u.default.active_playlist!=e||(null==u.default.active_playlist&&null==e?u.default.active_index!=t:u.default.active_playlist==e&&u.default.playlists[e].active_index!=t)}function t(e){return u.default.active_album!=e}function a(e){return u.default.active_playlist!=e}function l(e){return/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(e)}function n(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))}return{newSong:e,newAlbum:t,newPlaylist:a,isURL:l,isInt:n}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){u.default.audio=new Audio,u.default.active_metadata={},u.default.active_album="",u.default.active_index=0,u.default.active_playlist=null,u.default.playback_speed=1,u.default.callbacks={},u.default.songs=[],u.default.playlists={},u.default.start_song="",u.default.starting_playlist="",u.default.starting_playlist_song="",u.default.repeat=!1,u.default.shuffle_list={},u.default.shuffle_on=!1,u.default.default_album_art="",u.default.default_playlist_art="",u.default.debug=!1,u.default.volume=.5,u.default.pre_mute_volume=.5,u.default.volume_increment=5,u.default.volume_decrement=5,u.default.soundcloud_client="",u.default.soundcloud_use_art=!1,u.default.soundcloud_song_count=0,u.default.soundcloud_songs_ready=0,u.default.continue_next=!0}function t(){u.default.audio.paused&&0==u.default.audio.currentTime&&(u.default.player_state="stopped"),u.default.audio.paused&&u.default.audio.currentTime>0&&(u.default.player_state="paused"),u.default.audio.paused||(u.default.player_state="playing")}return{resetConfig:e,setPlayerState:t}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(4),d=l(i),s=function(){function e(){n.default.audio.addEventListener("abort",function(){t("abort")}),n.default.audio.addEventListener("error",function(){t("error")}),n.default.audio.addEventListener("loadeddata",function(){t("loadeddata")}),n.default.audio.addEventListener("loadedmetadata",function(){t("loadedmetadata")}),n.default.audio.addEventListener("loadstart",function(){t("loadstart")}),n.default.audio.addEventListener("pause",function(){t("pause")}),n.default.audio.addEventListener("playing",function(){t("playing")}),n.default.audio.addEventListener("play",function(){t("play")}),n.default.audio.addEventListener("progress",function(){t("progress")}),n.default.audio.addEventListener("ratechange",function(){t("ratechange")}),n.default.audio.addEventListener("seeked",function(){t("seeked")}),n.default.audio.addEventListener("seeking",function(){t("seeking")}),n.default.audio.addEventListener("stalled",function(){t("stalled")}),n.default.audio.addEventListener("suspend",function(){t("suspend")}),n.default.audio.addEventListener("timeupdate",function(){t("timeupdate")}),n.default.audio.addEventListener("volumechange",function(){t("volumechange")}),n.default.audio.addEventListener("waiting",function(){t("waiting")}),n.default.audio.addEventListener("canplay",function(){t("canplay")}),n.default.audio.addEventListener("canplaythrough",function(){t("canplaythrough")}),n.default.audio.addEventListener("durationchange",function(){t("durationchange")}),n.default.audio.addEventListener("ended",function(){t("ended")})}function t(e){if(n.default.callbacks[e]){var t=n.default.callbacks[e];d.default.writeMessage("Running Callback: "+e);try{t()}catch(e){if("CANCEL EVENT"==e.message)throw e;d.default.writeMessage("Callback error: "+e.message)}}}return{initialize:e,run:t}}();t.default=s,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],t=document.querySelectorAll("[data-amplitude-song-info]"),a=0;a=0?(d=d||u.default.default_album_art,t[a].setAttribute("src",d)):(d=d||"",t[a].innerHTML=d)}}}function t(){for(var e=["image_url"],t=document.querySelectorAll("[data-amplitude-playlist-info]"),a=0;a=0?t[a].setAttribute("src",u.default.playlists[n][l]):t[a].innerHTML=u.default.playlists[n][l]:e.indexOf(l)>=0?""!=u.default.default_playlist_art?t[a].setAttribute("src",u.default.default_playlist_art):t[a].setAttribute("src",""):t[a].innerHTML=""}}function a(e,t){for(var a=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],l=document.querySelectorAll('[data-amplitude-song-info][data-amplitude-playlist="'+t+'"]'),u=0;u=0?l[u].setAttribute("src",e[n]):l[u].innerHTML=e[n]:a.indexOf(n)>=0?""!=e.default_album_art?l[u].setAttribute("src",e.default_album_art):l[u].setAttribute("src",""):l[u].innerHTML="")}}function l(){for(var e=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],a=document.querySelectorAll("[data-amplitude-song-info]"),l=0;l=0?(s=s||u.default.default_album_art,a[l].setAttribute("src",s)):a[l].innerHTML=s}if(null!=n&&null!=i){var o=a[l].getAttribute("data-amplitude-song-info");void 0!=u.default.playlists[i].songs[n][o]&&(e.indexOf(o)>=0?a[l].setAttribute("src",u.default.playlists[i].songs[n][o]):a[l].innerHTML=u.default.playlists[i].songs[n][o])}}t()}return{displayMetaData:e,setFirstSongInPlaylist:a,syncMetaData:l,displayPlaylistMetaData:t}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=document.getElementsByClassName("amplitude-repeat"),t=0;t0;a--){d(e,a,Math.floor(Math.random()*u.default.songs.length+1)-1)}u.default.shuffle_list=e}function i(e){for(var t=new Array(u.default.playlists[e].songs.length),a=0;a0;l--){d(t,l,Math.floor(Math.random()*u.default.playlists[e].songs.length+1)-1)}u.default.playlists[e].shuffle_list=t}function d(e,t,a){var l=e[t];e[t]=e[a],e[a]=l}return{setShuffle:e,toggleShuffle:t,setShufflePlaylist:a,toggleShufflePlaylist:l,shuffleSongs:n,shufflePlaylistSongs:i}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e,u,i){t(e),a(e,u),l(e,i),n(e,u)}function t(e){e=isNaN(e)?0:e;for(var t=document.querySelectorAll(".amplitude-song-slider"),a=0;a0&&e.length>0)for(var i=0;i0?Object.keys(n.default.visualizations.available)[0]:null;null!=l&&i(l,e)}}function a(e,t){if(t==n.default.active_playlist){var a=n.default.playlists[n.default.active_playlist].songs[n.default.playlists[n.default.active_playlist].active_index].visualization,l=n.default.playlists[n.default.active_playlist].visualization,u=n.default.visualization;if(void 0!=a&&void 0!=n.default.visualizations.available[a])i(a,e);else if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else if(void 0!=u&&void 0!=n.default.visualizations.available[u])i(u,e);else{var d=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=d&&i(d,e)}}}function l(e,t){if(t==n.default.active_index){var a=n.default.songs[n.default.active_index].visualization,l=n.default.visualization;if(void 0!=a&&void 0!=n.default.visualizations.available[a])i(a,e);else if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else{var u=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=u&&i(u,e)}}}function u(e,t,a){if(t==n.default.active_playlist&&n.default.playlists[t].active_index==a){var l=n.default.playlists[n.default.active_playlist].songs[n.default.playlists[n.default.active_playlist].active_index].visualization,u=n.default.playlists[n.default.active_playlist].visualization,d=n.default.visualization;if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else if(void 0!=u&&void 0!=n.default.visualizations.available[u])i(u,e);else if(void 0!=d&&void 0!=n.default.visualizations.available[d])i(d,e);else{var s=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=s&&i(s,e)}}}function i(e,t){var a=new n.default.visualizations.available[e].object;a.setPreferences(n.default.visualizations.available[e].preferences),a.startVisualization(t),n.default.visualizations.active.push(a)}function d(){for(var e=0;e0)for(var t=0;t3&&void 0!==arguments[3]&&arguments[3];SC.get("/resolve/?url="+e,function(e){e.streamable?null!=t?(n.default.playlists[t].songs[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client,l&&(n.default.playlists[t].shuffle_list[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client),n.default.soundcloud_use_art&&(n.default.playlists[t].songs[a].cover_art_url=e.artwork_url,l&&(n.default.playlists[t].shuffle_list[a].cover_art_url=e.artwork_url)),n.default.playlists[t].songs[a].soundcloud_data=e,l&&(n.default.playlists[t].shuffle_list[a].soundcloud_data=e)):(n.default.songs[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client,l&&(n.default.shuffle_list[a].stream_url,n.default.soundcloud_client),n.default.soundcloud_use_art&&(n.default.songs[a].cover_art_url=e.artwork_url,l&&(n.default.shuffle_list[a].cover_art_url=e.artwork_url)),n.default.songs[a].soundcloud_data=e,l&&(n.default.shuffle_list[a].soundcloud_data=e)):null!=t?AmplitudeHelpers.writeDebugMessage(n.default.playlists[t].songs[a].name+" by "+n.default.playlists[t].songs[a].artist+" is not streamable by the Soundcloud API"):AmplitudeHelpers.writeDebugMessage(n.default.songs[a].name+" by "+n.default.songs[a].artist+" is not streamable by the Soundcloud API")})}function u(e,t){SC.get("/resolve/?url="+e,function(e){e.streamable?(n.default.songs[t].url=e.stream_url+"?client_id="+n.default.soundcloud_client,n.default.soundcloud_use_art&&(n.default.songs[t].cover_art_url=e.artwork_url),n.default.songs[t].soundcloud_data=e):AmplitudeHelpers.writeDebugMessage(n.default.songs[t].name+" by "+n.default.songs[t].artist+" is not streamable by the Soundcloud API"),++n.default.soundcloud_songs_ready==n.default.soundcloud_song_count&&d.default.setConfig(s)})}function i(e){var t=/^https?:\/\/(soundcloud.com|snd.sc)\/(.*)$/;return e.match(t)}var s={};return{loadSoundCloud:e,resolveIndividualStreamableURL:l,isSoundCloudURL:i}}();t.default=s,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=document.getElementsByClassName("amplitude-playback-speed"),t=0;t0))for(var u=0;u0&&C.default.initialize(e.playlists),void 0!=e.start_song&&e.starting_playlist?g.default.isInt(e.start_song)?E.default.changeSong(i.default.songs[e.start_song],e.start_song):v.default.writeMessage("You must enter an integer index for the start song."):E.default.changeSong(i.default.songs[0],0),void 0!=e.shuffle_on&&e.shuffle_on&&(i.default.shuffle_on=!0,_.default.shuffleSongs(),E.default.changeSong(i.default.shuffle_list[0],0)),i.default.continue_next=void 0==e.continue_next||e.continue_next,i.default.playback_speed=void 0!=e.playback_speed?e.playback_speed:1,s.default.setPlaybackSpeed(i.default.playback_speed),i.default.audio.preload=void 0!=e.preload?e.preload:"auto",i.default.callbacks=void 0!=e.callbacks?e.callbacks:{},i.default.bindings=void 0!=e.bindings?e.bindings:{},i.default.volume=void 0!=e.volume?e.volume:50,i.default.delay=void 0!=e.delay?e.delay:0,i.default.volume_increment=void 0!=e.volume_increment?e.volume_increment:5,i.default.volume_decrement=void 0!=e.volume_decrement?e.volume_decrement:5,s.default.setVolume(i.default.volume),l(e),n(),void 0!=e.starting_playlist&&""!=e.starting_playlist&&(i.default.active_playlist=e.starting_playlist,void 0!=e.starting_playlist_song&&""!=e.starting_playlist_song?void 0!=u(e.playlists[e.starting_playlist].songs[parseInt(e.starting_playlist_song)])?E.default.changeSongPlaylist(i.default.active_playlist,e.playlists[e.starting_playlist].songs[parseInt(e.starting_playlist_song)],parseInt(e.starting_playlist_song)):(E.default.changeSongPlaylist(i.default.active_playlist,e.playlists[e.starting_playlist].songs[0],0),v.default.writeMessage("The index of "+e.starting_playlist_song+" does not exist in the playlist "+e.starting_playlist)):E.default.changeSong(i.default.active_playlist,e.playlists[e.starting_playlist].songs[0],0),V.default.sync()),T.default.run("initialized")}function l(e){void 0!=e.default_album_art?i.default.default_album_art=e.default_album_art:i.default.default_album_art="",void 0!=e.default_playlist_art?i.default.default_playlist_art=e.default_playlist_art:i.default.default_playlist_art=""}function n(){I.default.syncMain(),q.default.setMuted(0==i.default.volume),H.default.sync(),G.default.sync(),D.default.resetCurrentTimes(),V.default.syncToPause(),F.default.syncMetaData(),X.default.syncRepeatSong()}function d(e){var t=0,a=void 0;for(a in e)e.hasOwnProperty(a)&&t++;return v.default.writeMessage("You have "+t+" playlist(s) in your config"),t}function o(){for(var e=0;e0)for(var t=0;tp&&(p=y),yn[2*o])&&(n[2*o]=p),(0===i||c0}var r="",c=u.default.waveforms.sample_rate,p="";return{init:e,build:t,determineIfUsingWaveforms:f}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){var e={},t=(Math.floor(u.default.audio.currentTime%60)<10?"0":"")+Math.floor(u.default.audio.currentTime%60),a=Math.floor(u.default.audio.currentTime/60),l="00";return a<10&&(a="0"+a),a>=60&&(l=Math.floor(a/60),(a%=60)<10&&(a="0"+a)),e.seconds=t,e.minutes=a,e.hours=l,e}function t(){var e={},t=(Math.floor(u.default.audio.duration%60)<10?"0":"")+Math.floor(u.default.audio.duration%60),a=Math.floor(u.default.audio.duration/60),l="00";return a<10&&(a="0"+a),a>=60&&(l=Math.floor(a/60),(a%=60)<10&&(a="0"+a)),e.seconds=isNaN(t)?"00":t,e.minutes=isNaN(a)?"00":a,e.hours=isNaN(l)?"00":l.toString(),e}function a(){return u.default.audio.currentTime/u.default.audio.duration*100}function l(e){u.default.active_metadata.live||isFinite(e)&&(u.default.audio.currentTime=e)}return{computeCurrentTimes:e,computeSongDuration:t,computeSongCompletionPercentage:a,setCurrentTime:l}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){t(),a(),l(),n()}function t(){for(var e=document.getElementsByClassName("amplitude-buffered-progress"),t=0;t0||navigator.userAgent.match(/Trident.*rv\:11\./)?(a[l].removeEventListener("change",k.default.handle),a[l].addEventListener("change",k.default.handle)):(a[l].removeEventListener("input",k.default.handle),a[l].addEventListener("input",k.default.handle))}function x(){for(var e=window.navigator.userAgent,t=e.indexOf("MSIE "),a=document.getElementsByClassName("amplitude-volume-slider"),l=0;l0||navigator.userAgent.match(/Trident.*rv\:11\./)?(a[l].removeEventListener("change",O.default.handle),a[l].addEventListener("change",O.default.handle)):(a[l].removeEventListener("input",O.default.handle),a[l].addEventListener("input",O.default.handle))}function P(){for(var e=document.getElementsByClassName("amplitude-next"),t=0;t=0){var e=n.default.audio.buffered.end(n.default.audio.buffered.length-1),t=n.default.audio.duration;n.default.buffered=e/t*100}d.default.sync()}return{handle:e}}();t.default=s,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(12),d=l(i),s=a(9),o=l(s),f=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist");null==e&&t(),null!=e&&a(e)}}function t(){d.default.setRepeat(!n.default.repeat),o.default.syncRepeat()}function a(e){d.default.setRepeatPlaylist(!n.default.playlists[e].repeat,e),o.default.syncRepeatPlaylist(e)}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(12),d=l(i),s=a(9),o=l(s),f=function(){function e(){n.default.is_touch_moving||(d.default.setRepeatSong(!n.default.repeat_song),o.default.syncRepeatSong())}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(13),d=l(i),s=a(19),o=l(s),f=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist");null==e?t():a(e)}}function t(){d.default.toggleShuffle(),o.default.syncMain(n.default.shuffle_on)}function a(e){d.default.toggleShufflePlaylist(e),o.default.syncPlaylist(e)}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(4),d=l(i),s=a(3),o=l(s),f=a(5),r=l(f),c=a(1),p=l(c),v=a(2),y=l(v),g=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist"),l=this.getAttribute("data-amplitude-song-index"),u=this.getAttribute("data-amplitude-location");null==u&&d.default.writeMessage("You must add an 'data-amplitude-location' attribute in seconds to your 'amplitude-skip-to' element."),null==l&&d.default.writeMessage("You must add an 'data-amplitude-song-index' attribute to your 'amplitude-skip-to' element."),null!=u&&null!=l&&(null==e?t(parseInt(l),parseInt(u)):a(e,parseInt(l),parseInt(u)))}}function t(e,t){o.default.changeSong(n.default.songs[e],e),p.default.play(),y.default.syncGlobal(),y.default.syncSong(),p.default.skipToLocation(t)}function a(e,t,a){r.default.newPlaylist(e)&&o.default.setActivePlaylist(e),o.default.changeSongPlaylist(e,n.default.playlists[e].songs[t],t),p.default.play(),y.default.syncGlobal(),y.default.syncPlaylist(),y.default.syncSong(),p.default.skipToLocation(a)}return{handle:e}}();t.default=g,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(23),d=l(i),s=a(14),o=l(s),f=function(){function e(){var e=this.value,i=n.default.audio.duration*(e/100),d=this.getAttribute("data-amplitude-playlist"),s=this.getAttribute("data-amplitude-song-index");null==d&&null==s&&t(i,e),null!=d&&null==s&&a(i,e,d),null==d&&null!=s&&l(i,e,s),null!=d&&null!=s&&u(i,e,d,s)}function t(e,t){n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,n.default.active_playlist,n.default.active_index))}function a(e,t,a){n.default.active_playlist==a&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,a,n.default.active_index)))}function l(e,t,a){n.default.active_index==a&&null==n.default.active_playlist&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,n.default.active_playlist,a)))}function u(e,t,a,l){n.default.playlists[a].active_index==l&&n.default.active_playlist==a&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,a,l)))}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(6),d=l(i),s=a(2),o=l(s),f=a(1),r=l(f),c=function(){function e(){n.default.is_touch_moving||(o.default.syncToPause(),r.default.stop(),d.default.setPlayerState())}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(24),d=l(i),s=a(15),o=l(s),f=a(14),r=l(f),c=a(20),p=l(c),v=a(23),y=l(v),g=a(7),m=(l(g),function(){function e(){t(),d.default.sync(),a(),l()}function t(){if(n.default.audio.buffered.length-1>=0){var e=n.default.audio.buffered.end(n.default.audio.buffered.length-1),t=n.default.audio.duration;n.default.buffered=e/t*100}}function a(){if(!n.default.active_metadata.live){var e=y.default.computeCurrentTimes(),t=y.default.computeSongCompletionPercentage(),a=y.default.computeSongDuration();o.default.syncCurrentTimes(e),r.default.sync(t,n.default.active_playlist,n.default.active_index),p.default.sync(t),o.default.syncDurationTimes(e,a)}}function l(){var e=Math.floor(n.default.audio.currentTime);if(void 0!=n.default.active_metadata.time_callbacks&&void 0!=n.default.active_metadata.time_callbacks[e])n.default.active_metadata.time_callbacks[e].run||(n.default.active_metadata.time_callbacks[e].run=!0,n.default.active_metadata.time_callbacks[e]());else for(var t in n.default.active_metadata.time_callbacks)n.default.active_metadata.time_callbacks.hasOwnProperty(t)&&(n.default.active_metadata.time_callbacks[t].run=!1)}return{handle:e}}());t.default=m,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){if(!n.default.is_touch_moving){var e=null;e=n.default.volume-n.default.volume_increment>0?n.default.volume-n.default.volume_increment:0,d.default.setVolume(e),o.default.setMuted(0==n.default.volume),r.default.sync()}}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){d.default.setVolume(this.value),o.default.setMuted(0==n.default.volume),r.default.sync()}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){if(!n.default.is_touch_moving){var e=null;e=n.default.volume+n.default.volume_increment<=100?n.default.volume+n.default.volume_increment:100,d.default.setVolume(e),o.default.setMuted(0==n.default.volume),r.default.sync()}}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){var e=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext;e?(u.default.context=new e,u.default.analyser=u.default.context.createAnalyser(),u.default.audio.crossOrigin="anonymous",u.default.source=u.default.context.createMediaElementSource(u.default.audio),u.default.source.connect(u.default.analyser),u.default.analyser.connect(u.default.context.destination)):AmplitudeHelpers.writeDebugMessage("Web Audio API is unavailable! We will set any of your visualizations with your back up definition!")}function t(){var e=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext;return u.default.web_audio_api_available=!1,e?(u.default.web_audio_api_available=!0,!0):(u.default.web_audio_api_available=!1,!1)}function a(){var e=document.querySelectorAll(".amplitude-wave-form"),t=document.querySelectorAll(".amplitude-visualization");return e.length>0||t.length>0}return{configureWebAudioAPI:e,webAudioAPIAvailable:t,determineUsingAnyFX:a}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(21),n=l(u),i=a(0),d=l(i),s=a(1),o=l(s),f=a(13),r=l(f),c=a(6),p=l(c),v=a(3),y=l(v),g=a(12),m=l(g),_=a(5),h=l(_),b=a(16),A=l(b),x=a(19),M=l(x),P=a(9),S=l(P),L=a(14),w=l(L),E=a(20),k=l(E),T=a(15),O=l(T),C=a(2),j=l(C),I=a(8),N=l(I),q=a(18),z=l(q),H=a(4),B=l(H),D=a(17),R=l(D),V=function(){function e(e){n.default.initialize(e)}function t(){return d.default}function a(){n.default.rebindDisplay()}function l(){return d.default.active_playlist}function u(){return d.default.playback_speed}function i(e){o.default.setPlaybackSpeed(e),z.default.sync()}function s(){return d.default.repeat}function f(e){return d.default.playlists[e].repeat}function c(){return d.default.shuffle_on}function v(e){return d.default.playlists[e].shuffle}function g(e){r.default.setShuffle(e),M.default.syncMain()}function _(e,t){r.default.setShufflePlaylist(e,t),M.default.syncMain(),M.default.syncPlaylist(e)}function b(e){m.default.setRepeat(e),S.default.syncRepeat()}function x(e,t){m.default.setRepeatPlaylist(t,e),S.default.syncRepeatPlaylist(e)}function P(e){d.default.is_touch_moving||(m.default.setRepeatSong(!d.default.repeat_song),S.default.syncRepeatSong())}function L(){return d.default.default_album_art}function E(){return d.default.default_playlist_art}function T(e){d.default.default_album_art=e}function C(e){d.default.default_plalist_art=e}function I(){return d.default.audio.currentTime/d.default.audio.duration*100}function q(){return d.default.audio.currentTime}function H(){return d.default.audio.duration}function D(e){"number"==typeof e&&e>0&&e<100&&(d.default.audio.currentTime=d.default.audio.duration*(e/100))}function V(e){d.default.debug=e}function U(){return d.default.active_metadata}function F(){return d.default.playlists[d.default.active_playlist]}function W(e){return d.default.songs[e]}function G(e,t){return d.default.playlists[e].songs[t]}function Y(e){return void 0==d.default.songs&&(d.default.songs=[]),d.default.songs.push(e),d.default.shuffle_on&&d.default.shuffle_list.push(e),R.default.isSoundCloudURL(e.url)&&R.default.resolveIndividualStreamableURL(e.url,null,d.default.songs.length-1,d.default.shuffle_on),d.default.songs.length-1}function X(e,t){return void 0!=d.default.playlists[t]?(d.default.playlists[t].songs.push(e),d.default.playlists[t].shuffle&&d.default.playlists[t].shuffle_list.push(e),R.default.isSoundCloudURL(e.url)&&R.default.resolveIndividualStreamableURL(e.url,t,d.default.playlists[t].songs.length-1,d.default.playlists[t].shuffle),d.default.playlists[t].songs.length-1):(B.default.writeMessage("Playlist doesn't exist!"),null)}function J(e,t,a){if(void 0==d.default.playlists[e]){d.default.playlists[e]={};var l=["repeat","shuffle","shuffle_list","songs","src"];for(var u in t)l.indexOf(u)<0&&(d.default.playlists[e][u]=t[u]);return d.default.playlists[e].songs=a,d.default.playlists[e].active_index=null,d.default.playlists[e].repeat=!1,d.default.playlists[e].shuffle=!1,d.default.playlists[e].shuffle_list=[],d.default.playlists[e]}return B.default.writeMessage("A playlist already exists with that key!"),null}function $(e){d.default.songs.splice(e,1)}function Q(e,t){void 0!=d.default.playlists[t]&&d.default.playlists[t].songs.splice(e,1)}function K(e){e.url?(d.default.audio.src=e.url,d.default.active_metadata=e,d.default.active_album=e.album):B.default.writeMessage("The song needs to have a URL!"),o.default.play(),j.default.sync(),N.default.displayMetaData(),w.default.resetElements(),k.default.resetElements(),O.default.resetCurrentTimes(),O.default.resetDurationTimes(),p.default.setPlayerState()}function Z(e){o.default.stop(),h.default.newPlaylist(null)&&(y.default.setActivePlaylist(null),y.default.changeSong(d.default.songs[e],e)),h.default.newSong(null,e)&&y.default.changeSong(d.default.songs[e],e),o.default.play(),p.default.setPlayerState(),j.default.sync()}function ee(e,t){o.default.stop(),h.default.newPlaylist(t)&&(y.default.setActivePlaylist(t),y.default.changeSongPlaylist(t,d.default.playlists[t].songs[e],e)),h.default.newSong(t,e)&&y.default.changeSongPlaylist(t,d.default.playlists[t].songs[e],e),j.default.sync(),o.default.play(),p.default.setPlayerState()}function te(){o.default.play(),p.default.setPlayerState()}function ae(){o.default.pause(),p.default.setPlayerState()}function le(){return d.default.audio}function ue(){return d.default.analyser}function ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""==e||null==e?null==d.default.active_playlist||""==d.default.active_playlist?y.default.setNext():y.default.setNextPlaylist(d.default.active_playlist):y.default.setNextPlaylist(e)}function ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""==e||null==e?null==d.default.active_playlist||""==d.default.active_playlist?y.default.setPrevious():y.default.setPreviousPlaylist(d.default.active_playlist):y.default.setPreviousPlaylist(e)}function de(){return d.default.songs}function se(e){return d.default.playlists[e].songs}function oe(){return d.default.shuffle_on?d.default.shuffle_list:d.default.songs}function fe(e){return d.default.playlists[e].shuffle?d.default.playlists[e].shuffle_list:d.default.playlists[e].songs}function re(){return parseInt(d.default.active_index)}function ce(){return d.default.version}function pe(){return d.default.buffered}function ve(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e=parseInt(e),null!=a?(h.default.newPlaylist(a)&&y.default.setActivePlaylist(a),y.default.changeSongPlaylist(a,d.default.playlists[a].songs[t],t),o.default.play(),j.default.syncGlobal(),j.default.syncPlaylist(),j.default.syncSong(),o.default.skipToLocation(e)):(y.default.changeSong(d.default.songs[t],t),o.default.play(),j.default.syncGlobal(),j.default.syncSong(),o.default.skipToLocation(e))}function ye(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(""!=a&&null!=a&&void 0!=d.default.playlists[a])for(var l in t)t.hasOwnProperty(l)&&"url"!=l&&"URL"!=l&&"live"!=l&&"LIVE"!=l&&(d.default.playlists[a].songs[e][l]=t[l]);else for(var l in t)t.hasOwnProperty(l)&&"url"!=l&&"URL"!=l&&"live"!=l&&"LIVE"!=l&&(d.default.songs[e][l]=t[l]);N.default.displayMetaData(),N.default.syncMetaData()}function ge(e,t){if(void 0!=d.default.playlists[e]){var a=["repeat","shuffle","shuffle_list","songs","src"];for(var l in t)t.hasOwnProperty(l)&&a.indexOf(l)<0&&(d.default.playlists[e][l]=t[l]);N.default.displayPlaylistMetaData()}else B.default.writeMessage("You must provide a valid playlist key!")}function me(e){d.default.delay=e}function _e(){return d.default.delay}function he(){return d.default.player_state}function be(e,t){A.default.register(e,t)}function Ae(e,t){void 0!=d.default.playlists[e]?void 0!=d.default.visualizations.available[t]?d.default.playlists[e].visualization=t:B.default.writeMessage("A visualization does not exist for the key provided."):B.default.writeMessage("The playlist for the key provided does not exist")}function xe(e,t){d.default.songs[e]?void 0!=d.default.visualizations.available[t]?d.default.songs[e].visualization=t:B.default.writeMessage("A visualization does not exist for the key provided."):B.default.writeMessage("A song at that index is undefined")}function Me(e,t,a){void 0!=d.default.playlists[e].songs[t]?void 0!=d.default.visualizations.available[a]?d.default.playlists[e].songs[t].visualization=a:B.default.writeMessage("A visualization does not exist for the key provided."):B.default.writeMessage("The song in the playlist at that key is not defined")}function Pe(e){void 0!=d.default.visualizations.available[e]?d.default.visualization=e:B.default.writeMessage("A visualization does not exist for the key provided.")}function Se(e){o.default.setVolume(e)}function Le(){return d.default.volume}return{init:e,getConfig:t,bindNewElements:a,getActivePlaylist:l,getPlaybackSpeed:u,setPlaybackSpeed:i,getRepeat:s,getRepeatPlaylist:f,getShuffle:c,getShufflePlaylist:v,setShuffle:g,setShufflePlaylist:_,setRepeat:b,setRepeatSong:P,setRepeatPlaylist:x,getDefaultAlbumArt:L,setDefaultAlbumArt:T,getDefaultPlaylistArt:E,setDefaultPlaylistArt:C,getSongPlayedPercentage:I,setSongPlayedPercentage:D,getSongPlayedSeconds:q,getSongDuration:H,setDebug:V,getActiveSongMetadata:U,getActivePlaylistMetadata:F,getSongAtIndex:W,getSongAtPlaylistIndex:G,addSong:Y,addSongToPlaylist:X,removeSong:$,removeSongFromPlaylist:Q,playNow:K,playSongAtIndex:Z,playPlaylistSongAtIndex:ee,play:te,pause:ae,getAudio:le,getAnalyser:ue,next:ne,prev:ie,getSongs:de,getSongsInPlaylist:se,getSongsState:oe,getSongsStatePlaylist:fe,getActiveIndex:re,getVersion:ce,getBuffered:pe,skipTo:ve,setSongMetaData:ye,setPlaylistMetaData:ge,setDelay:me,getDelay:_e,getPlayerState:he,addPlaylist:J,registerVisualization:be,setPlaylistVisualization:Ae,setSongVisualization:xe,setSongInPlaylistVisualization:Me,setGlobalVisualization:Pe,getVolume:Le,setVolume:Se}}();t.default=V,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(4),d=l(i),s=a(5),o=l(s),f=a(8),r=l(f),c=a(17),p=l(c),v=function(){function e(e){n.default.playlists=e,a(),l(),t(),u(),i(),s(),f()}function t(){for(var e in n.default.playlists)n.default.playlists[e].active_index=null}function a(){for(var e in n.default.playlists)if(n.default.playlists.hasOwnProperty(e)&&n.default.playlists[e].songs)for(var t=0;t0&&(a=e.hours+":"+a);for(var l=0;l0&&(a=e.hours+":"+a);for(var l=0;l0&&(a=e.hours+":"+a);for(var l=0;l0&&(l=e.hours+":"+l);for(var n=0;n0&&(a=i+":"+a)}return a}return{sync:e,resetTimes:i}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e){t(e),a(e),l(e),n(e)}function t(e){for(var t=document.querySelectorAll(".amplitude-duration-hours"),a=0;a0&&(t=e.hours+":"+t)),t}return{sync:e,resetTimes:i}}();t.default=n,e.exports=t.default},function(e,t){e.exports={name:"amplitudejs",version:"5.0.1",description:"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs",main:"dist/amplitude.js",devDependencies:{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-add-module-exports":"0.2.1","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.18.0",husky:"^1.3.1",jest:"^23.6.0",prettier:"1.15.1","pretty-quick":"^1.11.1",watch:"^1.0.2",webpack:"^2.7.0"},directories:{doc:"docs"},files:["dist"],scripts:{build:"node_modules/.bin/webpack",watch:"watch 'node_modules/.bin/webpack' dist",prettier:"npx pretty-quick",test:"jest"},repository:{type:"git",url:"git+https://github.com/521dimensions/amplitudejs.git"},keywords:["webaudio","html5","javascript","audio-player"],author:"521 Dimensions (https://521dimensions.com)",license:"MIT",bugs:{url:"https://github.com/521dimensions/amplitudejs/issues"},homepage:"https://github.com/521dimensions/amplitudejs#readme"}}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Amplitude",[],t):"object"==typeof exports?exports.Amplitude=t():e.Amplitude=t()}(this,function(){return function(e){function t(l){if(a[l])return a[l].exports;var u=a[l]={i:l,l:!1,exports:{}};return e[l].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var a={};return t.m=e,t.c=a,t.i=function(e){return e},t.d=function(e,a,l){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=47)}([function(e,t,a){"use strict";var l=a(59);e.exports={version:l.version,audio:new Audio,active_metadata:{},active_album:"",active_index:0,active_playlist:null,playback_speed:1,callbacks:{},songs:[],playlists:{},start_song:"",starting_playlist:"",starting_playlist_song:"",repeat:!1,repeat_song:!1,shuffle_list:{},shuffle_on:!1,default_album_art:"",default_playlist_art:"",debug:!1,volume:.5,pre_mute_volume:.5,volume_increment:5,volume_decrement:5,soundcloud_client:"",soundcloud_use_art:!1,soundcloud_song_count:0,soundcloud_songs_ready:0,is_touch_moving:!1,buffered:0,bindings:{},continue_next:!0,delay:0,player_state:"stopped",web_audio_api_available:!1,context:null,source:null,analyser:null,visualizations:{available:[],active:[],backup:""},waveforms:{sample_rate:100,built:[]}}},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(5),d=(l(i),a(3)),s=(l(d),a(2)),o=(l(s),a(8)),f=(l(o),a(7)),r=l(f),c=a(4),p=l(c),v=a(16),y=l(v),g=function(){function e(){y.default.stop(),y.default.run(),n.default.active_metadata.live&&s(),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&!n.default.paused&&s();var e=n.default.audio.play();void 0!==e&&e.then(function(e){}).catch(function(e){}),n.default.audio.play(),n.default.audio.playbackRate=n.default.playback_speed}function t(){y.default.stop(),n.default.audio.pause(),n.default.paused=!0,n.default.active_metadata.live&&d()}function a(){y.default.stop(),0!=n.default.audio.currentTime&&(n.default.audio.currentTime=0),n.default.audio.pause(),n.default.active_metadata.live&&d(),r.default.run("stop")}function l(e){n.default.audio.muted=0==e,n.default.volume=e,n.default.audio.volume=e/100}function u(e){n.default.active_metadata.live||(n.default.audio.currentTime=n.default.audio.duration*(e/100))}function i(e){n.default.audio.addEventListener("canplaythrough",function(){n.default.audio.duration>=e&&e>0?n.default.audio.currentTime=e:p.default.writeMessage("Amplitude can't skip to a location greater than the duration of the audio or less than 0")},{once:!0})}function d(){n.default.audio.src="",n.default.audio.load()}function s(){n.default.audio.src=n.default.active_metadata.url,n.default.audio.load()}function o(e){n.default.playback_speed=e,n.default.audio.playbackRate=n.default.playback_speed}return{play:e,pause:t,stop:a,setVolume:l,setSongLocation:u,skipToLocation:i,disconnectStream:d,reconnectStream:s,setPlaybackSpeed:o}}();t.default=g,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){t(),a(),l(),n()}function t(){for(var e=u.default.audio.paused?"paused":"playing",t=document.querySelectorAll(".amplitude-play-pause"),a=0;a0&&void 0!==arguments[0]&&arguments[0],t=null,a={},l=!1;n.default.repeat_song?n.default.shuffle_on?(t=n.default.shuffle_list[n.default.active_index].index,a=n.default.shuffle_list[t]):(t=n.default.active_index,a=n.default.songs[t]):n.default.shuffle_on?(parseInt(n.default.active_index)+11&&void 0!==arguments[1]&&arguments[1],a=null,l={},u=!1;n.default.repeat_song?n.default.playlists[e].shuffle?(a=n.default.playlists[e].active_index,l=n.default.playlists[e].shuffle_list[a]):(a=n.default.playlists[e].active_index,l=n.default.playlists[e].songs[a]):n.default.playlists[e].shuffle?(parseInt(n.default.playlists[e].active_index)+1=0?parseInt(n.default.active_index-1):parseInt(n.default.songs.length-1),t=n.default.shuffle_on?n.default.shuffle_list[e]:n.default.songs[e]),u(t,e),d.default.play(),p.default.sync(),o.default.run("prev"),n.default.repeat_song&&o.default.run("song_repeated")}function l(e){var t=null,a={};n.default.repeat_song?n.default.playlists[e].shuffle?(t=n.default.playlists[e].active_index,a=n.default.playlists[e].shuffle_list[t]):(t=n.default.playlists[e].active_index,a=n.default.playlists[e].songs[t]):(t=parseInt(n.default.playlists[e].active_index)-1>=0?parseInt(n.default.playlists[e].active_index-1):parseInt(n.default.playlists[e].songs.length-1),a=n.default.playlists[e].shuffle?n.default.playlists[e].shuffle_list[t]:n.default.playlists[e].songs[t]),c(e),i(e,a,t),d.default.play(),p.default.sync(),o.default.run("prev"),n.default.repeat_song&&o.default.run("song_repeated")}function u(e,t){s(e),n.default.audio.src=e.url,n.default.active_metadata=e,n.default.active_album=e.album,n.default.active_index=parseInt(t),f()}function i(e,t,a){s(t),n.default.audio.src=t.url,n.default.active_metadata=t,n.default.active_album=t.album,n.default.active_index=null,n.default.playlists[e].active_index=parseInt(a),f()}function s(e){d.default.stop(),p.default.syncToPause(),y.default.resetElements(),m.default.resetElements(),h.default.resetCurrentTimes(),r.default.newAlbum(e)&&o.default.run("album_change")}function f(){A.default.displayMetaData(),M.default.setActive(),h.default.resetDurationTimes(),o.default.run("song_change")}function c(e){n.default.active_playlist!=e&&(o.default.run("playlist_changed"),n.default.active_playlist=e,null!=e&&(n.default.playlists[e].active_index=0))}return{setNext:e,setNextPlaylist:t,setPrevious:a,setPreviousPlaylist:l,changeSong:u,changeSongPlaylist:i,setActivePlaylist:c}}();t.default=P,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e){u.default.debug&&console.log(e)}return{writeMessage:e}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e,t){return u.default.active_playlist!=e||(null==u.default.active_playlist&&null==e?u.default.active_index!=t:u.default.active_playlist==e&&u.default.playlists[e].active_index!=t)}function t(e){return u.default.active_album!=e}function a(e){return u.default.active_playlist!=e}function l(e){return/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(e)}function n(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))}return{newSong:e,newAlbum:t,newPlaylist:a,isURL:l,isInt:n}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){u.default.audio=new Audio,u.default.active_metadata={},u.default.active_album="",u.default.active_index=0,u.default.active_playlist=null,u.default.playback_speed=1,u.default.callbacks={},u.default.songs=[],u.default.playlists={},u.default.start_song="",u.default.starting_playlist="",u.default.starting_playlist_song="",u.default.repeat=!1,u.default.shuffle_list={},u.default.shuffle_on=!1,u.default.default_album_art="",u.default.default_playlist_art="",u.default.debug=!1,u.default.volume=.5,u.default.pre_mute_volume=.5,u.default.volume_increment=5,u.default.volume_decrement=5,u.default.soundcloud_client="",u.default.soundcloud_use_art=!1,u.default.soundcloud_song_count=0,u.default.soundcloud_songs_ready=0,u.default.continue_next=!0}function t(){u.default.audio.paused&&0==u.default.audio.currentTime&&(u.default.player_state="stopped"),u.default.audio.paused&&u.default.audio.currentTime>0&&(u.default.player_state="paused"),u.default.audio.paused||(u.default.player_state="playing")}return{resetConfig:e,setPlayerState:t}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(4),d=l(i),s=function(){function e(){n.default.audio.addEventListener("abort",function(){t("abort")}),n.default.audio.addEventListener("error",function(){t("error")}),n.default.audio.addEventListener("loadeddata",function(){t("loadeddata")}),n.default.audio.addEventListener("loadedmetadata",function(){t("loadedmetadata")}),n.default.audio.addEventListener("loadstart",function(){t("loadstart")}),n.default.audio.addEventListener("pause",function(){t("pause")}),n.default.audio.addEventListener("playing",function(){t("playing")}),n.default.audio.addEventListener("play",function(){t("play")}),n.default.audio.addEventListener("progress",function(){t("progress")}),n.default.audio.addEventListener("ratechange",function(){t("ratechange")}),n.default.audio.addEventListener("seeked",function(){t("seeked")}),n.default.audio.addEventListener("seeking",function(){t("seeking")}),n.default.audio.addEventListener("stalled",function(){t("stalled")}),n.default.audio.addEventListener("suspend",function(){t("suspend")}),n.default.audio.addEventListener("timeupdate",function(){t("timeupdate")}),n.default.audio.addEventListener("volumechange",function(){t("volumechange")}),n.default.audio.addEventListener("waiting",function(){t("waiting")}),n.default.audio.addEventListener("canplay",function(){t("canplay")}),n.default.audio.addEventListener("canplaythrough",function(){t("canplaythrough")}),n.default.audio.addEventListener("durationchange",function(){t("durationchange")}),n.default.audio.addEventListener("ended",function(){t("ended")})}function t(e){if(n.default.callbacks[e]){var t=n.default.callbacks[e];d.default.writeMessage("Running Callback: "+e);try{t()}catch(e){if("CANCEL EVENT"==e.message)throw e;d.default.writeMessage("Callback error: "+e.message)}}}return{initialize:e,run:t}}();t.default=s,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],t=document.querySelectorAll("[data-amplitude-song-info]"),a=0;a=0?(d=d||u.default.default_album_art,t[a].setAttribute("src",d)):(d=d||"",t[a].innerHTML=d)}}}function t(){for(var e=["image_url"],t=document.querySelectorAll("[data-amplitude-playlist-info]"),a=0;a=0?t[a].setAttribute("src",u.default.playlists[n][l]):t[a].innerHTML=u.default.playlists[n][l]:e.indexOf(l)>=0?""!=u.default.default_playlist_art?t[a].setAttribute("src",u.default.default_playlist_art):t[a].setAttribute("src",""):t[a].innerHTML=""}}function a(e,t){for(var a=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],l=document.querySelectorAll('[data-amplitude-song-info][data-amplitude-playlist="'+t+'"]'),u=0;u=0?l[u].setAttribute("src",e[n]):l[u].innerHTML=e[n]:a.indexOf(n)>=0?""!=e.default_album_art?l[u].setAttribute("src",e.default_album_art):l[u].setAttribute("src",""):l[u].innerHTML="")}}function l(){for(var e=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],a=document.querySelectorAll("[data-amplitude-song-info]"),l=0;l=0?(s=s||u.default.default_album_art,a[l].setAttribute("src",s)):a[l].innerHTML=s}if(null!=n&&null!=i){var o=a[l].getAttribute("data-amplitude-song-info");void 0!=u.default.playlists[i].songs[n][o]&&(e.indexOf(o)>=0?a[l].setAttribute("src",u.default.playlists[i].songs[n][o]):a[l].innerHTML=u.default.playlists[i].songs[n][o])}}t()}return{displayMetaData:e,setFirstSongInPlaylist:a,syncMetaData:l,displayPlaylistMetaData:t}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=document.getElementsByClassName("amplitude-repeat"),t=0;t0;a--){d(e,a,Math.floor(Math.random()*u.default.songs.length+1)-1)}u.default.shuffle_list=e}function i(e){for(var t=new Array(u.default.playlists[e].songs.length),a=0;a0;l--){d(t,l,Math.floor(Math.random()*u.default.playlists[e].songs.length+1)-1)}u.default.playlists[e].shuffle_list=t}function d(e,t,a){var l=e[t];e[t]=e[a],e[a]=l}return{setShuffle:e,toggleShuffle:t,setShufflePlaylist:a,toggleShufflePlaylist:l,shuffleSongs:n,shufflePlaylistSongs:i}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e,u,i){t(e),a(e,u),l(e,i),n(e,u)}function t(e){e=isNaN(e)?0:e;for(var t=document.querySelectorAll(".amplitude-song-slider"),a=0;a0&&e.length>0)for(var i=0;i0?Object.keys(n.default.visualizations.available)[0]:null;null!=l&&i(l,e)}}function a(e,t){if(t==n.default.active_playlist){var a=n.default.playlists[n.default.active_playlist].songs[n.default.playlists[n.default.active_playlist].active_index].visualization,l=n.default.playlists[n.default.active_playlist].visualization,u=n.default.visualization;if(void 0!=a&&void 0!=n.default.visualizations.available[a])i(a,e);else if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else if(void 0!=u&&void 0!=n.default.visualizations.available[u])i(u,e);else{var d=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=d&&i(d,e)}}}function l(e,t){if(t==n.default.active_index){var a=n.default.songs[n.default.active_index].visualization,l=n.default.visualization;if(void 0!=a&&void 0!=n.default.visualizations.available[a])i(a,e);else if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else{var u=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=u&&i(u,e)}}}function u(e,t,a){if(t==n.default.active_playlist&&n.default.playlists[t].active_index==a){var l=n.default.playlists[n.default.active_playlist].songs[n.default.playlists[n.default.active_playlist].active_index].visualization,u=n.default.playlists[n.default.active_playlist].visualization,d=n.default.visualization;if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else if(void 0!=u&&void 0!=n.default.visualizations.available[u])i(u,e);else if(void 0!=d&&void 0!=n.default.visualizations.available[d])i(d,e);else{var s=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=s&&i(s,e)}}}function i(e,t){var a=new n.default.visualizations.available[e].object;a.setPreferences(n.default.visualizations.available[e].preferences),a.startVisualization(t),n.default.visualizations.active.push(a)}function d(){for(var e=0;e0)for(var t=0;t3&&void 0!==arguments[3]&&arguments[3];SC.get("/resolve/?url="+e,function(e){e.streamable?null!=t?(n.default.playlists[t].songs[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client,l&&(n.default.playlists[t].shuffle_list[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client),n.default.soundcloud_use_art&&(n.default.playlists[t].songs[a].cover_art_url=e.artwork_url,l&&(n.default.playlists[t].shuffle_list[a].cover_art_url=e.artwork_url)),n.default.playlists[t].songs[a].soundcloud_data=e,l&&(n.default.playlists[t].shuffle_list[a].soundcloud_data=e)):(n.default.songs[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client,l&&(n.default.shuffle_list[a].stream_url,n.default.soundcloud_client),n.default.soundcloud_use_art&&(n.default.songs[a].cover_art_url=e.artwork_url,l&&(n.default.shuffle_list[a].cover_art_url=e.artwork_url)),n.default.songs[a].soundcloud_data=e,l&&(n.default.shuffle_list[a].soundcloud_data=e)):null!=t?AmplitudeHelpers.writeDebugMessage(n.default.playlists[t].songs[a].name+" by "+n.default.playlists[t].songs[a].artist+" is not streamable by the Soundcloud API"):AmplitudeHelpers.writeDebugMessage(n.default.songs[a].name+" by "+n.default.songs[a].artist+" is not streamable by the Soundcloud API")})}function u(e,t){SC.get("/resolve/?url="+e,function(e){e.streamable?(n.default.songs[t].url=e.stream_url+"?client_id="+n.default.soundcloud_client,n.default.soundcloud_use_art&&(n.default.songs[t].cover_art_url=e.artwork_url),n.default.songs[t].soundcloud_data=e):AmplitudeHelpers.writeDebugMessage(n.default.songs[t].name+" by "+n.default.songs[t].artist+" is not streamable by the Soundcloud API"),++n.default.soundcloud_songs_ready==n.default.soundcloud_song_count&&d.default.setConfig(s)})}function i(e){var t=/^https?:\/\/(soundcloud.com|snd.sc)\/(.*)$/;return e.match(t)}var s={};return{loadSoundCloud:e,resolveIndividualStreamableURL:l,isSoundCloudURL:i}}();t.default=s,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=document.getElementsByClassName("amplitude-playback-speed"),t=0;t0))for(var u=0;u0&&C.default.initialize(e.playlists),void 0!=e.start_song&&e.starting_playlist?g.default.isInt(e.start_song)?E.default.changeSong(i.default.songs[e.start_song],e.start_song):v.default.writeMessage("You must enter an integer index for the start song."):E.default.changeSong(i.default.songs[0],0),void 0!=e.shuffle_on&&e.shuffle_on&&(i.default.shuffle_on=!0,_.default.shuffleSongs(),E.default.changeSong(i.default.shuffle_list[0],0)),i.default.continue_next=void 0==e.continue_next||e.continue_next,i.default.playback_speed=void 0!=e.playback_speed?e.playback_speed:1,s.default.setPlaybackSpeed(i.default.playback_speed),i.default.audio.preload=void 0!=e.preload?e.preload:"auto",i.default.callbacks=void 0!=e.callbacks?e.callbacks:{},i.default.bindings=void 0!=e.bindings?e.bindings:{},i.default.volume=void 0!=e.volume?e.volume:50,i.default.delay=void 0!=e.delay?e.delay:0,i.default.volume_increment=void 0!=e.volume_increment?e.volume_increment:5,i.default.volume_decrement=void 0!=e.volume_decrement?e.volume_decrement:5,s.default.setVolume(i.default.volume),l(e),n(),void 0!=e.starting_playlist&&""!=e.starting_playlist&&(i.default.active_playlist=e.starting_playlist,void 0!=e.starting_playlist_song&&""!=e.starting_playlist_song?void 0!=u(e.playlists[e.starting_playlist].songs[parseInt(e.starting_playlist_song)])?E.default.changeSongPlaylist(i.default.active_playlist,e.playlists[e.starting_playlist].songs[parseInt(e.starting_playlist_song)],parseInt(e.starting_playlist_song)):(E.default.changeSongPlaylist(i.default.active_playlist,e.playlists[e.starting_playlist].songs[0],0),v.default.writeMessage("The index of "+e.starting_playlist_song+" does not exist in the playlist "+e.starting_playlist)):E.default.changeSong(i.default.active_playlist,e.playlists[e.starting_playlist].songs[0],0),V.default.sync()),T.default.run("initialized")}function l(e){void 0!=e.default_album_art?i.default.default_album_art=e.default_album_art:i.default.default_album_art="",void 0!=e.default_playlist_art?i.default.default_playlist_art=e.default_playlist_art:i.default.default_playlist_art=""}function n(){I.default.syncMain(),q.default.setMuted(0==i.default.volume),H.default.sync(),G.default.sync(),D.default.resetCurrentTimes(),V.default.syncToPause(),F.default.syncMetaData(),X.default.syncRepeatSong()}function d(e){var t=0,a=void 0;for(a in e)e.hasOwnProperty(a)&&t++;return v.default.writeMessage("You have "+t+" playlist(s) in your config"),t}function o(){for(var e=0;e0)for(var t=0;tp&&(p=y),yn[2*o])&&(n[2*o]=p),(0===i||c0}var r="",c=u.default.waveforms.sample_rate,p="";return{init:e,build:t,determineIfUsingWaveforms:f}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){var e={},t=(Math.floor(u.default.audio.currentTime%60)<10?"0":"")+Math.floor(u.default.audio.currentTime%60),a=Math.floor(u.default.audio.currentTime/60),l="00";return a<10&&(a="0"+a),a>=60&&(l=Math.floor(a/60),(a%=60)<10&&(a="0"+a)),e.seconds=t,e.minutes=a,e.hours=l,e}function t(){var e={},t=(Math.floor(u.default.audio.duration%60)<10?"0":"")+Math.floor(u.default.audio.duration%60),a=Math.floor(u.default.audio.duration/60),l="00";return a<10&&(a="0"+a),a>=60&&(l=Math.floor(a/60),(a%=60)<10&&(a="0"+a)),e.seconds=isNaN(t)?"00":t,e.minutes=isNaN(a)?"00":a,e.hours=isNaN(l)?"00":l.toString(),e}function a(){return u.default.audio.currentTime/u.default.audio.duration*100}function l(e){u.default.active_metadata.live||isFinite(e)&&(u.default.audio.currentTime=e)}return{computeCurrentTimes:e,computeSongDuration:t,computeSongCompletionPercentage:a,setCurrentTime:l}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){t(),a(),l(),n()}function t(){for(var e=document.getElementsByClassName("amplitude-buffered-progress"),t=0;t0||navigator.userAgent.match(/Trident.*rv\:11\./)?(a[l].removeEventListener("change",k.default.handle),a[l].addEventListener("change",k.default.handle)):(a[l].removeEventListener("input",k.default.handle),a[l].addEventListener("input",k.default.handle))}function x(){for(var e=window.navigator.userAgent,t=e.indexOf("MSIE "),a=document.getElementsByClassName("amplitude-volume-slider"),l=0;l0||navigator.userAgent.match(/Trident.*rv\:11\./)?(a[l].removeEventListener("change",O.default.handle),a[l].addEventListener("change",O.default.handle)):(a[l].removeEventListener("input",O.default.handle),a[l].addEventListener("input",O.default.handle))}function P(){for(var e=document.getElementsByClassName("amplitude-next"),t=0;t=0){var e=n.default.audio.buffered.end(n.default.audio.buffered.length-1),t=n.default.audio.duration;n.default.buffered=e/t*100}d.default.sync()}return{handle:e}}();t.default=s,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(12),d=l(i),s=a(9),o=l(s),f=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist");null==e&&t(),null!=e&&a(e)}}function t(){d.default.setRepeat(!n.default.repeat),o.default.syncRepeat()}function a(e){d.default.setRepeatPlaylist(!n.default.playlists[e].repeat,e),o.default.syncRepeatPlaylist(e)}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(12),d=l(i),s=a(9),o=l(s),f=function(){function e(){n.default.is_touch_moving||(d.default.setRepeatSong(!n.default.repeat_song),o.default.syncRepeatSong())}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(13),d=l(i),s=a(19),o=l(s),f=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist");null==e?t():a(e)}}function t(){d.default.toggleShuffle(),o.default.syncMain(n.default.shuffle_on)}function a(e){d.default.toggleShufflePlaylist(e),o.default.syncPlaylist(e)}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(4),d=l(i),s=a(3),o=l(s),f=a(5),r=l(f),c=a(1),p=l(c),v=a(2),y=l(v),g=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist"),l=this.getAttribute("data-amplitude-song-index"),u=this.getAttribute("data-amplitude-location");null==u&&d.default.writeMessage("You must add an 'data-amplitude-location' attribute in seconds to your 'amplitude-skip-to' element."),null==l&&d.default.writeMessage("You must add an 'data-amplitude-song-index' attribute to your 'amplitude-skip-to' element."),null!=u&&null!=l&&(null==e?t(parseInt(l),parseInt(u)):a(e,parseInt(l),parseInt(u)))}}function t(e,t){o.default.changeSong(n.default.songs[e],e),p.default.play(),y.default.syncGlobal(),y.default.syncSong(),p.default.skipToLocation(t)}function a(e,t,a){r.default.newPlaylist(e)&&o.default.setActivePlaylist(e),o.default.changeSongPlaylist(e,n.default.playlists[e].songs[t],t),p.default.play(),y.default.syncGlobal(),y.default.syncPlaylist(),y.default.syncSong(),p.default.skipToLocation(a)}return{handle:e}}();t.default=g,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(23),d=l(i),s=a(14),o=l(s),f=function(){function e(){var e=this.value,i=n.default.audio.duration*(e/100),d=this.getAttribute("data-amplitude-playlist"),s=this.getAttribute("data-amplitude-song-index");null==d&&null==s&&t(i,e),null!=d&&null==s&&a(i,e,d),null==d&&null!=s&&l(i,e,s),null!=d&&null!=s&&u(i,e,d,s)}function t(e,t){n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,n.default.active_playlist,n.default.active_index))}function a(e,t,a){n.default.active_playlist==a&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,a,n.default.active_index)))}function l(e,t,a){n.default.active_index==a&&null==n.default.active_playlist&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,n.default.active_playlist,a)))}function u(e,t,a,l){n.default.playlists[a].active_index==l&&n.default.active_playlist==a&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,a,l)))}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(6),d=l(i),s=a(2),o=l(s),f=a(1),r=l(f),c=function(){function e(){n.default.is_touch_moving||(o.default.syncToPause(),r.default.stop(),d.default.setPlayerState())}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(24),d=l(i),s=a(15),o=l(s),f=a(14),r=l(f),c=a(20),p=l(c),v=a(23),y=l(v),g=a(7),m=(l(g),function(){function e(){t(),d.default.sync(),a(),l()}function t(){if(n.default.audio.buffered.length-1>=0){var e=n.default.audio.buffered.end(n.default.audio.buffered.length-1),t=n.default.audio.duration;n.default.buffered=e/t*100}}function a(){if(!n.default.active_metadata.live){var e=y.default.computeCurrentTimes(),t=y.default.computeSongCompletionPercentage(),a=y.default.computeSongDuration();o.default.syncCurrentTimes(e),r.default.sync(t,n.default.active_playlist,n.default.active_index),p.default.sync(t),o.default.syncDurationTimes(e,a)}}function l(){var e=Math.floor(n.default.audio.currentTime);if(void 0!=n.default.active_metadata.time_callbacks&&void 0!=n.default.active_metadata.time_callbacks[e])n.default.active_metadata.time_callbacks[e].run||(n.default.active_metadata.time_callbacks[e].run=!0,n.default.active_metadata.time_callbacks[e]());else for(var t in n.default.active_metadata.time_callbacks)n.default.active_metadata.time_callbacks.hasOwnProperty(t)&&(n.default.active_metadata.time_callbacks[t].run=!1)}return{handle:e}}());t.default=m,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){if(!n.default.is_touch_moving){var e=null;e=n.default.volume-n.default.volume_increment>0?n.default.volume-n.default.volume_increment:0,d.default.setVolume(e),o.default.setMuted(0==n.default.volume),r.default.sync()}}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){d.default.setVolume(this.value),o.default.setMuted(0==n.default.volume),r.default.sync()}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){if(!n.default.is_touch_moving){var e=null;e=n.default.volume+n.default.volume_increment<=100?n.default.volume+n.default.volume_increment:100,d.default.setVolume(e),o.default.setMuted(0==n.default.volume),r.default.sync()}}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){var e=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext;e?(u.default.context=new e,u.default.analyser=u.default.context.createAnalyser(),u.default.audio.crossOrigin="anonymous",u.default.source=u.default.context.createMediaElementSource(u.default.audio),u.default.source.connect(u.default.analyser),u.default.analyser.connect(u.default.context.destination)):AmplitudeHelpers.writeDebugMessage("Web Audio API is unavailable! We will set any of your visualizations with your back up definition!")}function t(){var e=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext;return u.default.web_audio_api_available=!1,e?(u.default.web_audio_api_available=!0,!0):(u.default.web_audio_api_available=!1,!1)}function a(){var e=document.querySelectorAll(".amplitude-wave-form"),t=document.querySelectorAll(".amplitude-visualization");return e.length>0||t.length>0}return{configureWebAudioAPI:e,webAudioAPIAvailable:t,determineUsingAnyFX:a}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(21),n=l(u),i=a(0),d=l(i),s=a(1),o=l(s),f=a(13),r=l(f),c=a(6),p=l(c),v=a(3),y=l(v),g=a(12),m=l(g),_=a(5),h=l(_),b=a(16),A=l(b),x=a(19),M=l(x),P=a(9),S=l(P),L=a(14),w=l(L),E=a(20),k=l(E),T=a(15),O=l(T),C=a(2),j=l(C),I=a(8),N=l(I),q=a(18),z=l(q),H=a(4),B=l(H),D=a(17),R=l(D),V=function(){function e(e){n.default.initialize(e)}function t(){return d.default}function a(){n.default.rebindDisplay()}function l(){return d.default.active_playlist}function u(){return d.default.playback_speed}function i(e){o.default.setPlaybackSpeed(e),z.default.sync()}function s(){return d.default.repeat}function f(e){return d.default.playlists[e].repeat}function c(){return d.default.shuffle_on}function v(e){return d.default.playlists[e].shuffle}function g(e){r.default.setShuffle(e),M.default.syncMain()}function _(e,t){r.default.setShufflePlaylist(e,t),M.default.syncMain(),M.default.syncPlaylist(e)}function b(e){m.default.setRepeat(e),S.default.syncRepeat()}function x(e,t){m.default.setRepeatPlaylist(t,e),S.default.syncRepeatPlaylist(e)}function P(e){d.default.is_touch_moving||(m.default.setRepeatSong(!d.default.repeat_song),S.default.syncRepeatSong())}function L(){return d.default.default_album_art}function E(){return d.default.default_playlist_art}function T(e){d.default.default_album_art=e}function C(e){d.default.default_plalist_art=e}function I(){return d.default.audio.currentTime/d.default.audio.duration*100}function q(){return d.default.audio.currentTime}function H(){return d.default.audio.duration}function D(e){"number"==typeof e&&e>0&&e<100&&(d.default.audio.currentTime=d.default.audio.duration*(e/100))}function V(e){d.default.debug=e}function U(){return d.default.active_metadata}function F(){return d.default.playlists[d.default.active_playlist]}function W(e){return d.default.songs[e]}function G(e,t){return d.default.playlists[e].songs[t]}function Y(e){return void 0==d.default.songs&&(d.default.songs=[]),d.default.songs.push(e),d.default.shuffle_on&&d.default.shuffle_list.push(e),R.default.isSoundCloudURL(e.url)&&R.default.resolveIndividualStreamableURL(e.url,null,d.default.songs.length-1,d.default.shuffle_on),d.default.songs.length-1}function X(e,t){return void 0!=d.default.playlists[t]?(d.default.playlists[t].songs.push(e),d.default.playlists[t].shuffle&&d.default.playlists[t].shuffle_list.push(e),R.default.isSoundCloudURL(e.url)&&R.default.resolveIndividualStreamableURL(e.url,t,d.default.playlists[t].songs.length-1,d.default.playlists[t].shuffle),d.default.playlists[t].songs.length-1):(B.default.writeMessage("Playlist doesn't exist!"),null)}function J(e,t,a){if(void 0==d.default.playlists[e]){d.default.playlists[e]={};var l=["repeat","shuffle","shuffle_list","songs","src"];for(var u in t)l.indexOf(u)<0&&(d.default.playlists[e][u]=t[u]);return d.default.playlists[e].songs=a,d.default.playlists[e].active_index=null,d.default.playlists[e].repeat=!1,d.default.playlists[e].shuffle=!1,d.default.playlists[e].shuffle_list=[],d.default.playlists[e]}return B.default.writeMessage("A playlist already exists with that key!"),null}function $(e){d.default.songs.splice(e,1)}function Q(e,t){void 0!=d.default.playlists[t]&&d.default.playlists[t].songs.splice(e,1)}function K(e){e.url?(d.default.audio.src=e.url,d.default.active_metadata=e,d.default.active_album=e.album):B.default.writeMessage("The song needs to have a URL!"),o.default.play(),j.default.sync(),N.default.displayMetaData(),w.default.resetElements(),k.default.resetElements(),O.default.resetCurrentTimes(),O.default.resetDurationTimes(),p.default.setPlayerState()}function Z(e){o.default.stop(),h.default.newPlaylist(null)&&(y.default.setActivePlaylist(null),y.default.changeSong(d.default.songs[e],e)),h.default.newSong(null,e)&&y.default.changeSong(d.default.songs[e],e),o.default.play(),p.default.setPlayerState(),j.default.sync()}function ee(e,t){o.default.stop(),h.default.newPlaylist(t)&&(y.default.setActivePlaylist(t),y.default.changeSongPlaylist(t,d.default.playlists[t].songs[e],e)),h.default.newSong(t,e)&&y.default.changeSongPlaylist(t,d.default.playlists[t].songs[e],e),j.default.sync(),o.default.play(),p.default.setPlayerState()}function te(){o.default.play(),p.default.setPlayerState()}function ae(){o.default.pause(),p.default.setPlayerState()}function le(){return d.default.audio}function ue(){return d.default.analyser}function ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""==e||null==e?null==d.default.active_playlist||""==d.default.active_playlist?y.default.setNext():y.default.setNextPlaylist(d.default.active_playlist):y.default.setNextPlaylist(e)}function ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""==e||null==e?null==d.default.active_playlist||""==d.default.active_playlist?y.default.setPrevious():y.default.setPreviousPlaylist(d.default.active_playlist):y.default.setPreviousPlaylist(e)}function de(){return d.default.songs}function se(e){return d.default.playlists[e].songs}function oe(){return d.default.shuffle_on?d.default.shuffle_list:d.default.songs}function fe(e){return d.default.playlists[e].shuffle?d.default.playlists[e].shuffle_list:d.default.playlists[e].songs}function re(){return parseInt(d.default.active_index)}function ce(){return d.default.version}function pe(){return d.default.buffered}function ve(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e=parseInt(e),null!=a?(h.default.newPlaylist(a)&&y.default.setActivePlaylist(a),y.default.changeSongPlaylist(a,d.default.playlists[a].songs[t],t),o.default.play(),j.default.syncGlobal(),j.default.syncPlaylist(),j.default.syncSong(),o.default.skipToLocation(e)):(y.default.changeSong(d.default.songs[t],t),o.default.play(),j.default.syncGlobal(),j.default.syncSong(),o.default.skipToLocation(e))}function ye(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(""!=a&&null!=a&&void 0!=d.default.playlists[a])for(var l in t)t.hasOwnProperty(l)&&"url"!=l&&"URL"!=l&&"live"!=l&&"LIVE"!=l&&(d.default.playlists[a].songs[e][l]=t[l]);else for(var l in t)t.hasOwnProperty(l)&&"url"!=l&&"URL"!=l&&"live"!=l&&"LIVE"!=l&&(d.default.songs[e][l]=t[l]);N.default.displayMetaData(),N.default.syncMetaData()}function ge(e,t){if(void 0!=d.default.playlists[e]){var a=["repeat","shuffle","shuffle_list","songs","src"];for(var l in t)t.hasOwnProperty(l)&&a.indexOf(l)<0&&(d.default.playlists[e][l]=t[l]);N.default.displayPlaylistMetaData()}else B.default.writeMessage("You must provide a valid playlist key!")}function me(e){d.default.delay=e}function _e(){return d.default.delay}function he(){return d.default.player_state}function be(e,t){A.default.register(e,t)}function Ae(e,t){void 0!=d.default.playlists[e]?void 0!=d.default.visualizations.available[t]?d.default.playlists[e].visualization=t:B.default.writeMessage("A visualization does not exist for the key provided."):B.default.writeMessage("The playlist for the key provided does not exist")}function xe(e,t){d.default.songs[e]?void 0!=d.default.visualizations.available[t]?d.default.songs[e].visualization=t:B.default.writeMessage("A visualization does not exist for the key provided."):B.default.writeMessage("A song at that index is undefined")}function Me(e,t,a){void 0!=d.default.playlists[e].songs[t]?void 0!=d.default.visualizations.available[a]?d.default.playlists[e].songs[t].visualization=a:B.default.writeMessage("A visualization does not exist for the key provided."):B.default.writeMessage("The song in the playlist at that key is not defined")}function Pe(e){void 0!=d.default.visualizations.available[e]?d.default.visualization=e:B.default.writeMessage("A visualization does not exist for the key provided.")}function Se(e){o.default.setVolume(e)}function Le(){return d.default.volume}return{init:e,getConfig:t,bindNewElements:a,getActivePlaylist:l,getPlaybackSpeed:u,setPlaybackSpeed:i,getRepeat:s,getRepeatPlaylist:f,getShuffle:c,getShufflePlaylist:v,setShuffle:g,setShufflePlaylist:_,setRepeat:b,setRepeatSong:P,setRepeatPlaylist:x,getDefaultAlbumArt:L,setDefaultAlbumArt:T,getDefaultPlaylistArt:E,setDefaultPlaylistArt:C,getSongPlayedPercentage:I,setSongPlayedPercentage:D,getSongPlayedSeconds:q,getSongDuration:H,setDebug:V,getActiveSongMetadata:U,getActivePlaylistMetadata:F,getSongAtIndex:W,getSongAtPlaylistIndex:G,addSong:Y,addSongToPlaylist:X,removeSong:$,removeSongFromPlaylist:Q,playNow:K,playSongAtIndex:Z,playPlaylistSongAtIndex:ee,play:te,pause:ae,getAudio:le,getAnalyser:ue,next:ne,prev:ie,getSongs:de,getSongsInPlaylist:se,getSongsState:oe,getSongsStatePlaylist:fe,getActiveIndex:re,getVersion:ce,getBuffered:pe,skipTo:ve,setSongMetaData:ye,setPlaylistMetaData:ge,setDelay:me,getDelay:_e,getPlayerState:he,addPlaylist:J,registerVisualization:be,setPlaylistVisualization:Ae,setSongVisualization:xe,setSongInPlaylistVisualization:Me,setGlobalVisualization:Pe,getVolume:Le,setVolume:Se}}();t.default=V,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(4),d=l(i),s=a(5),o=l(s),f=a(8),r=l(f),c=a(17),p=l(c),v=function(){function e(e){n.default.playlists=e,a(),l(),t(),u(),i(),s(),f()}function t(){for(var e in n.default.playlists)n.default.playlists[e].active_index=null}function a(){for(var e in n.default.playlists)if(n.default.playlists.hasOwnProperty(e)&&n.default.playlists[e].songs)for(var t=0;t0&&(a=e.hours+":"+a);for(var l=0;l0&&(a=e.hours+":"+a);for(var l=0;l0&&(a=e.hours+":"+a);for(var l=0;l0&&(l=e.hours+":"+l);for(var n=0;n0&&(a=i+":"+a)}return a}return{sync:e,resetTimes:i}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e){t(e),a(e),l(e),n(e)}function t(e){for(var t=document.querySelectorAll(".amplitude-duration-hours"),a=0;a0&&(t=e.hours+":"+t)),t}return{sync:e,resetTimes:i}}();t.default=n,e.exports=t.default},function(e,t){e.exports={name:"amplitudejs",version:"5.0.2",description:"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs",main:"dist/amplitude.js",devDependencies:{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-add-module-exports":"0.2.1","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.18.0",husky:"^1.3.1",jest:"^23.6.0",prettier:"1.15.1","pretty-quick":"^1.11.1",watch:"^1.0.2",webpack:"^2.7.0"},directories:{doc:"docs"},files:["dist"],scripts:{build:"node_modules/.bin/webpack",watch:"watch 'node_modules/.bin/webpack' dist",prettier:"npx pretty-quick",test:"jest"},repository:{type:"git",url:"git+https://github.com/521dimensions/amplitudejs.git"},keywords:["webaudio","html5","javascript","audio-player"],author:"521 Dimensions (https://521dimensions.com)",license:"MIT",bugs:{url:"https://github.com/521dimensions/amplitudejs/issues"},homepage:"https://github.com/521dimensions/amplitudejs#readme"}}])}); \ No newline at end of file diff --git a/package.json b/package.json index 02d6912f..2df5d148 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "amplitudejs", - "version": "5.0.1", + "version": "5.0.2", "description": "A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs", "main": "dist/amplitude.js", "devDependencies": { diff --git a/src/events/keydown.js b/src/events/keydown.js index b06c43f6..bf75b88b 100644 --- a/src/events/keydown.js +++ b/src/events/keydown.js @@ -165,9 +165,9 @@ let KeyDown = (function() { or null and set the previous song. */ if (config.active_playlist == "" || config.active_playlist == null) { - AudioNavigation.setPrev(); + AudioNavigation.setPrevious(); } else { - AudioNavigation.setPrevPlaylist(config.active_playlist); + AudioNavigation.setPreviousPlaylist(config.active_playlist); } }