From 5ffc2f66530c58b249c2655d84d308c7e0bc9ebe Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Thu, 17 Mar 2022 22:27:09 +0100 Subject: [PATCH] fix wrong merge --- .../ch/sdp/vibester/api/ItunesMusicApi.kt | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/api/ItunesMusicApi.kt b/app/src/main/java/ch/sdp/vibester/api/ItunesMusicApi.kt index 2b0a13acf..32ae2dd73 100644 --- a/app/src/main/java/ch/sdp/vibester/api/ItunesMusicApi.kt +++ b/app/src/main/java/ch/sdp/vibester/api/ItunesMusicApi.kt @@ -36,33 +36,6 @@ class ItunesMusicApi private constructor(){ return retFuture } - /** - * A function that given an audio stream url will play it - * @param audioUrl Url in String pointing towards the audio stream - * @return CompletableFuture that contains the current playing mediaPlayer - */ - fun playAudio(audioUrl: String): CompletableFuture{ - val mediaFut = CompletableFuture() - var mediaPlayer: MediaPlayer = MediaPlayer() - mediaPlayer.setAudioAttributes( - AudioAttributes.Builder() - .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC) - .build() - ) - try { - mediaPlayer.setDataSource(audioUrl) - mediaPlayer.prepare() - mediaPlayer.setOnPreparedListener { - mediaPlayer.start() - mediaFut.complete(mediaPlayer) - } - }catch (e: IOException){ - Log.e("[PlayAudio]", "Error see stacktrace") - mediaFut.completeExceptionally(e) - } - return mediaFut - } - }