From 152bac9512b95a2e3f883ebce6fb3e48482e0d68 Mon Sep 17 00:00:00 2001 From: Sunguk Lee Date: Wed, 16 Sep 2020 17:39:45 +0900 Subject: [PATCH 1/2] Fix flac playing --- app/player/player-directive.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/player/player-directive.js b/app/player/player-directive.js index 22d75e0d..00a025dd 100644 --- a/app/player/player-directive.js +++ b/app/player/player-directive.js @@ -43,7 +43,7 @@ angular.module('jamstash.player.directive', ['jamstash.player.service', 'jamstas swfPath: 'bower_components/jplayer/dist/jplayer/jquery.jplayer.swf', wmode: 'window', solution: audioSolution, - supplied: 'mp3, oga, m4a', + supplied: 'mp3, oga, m4a, flac', preload: 'auto', errorAlerts: false, warningAlerts: false, @@ -119,6 +119,8 @@ angular.module('jamstash.player.directive', ['jamstash.player.service', 'jamstas media= { m4a: newSong.url, duration: newSong.duration }; } else if (newSong.suffix === 'mp3') { media= { mp3: newSong.url, duration: newSong.duration }; + } else if (newSong.suffix === 'flac') { + media= { flac: newSong.url, duration: newSong.duration }; } $player.jPlayer('setMedia', media); if (globals.settings.Jukebox) { From 0e3553be9f0ae83a477b5a569282f038c7cbf959 Mon Sep 17 00:00:00 2001 From: Carey Metcalfe Date: Sun, 18 Oct 2020 21:47:51 -0400 Subject: [PATCH 2/2] Slight refactor --- app/player/player-directive.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/player/player-directive.js b/app/player/player-directive.js index 00a025dd..d9f410ff 100644 --- a/app/player/player-directive.js +++ b/app/player/player-directive.js @@ -113,14 +113,9 @@ angular.module('jamstash.player.directive', ['jamstash.player.service', 'jamstas scope.fancyboxOpenImage(newSong.coverartfull); } var media = {}; - if (newSong.suffix === 'oga') { - media= { oga: newSong.url, duration: newSong.duration }; - } else if (newSong.suffix === 'm4a') { - media= { m4a: newSong.url, duration: newSong.duration }; - } else if (newSong.suffix === 'mp3') { - media= { mp3: newSong.url, duration: newSong.duration }; - } else if (newSong.suffix === 'flac') { - media= { flac: newSong.url, duration: newSong.duration }; + if (['oga', 'm4a', 'mp3', 'flac'].indexOf(newSong.suffix) > -1) { + media[newSong.suffix] = newSong.url; + media['duration'] = newSong.duration; } $player.jPlayer('setMedia', media); if (globals.settings.Jukebox) {