示例#1
0
        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());
        }
示例#2
0
        public IActionResult GetJingles()
        {
            var result = JingleHelper.GetJingles();

            return(Json(result));
        }