diff --git a/client/addPodcast.html b/client/addPodcast.html index b8f5816..633f935 100644 --- a/client/addPodcast.html +++ b/client/addPodcast.html @@ -106,10 +106,10 @@
- +
-
-
+
+
-
+
diff --git a/client/episodes.html b/client/episodes.html index 1b2878f..ca2a45f 100644 --- a/client/episodes.html +++ b/client/episodes.html @@ -117,6 +117,12 @@ title="Delete Podcast Episode File" > + {{else}} {{if not $setting.AutoDownload}}
${podcast.DownloadedEpisodesCount}/${podcast.AllEpisodesCount} episodes
-
+
+ +
@@ -265,6 +274,7 @@ this.podcasts.splice(index,1); });}, deletePodcastEpisodes(id){ deletePodcastEpisodes(id)}, + playPodcast(id){openPlayer("",id)}, }, mounted(){ if(localStorage?.sortOrder){ diff --git a/client/navbar.html b/client/navbar.html index ba30fb1..0ec644c 100644 --- a/client/navbar.html +++ b/client/navbar.html @@ -149,6 +149,7 @@ div#overlay{ + @@ -160,6 +161,7 @@ div#overlay{
  • Home
  • Episodes
  • Add Podcast
  • +
  • Player
  • Settings
  • diff --git a/client/player.html b/client/player.html new file mode 100644 index 0000000..c33605d --- /dev/null +++ b/client/player.html @@ -0,0 +1,839 @@ + + + + + + {{.title}} - PodGrab + {{template "commoncss" .}} + + + + +
    + {{template "navbar" .}} + +
    {{$setting := .setting}} +
    + + +
    + + +
    + +
    + +
    +
    +
    + + : + +
    + + + + +
    + + : + +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    + + +
    + + +
    +
    +
    +
    + + + +
    + {{range $index,$item:=.podcastItems}} +
    +
    +
    + +
    + +
    + + {{ formatDuration .Duration}} +
    + {{end}} +
    + +
    + + +
    + +
    + + +
    + + {{template "scripts"}} + + + + diff --git a/client/scripts.html b/client/scripts.html index 2a3c72f..51ece27 100644 --- a/client/scripts.html +++ b/client/scripts.html @@ -51,5 +51,16 @@ } } checkUseMore(); + +function openPlayer(itemId,podcastId){ + let url="/player?"; + if(itemId){ + url+="&itemId="+itemId + } + if(podcastId){ + url+="&podcastId="+podcastId + } + const player= window.open(url,"podgrab_player"); +} {{end}} diff --git a/controllers/pages.go b/controllers/pages.go index 8b0e85b..831cbb2 100644 --- a/controllers/pages.go +++ b/controllers/pages.go @@ -92,6 +92,45 @@ func PodcastPage(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"error": "Invalid request"}) } +} + +func PlayerPage(c *gin.Context) { + + itemId, hasItemId := c.GetQuery("itemId") + podcastId, hasPodcastId := c.GetQuery("podcastId") + title := "Podgrab" + var items []db.PodcastItem + var totalCount int64 + if hasItemId { + toAdd := service.GetPodcastItemById(itemId) + items = append(items, *toAdd) + totalCount = 1 + } else if hasPodcastId { + pod := service.GetPodcastById(podcastId) + for _, item := range pod.PodcastItems { + if item.DownloadStatus == db.Downloaded { + items = append(items, item) + } + } + title = "Playing: " + pod.Title + totalCount = int64(len(items)) + } else { + title = "Playing Latest Episodes" + if err := db.GetPaginatedPodcastItems(1, 10, true, &items, &totalCount); err != nil { + fmt.Println(err.Error()) + } + } + setting := c.MustGet("setting").(*db.Setting) + + c.HTML(http.StatusOK, "player.html", gin.H{ + "title": title, + "podcastItems": items, + "setting": setting, + "count": len(items), + "totalCount": totalCount, + "downloadedOnly": true, + }) + } func SettingsPage(c *gin.Context) { diff --git a/internal/sanitize/sanitize.go b/internal/sanitize/sanitize.go index 1580ce0..0b75e3a 100644 --- a/internal/sanitize/sanitize.go +++ b/internal/sanitize/sanitize.go @@ -350,7 +350,7 @@ func cleanAttributes(a []parser.Attribute, allowed []string) []parser.Attribute // A list of characters we consider separators in normal strings and replace with our canonical separator - rather than removing. var ( - separators = regexp.MustCompile(`[!&_=+:]`) + separators = regexp.MustCompile(`[!&_=+?:]`) dashes = regexp.MustCompile(`[\-]+`) ) diff --git a/main.go b/main.go index 150fe77..2781d18 100644 --- a/main.go +++ b/main.go @@ -130,6 +130,7 @@ func main() { router.GET("/backups", controllers.BackupsPage) router.POST("/opml", controllers.UploadOpml) router.GET("/opml", controllers.GetOmpl) + router.GET("/player", controllers.PlayerPage) go assetEnv() go intiCron() diff --git a/service/podcastService.go b/service/podcastService.go index d15d402..21a8e28 100644 --- a/service/podcastService.go +++ b/service/podcastService.go @@ -44,6 +44,20 @@ func FetchURL(url string) (model.PodcastData, []byte, error) { err = xml.Unmarshal(body, &response) return response, body, err } +func GetPodcastById(id string) *db.Podcast { + var podcast db.Podcast + + db.GetPodcastById(id, &podcast) + + return &podcast +} +func GetPodcastItemById(id string) *db.PodcastItem { + var podcastItem db.PodcastItem + + db.GetPodcastItemById(id, &podcastItem) + + return &podcastItem +} func GetAllPodcasts(sorting string) *[]db.Podcast { var podcasts []db.Podcast db.GetAllPodcasts(&podcasts, sorting) @@ -401,6 +415,7 @@ func DeleteEpisodeFile(podcastItemId string) error { err = DeleteFile(podcastItem.DownloadPath) if err != nil && !os.IsNotExist(err) { + fmt.Println(err.Error()) return err } diff --git a/webassets/amplitude.min.js b/webassets/amplitude.min.js new file mode 100644 index 0000000..db0a0d1 --- /dev/null +++ b/webassets/amplitude.min.js @@ -0,0 +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:null,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(7)),f=(l(o),a(9)),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=new Audio,n.default.audio.src="",n.default.audio.load()}function s(){n.default.audio=new Audio,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){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];s(e),S.default.destroyAudioBindings(),n.default.audio=new Audio(e.url),S.default.rebindAudio(),o.default.initialize(),n.default.audio.src=e.url,n.default.active_metadata=e,n.default.active_album=e.album,n.default.active_index=parseInt(t),f(a)}function i(e,t,a){var l=arguments.length>3&&void 0!==arguments[3]&&arguments[3];s(t),S.default.destroyAudioBindings(),n.default.audio=new Audio,S.default.rebindAudio(),o.default.initialize(),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(l)}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(e){A.default.displayMetaData(),M.default.setActive(e),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=L,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";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),0==i.default.songs.length&&!e.starting_playlist){var t=Object.keys(i.default.playlists)[0];E.default.changeSongPlaylist(t,i.default.playlists[t].songs[0],0)}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."):i.default.songs.length>0&&E.default.changeSong(i.default.songs[0],0),i.default.songs.length>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(),W.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(e){i.default.songs=e.songs?e.songs:[]}function r(){for(var e=0;e0)||(v.default.writeMessage("Please provide a playlist or some songs for AmplitudeJS to run!"),!1))}return{initialize:e,setConfig:a,rebindDisplay:t}}();t.default=J,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(27),d=l(i),s=a(42),o=l(s),f=a(26),r=l(f),c=a(35),p=l(c),v=a(31),y=l(v),g=a(30),m=l(g),_=a(32),h=l(_),b=a(41),A=l(b),x=a(28),M=l(x),P=a(45),S=l(P),L=a(43),w=l(L),E=a(40),k=l(E),T=a(44),O=l(T),C=a(29),N=l(C),I=a(34),j=l(I),q=a(36),z=l(q),H=a(37),B=l(H),D=a(33),R=l(D),V=a(38),U=l(V),W=a(39),F=l(W),G=a(23),Y=l(G),X=a(4),J=l(X),$=function(){function e(){J.default.writeMessage("Beginning initialization of event handlers.."),document.addEventListener("touchmove",function(){n.default.is_touch_moving=!0}),document.addEventListener("touchend",function(){n.default.is_touch_moving&&(n.default.is_touch_moving=!1)}),l(),u(),i(),s(),f(),c(),v(),g(),_(),b(),x(),P(),L(),E(),T(),C(),I(),q(),H(),D(),V()}function t(){n.default.audio.removeEventListener("timeupdate",o.default.handle),n.default.audio.removeEventListener("durationchange",o.default.handle),n.default.audio.removeEventListener("ended",r.default.handle),n.default.audio.removeEventListener("progress",p.default.handle),Y.default.determineIfUsingWaveforms()&&n.default.audio.removeEventListener("canplaythrough",Y.default.build)}function a(){n.default.audio.addEventListener("durationchange",o.default.handle),n.default.audio.addEventListener("timeupdate",o.default.handle),n.default.audio.addEventListener("ended",r.default.handle),n.default.audio.addEventListener("progress",p.default.handle),Y.default.determineIfUsingWaveforms()&&n.default.audio.addEventListener("canplaythrough",Y.default.build)}function l(){n.default.audio.removeEventListener("timeupdate",o.default.handle),n.default.audio.addEventListener("timeupdate",o.default.handle),n.default.audio.removeEventListener("durationchange",o.default.handle),n.default.audio.addEventListener("durationchange",o.default.handle)}function u(){document.removeEventListener("keydown",d.default.handle),document.addEventListener("keydown",d.default.handle)}function i(){n.default.audio.removeEventListener("ended",r.default.handle),n.default.audio.addEventListener("ended",r.default.handle)}function s(){n.default.audio.removeEventListener("progress",p.default.handle),n.default.audio.addEventListener("progress",p.default.handle)}function f(){for(var e=document.getElementsByClassName("amplitude-play"),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 L(){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 E(){for(var e=document.getElementsByClassName("amplitude-next"),t=0;t0)for(var t=0;tp&&(p=y),yn[2*o])&&(n[2*o]=p),(0===i||c0}var r="",c="",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;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(8),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(8),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(24),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(25),d=l(i),s=a(15),o=l(s),f=a(14),r=l(f),c=a(20),p=l(c),v=a(24),y=l(v),g=a(9),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(8),S=l(P),L=a(14),w=l(L),E=a(20),k=l(E),T=a(15),O=l(T),C=a(2),N=l(C),I=a(7),j=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 W(){return d.default.playlists[d.default.active_playlist]}function F(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){return void 0==d.default.songs&&(d.default.songs=[]),d.default.songs.unshift(e),d.default.shuffle_on&&d.default.shuffle_list.unshift(e),R.default.isSoundCloudURL(e.url)&&R.default.resolveIndividualStreamableURL(e.url,null,d.default.songs.length-1,d.default.shuffle_on),0}function J(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 $(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 Q(e){d.default.songs.splice(e,1)}function K(e,t){void 0!=d.default.playlists[t]&&d.default.playlists[t].songs.splice(e,1)}function Z(e){e.url?(d.default.audio=new Audio,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(),N.default.sync(),j.default.displayMetaData(),w.default.resetElements(),k.default.resetElements(),O.default.resetCurrentTimes(),O.default.resetDurationTimes(),p.default.setPlayerState()}function ee(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(),N.default.sync()}function te(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),N.default.sync(),o.default.play(),p.default.setPlayerState()}function ae(){o.default.play(),p.default.setPlayerState()}function le(){o.default.pause(),p.default.setPlayerState()}function ue(){o.default.stop(),p.default.setPlayerState()}function ne(){return d.default.audio}function ie(){return d.default.analyser}function de(){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 se(){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 oe(){return d.default.songs}function fe(e){return d.default.playlists[e].songs}function re(){return d.default.shuffle_on?d.default.shuffle_list:d.default.songs}function ce(e){return d.default.playlists[e].shuffle?d.default.playlists[e].shuffle_list:d.default.playlists[e].songs}function pe(){return parseInt(d.default.active_index)}function ve(){return d.default.version}function ye(){return d.default.buffered}function ge(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(),N.default.syncGlobal(),N.default.syncPlaylist(),N.default.syncSong(),o.default.skipToLocation(e)):(y.default.changeSong(d.default.songs[t],t),o.default.play(),N.default.syncGlobal(),N.default.syncSong(),o.default.skipToLocation(e))}function me(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]);j.default.displayMetaData(),j.default.syncMetaData()}function _e(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]);j.default.displayPlaylistMetaData()}else B.default.writeMessage("You must provide a valid playlist key!")}function he(e){d.default.delay=e}function be(){return d.default.delay}function Ae(){return d.default.player_state}function xe(e,t){A.default.register(e,t)}function Me(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 Pe(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 Se(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 Le(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 we(e){o.default.setVolume(e)}function Ee(){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:W,getSongAtIndex:F,getSongAtPlaylistIndex:G,addSong:Y,prependSong:X,addSongToPlaylist:J,removeSong:Q,removeSongFromPlaylist:K,playNow:Z,playSongAtIndex:ee,playPlaylistSongAtIndex:te,play:ae,pause:le,stop:ue,getAudio:ne,getAnalyser:ie,next:de,prev:se,getSongs:oe,getSongsInPlaylist:fe,getSongsState:re,getSongsStatePlaylist:ce,getActiveIndex:pe,getVersion:ve,getBuffered:ye,skipTo:ge,setSongMetaData:me,setPlaylistMetaData:_e,setDelay:he,getDelay:be,getPlayerState:Ae,addPlaylist:$,registerVisualization:xe,setPlaylistVisualization:Me,setSongVisualization:Pe,setSongInPlaylistVisualization:Se,setGlobalVisualization:Le,getVolume:Ee,setVolume:we}}();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(7),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.2.0",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"],funding:{type:"opencollective",url:"https://opencollective.com/amplitudejs"},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/webassets/list-play-hover.png b/webassets/list-play-hover.png new file mode 100644 index 0000000..8ebead4 Binary files /dev/null and b/webassets/list-play-hover.png differ diff --git a/webassets/list-play-light.png b/webassets/list-play-light.png new file mode 100644 index 0000000..4fb1395 Binary files /dev/null and b/webassets/list-play-light.png differ diff --git a/webassets/mute.svg b/webassets/mute.svg new file mode 100644 index 0000000..4b83a0c --- /dev/null +++ b/webassets/mute.svg @@ -0,0 +1,26 @@ + + + + volume-x + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/webassets/next.svg b/webassets/next.svg new file mode 100644 index 0000000..4a8e0ea --- /dev/null +++ b/webassets/next.svg @@ -0,0 +1,23 @@ + + + + Next + Created with Sketch. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/webassets/now-playing.svg b/webassets/now-playing.svg new file mode 100644 index 0000000..57e958a --- /dev/null +++ b/webassets/now-playing.svg @@ -0,0 +1,25 @@ + + + + Now Playing + Created with Sketch. + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/webassets/pause.svg b/webassets/pause.svg new file mode 100644 index 0000000..50b3785 --- /dev/null +++ b/webassets/pause.svg @@ -0,0 +1,26 @@ + + + + Oval 1 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/webassets/play.svg b/webassets/play.svg new file mode 100644 index 0000000..b64f12d --- /dev/null +++ b/webassets/play.svg @@ -0,0 +1,25 @@ + + + + Oval 1 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/webassets/prev.svg b/webassets/prev.svg new file mode 100644 index 0000000..ec1e75e --- /dev/null +++ b/webassets/prev.svg @@ -0,0 +1,23 @@ + + + + Previous + Created with Sketch. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/webassets/repeat-off.svg b/webassets/repeat-off.svg new file mode 100644 index 0000000..81a7f40 --- /dev/null +++ b/webassets/repeat-off.svg @@ -0,0 +1,18 @@ + + + + Fill 39 + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/webassets/repeat-on.svg b/webassets/repeat-on.svg new file mode 100644 index 0000000..a00224e --- /dev/null +++ b/webassets/repeat-on.svg @@ -0,0 +1,18 @@ + + + + Fill 39 + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/webassets/shuffle-off.svg b/webassets/shuffle-off.svg new file mode 100644 index 0000000..395ba2b --- /dev/null +++ b/webassets/shuffle-off.svg @@ -0,0 +1,18 @@ + + + + Fill 83 + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/webassets/shuffle-on.svg b/webassets/shuffle-on.svg new file mode 100644 index 0000000..1a7ef6b --- /dev/null +++ b/webassets/shuffle-on.svg @@ -0,0 +1,18 @@ + + + + Fill 83 + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/webassets/volume.svg b/webassets/volume.svg new file mode 100644 index 0000000..dde3bbc --- /dev/null +++ b/webassets/volume.svg @@ -0,0 +1,25 @@ + + + + volume-2 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + \ No newline at end of file