public async Task <IActionResult> PlayJingleAsync([FromBody] string filePath) { const int reduceVolume = 15; var currentTrack = Playlist.GetCurrentTrack(); if (currentTrack != null) { await SetVolumeAsync(new VolumeFilter { TrackSource = currentTrack.TrackSource, Volume = PlayerManager.CurrentVolume - reduceVolume }); } JingleHelper.Play(filePath); if (currentTrack != null) { await SetVolumeAsync(new VolumeFilter { TrackSource = currentTrack.TrackSource, Volume = PlayerManager.CurrentVolume }); } return(Ok()); }
public IActionResult GetJingles() { var result = JingleHelper.GetJingles(); return(Json(result)); }