Added mp3 streaming for songs and a player to the app (experimental)

This commit is contained in:
lukeIam committed 2014-12-09 17:58:42 +01:00
1 parent 18bdb7aa05
commit 1e71360366
7 files changed
+52 -2

No files matched your search

+6
View File
@@ -73,6 +73,7 @@ namespace Vocaluxe.Base.Server
CServer.GetSong = _GetSong;
CServer.GetAllSongs = _GetAllSongs;
CServer.GetCurrentSongId = _GetCurrentSongId;
CServer.GetMp3Path = _GetMp3Path;
CServer.ValidatePassword = _ValidatePassword;
CServer.GetUserRole = _GetUserRole;
CServer.SetUserRole = _SetUserRole;
@@ -463,6 +464,11 @@ namespace Vocaluxe.Base.Server
return (from s in songs
select _GetSongInfo(s, false)).ToArray<SSongInfo>();
}
private static string _GetMp3Path(int songId)
{
CSong song = CSongs.GetSong(songId);
return song.GetMP3();
}
private static int _GetCurrentSongId()
{
+1
View File
@@ -231,6 +231,7 @@
<div id="displaySongLinks">
<img class="cursorStyleClickable" id="displaySongAddPlaylist" src="img/addPlaylist.png" />
<br />
<audio controls id="displaySongPlayer" preload="none"></audio>
<br />
<img class="cursorStyleClickable" id="displaySongLinkYoutube" src="img/youtube.png" />
<img class="cursorStyleClickable" id="displaySongLinkSpotify" src="img/spotify.png" />
+7
View File
@@ -1066,6 +1066,13 @@
$('#displaySongIsDuet').text(result.IsDuet ? "Yes" : "No");
if (result.SongId >= 0) {
$('#displaySongPlayer').show()[0].src = "getMp3?songId=" + result.SongId;
} else {
$('#displaySongPlayer').hide();
}
if (result.Title != null || result.Artist != null) {
$('#displaySongLinks').show();