Skip to content

Commit

Permalink
Merge pull request #32 from speechles/patch-1
Browse files Browse the repository at this point in the history
Add api_key to the audio urls
  • Loading branch information
LukePulverenti authored Mar 5, 2017
2 parents a611f97 + 13356b6 commit 42fe211
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/javascript/Gui/GuiMusicPlayer/GuiMusicPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ GuiMusicPlayer.start = function(title,url,playedFromPage,isQueue,showThemeId,ite
this.queuedItems.push(this.ItemData.ThemeSongsResult.Items[index]);
}

this.videoURL = Server.getServerAddr() + '/Audio/'+this.queuedItems[this.currentPlayingItem].Id+'/Stream.mp3?static=true&MediaSource='+this.queuedItems[this.currentPlayingItem].MediaSources[0].Id;
this.videoURL = Server.getServerAddr() + '/Audio/'+this.queuedItems[this.currentPlayingItem].Id+'/Stream.mp3?static=true&MediaSource='+this.queuedItems[this.currentPlayingItem].MediaSources[0].Id + '&api_key=' + Server.getAuthToken();
this.updateSelectedItem();
//Start Playback
this.handlePlayKey();
Expand Down Expand Up @@ -152,9 +152,9 @@ GuiMusicPlayer.start = function(title,url,playedFromPage,isQueue,showThemeId,ite
if (this.Status == "STOPPED") {
this.currentPlayingItem = 0;
if (this.queuedItems[this.currentPlayingItem].Type == "AudioPodcast") {
this.videoURL = Server.getCustomURL("/audio/"+this.queuedItems[this.currentPlayingItem].Id+"/stream.mp3?DeviceId="+Server.getDeviceID()+"&MediaSourceId="+this.queuedItems[this.currentPlayingItem].MediaSources[0].Id+"&AudioCodec=mp3&AudioBitrate=192000&MaxAudioChannels=2&CopyTimestamps=false&EnableSubtitlesInManifest=false");
this.videoURL = Server.getCustomURL("/audio/"+this.queuedItems[this.currentPlayingItem].Id+"/stream.mp3?DeviceId="+Server.getDeviceID()+"&MediaSourceId="+this.queuedItems[this.currentPlayingItem].MediaSources[0].Id+"&AudioCodec=mp3&AudioBitrate=192000&MaxAudioChannels=2&CopyTimestamps=false&EnableSubtitlesInManifest=false&api_key=" + Server.getAuthToken());
} else {
this.videoURL = Server.getServerAddr() + '/Audio/'+this.queuedItems[this.currentPlayingItem].Id+'/Stream.mp3?static=true&MediaSource='+this.queuedItems[this.currentPlayingItem].MediaSources[0].Id;
this.videoURL = Server.getServerAddr() + '/Audio/'+this.queuedItems[this.currentPlayingItem].Id+'/Stream.mp3?static=true&MediaSource='+this.queuedItems[this.currentPlayingItem].MediaSources[0].Id + '&api_key=' + Server.getAuthToken();
}

//Update selected Item
Expand Down Expand Up @@ -410,7 +410,7 @@ GuiMusicPlayer.handleNextKey = function() {
this.returnToPage();
} else {
//Play Next Item
this.videoURL = Server.getServerAddr() + '/Audio/'+this.queuedItems[this.currentPlayingItem].Id+'/Stream.mp3?static=true&MediaSource='+this.queuedItems[this.currentPlayingItem].MediaSources[0].Id;
this.videoURL = Server.getServerAddr() + '/Audio/'+this.queuedItems[this.currentPlayingItem].Id+'/Stream.mp3?static=true&MediaSource='+this.queuedItems[this.currentPlayingItem].MediaSources[0].Id + '&api_key=' + Server.getAuthToken();
alert ("Next " + this.videoURL);
//Start Playback
this.handlePlayKey();
Expand Down Expand Up @@ -576,4 +576,4 @@ GuiMusicPlayer.stopOnAppExit = function() {
this.pluginMusic = null;
this.pluginAudioMusic = null;
}
}
}

0 comments on commit 42fe211

Please sign in to comment.