From 23bc78fbdb9bf2cf0416f0a6032ec7b5208a3949 Mon Sep 17 00:00:00 2001 From: Stefano Russello Date: Mon, 2 Oct 2023 12:29:10 +0200 Subject: [PATCH] SE-362 Update POST to GET Requests --- Changelog.md | 2 ++ build.gradle | 4 ++-- .../streamamg/amg_playkit/network/PlayKitIsLiveAPI.kt | 9 +++++---- .../amg_playkit/playkitExtensions/AMGPlayKit+IsLive.kt | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Changelog.md b/Changelog.md index f49c93e..fb2d233 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,8 @@ Change Log: All notable changes to this project will be documented in this section. +### 1.2.4 - Updated MediaType APIs from POST to GET + ### 1.2.3 - Fixed StreamPlay FixtureID field types ### 1.2.2 - Improved bitrate and subtitle selector and fixed control resize issue diff --git a/build.gradle b/build.gradle index 0f66c81..b314ad1 100644 --- a/build.gradle +++ b/build.gradle @@ -15,8 +15,8 @@ plugins { id 'maven-publish' } // Versions of the library modules are matched (eg 1.0 core goes with 1.0 cloudmatrix) to prevent dependency issues -ext.SDK_VERSION_CODE = 23 -ext.SDK_VERSION_NAME = "1.2.3" +ext.SDK_VERSION_CODE = 24 +ext.SDK_VERSION_NAME = "1.2.4" publishing { publications { diff --git a/streamamg-sdk-playkit/src/main/java/com/streamamg/amg_playkit/network/PlayKitIsLiveAPI.kt b/streamamg-sdk-playkit/src/main/java/com/streamamg/amg_playkit/network/PlayKitIsLiveAPI.kt index 1f6c91d..77d2134 100644 --- a/streamamg-sdk-playkit/src/main/java/com/streamamg/amg_playkit/network/PlayKitIsLiveAPI.kt +++ b/streamamg-sdk-playkit/src/main/java/com/streamamg/amg_playkit/network/PlayKitIsLiveAPI.kt @@ -1,13 +1,14 @@ package com.streamamg.amg_playkit.network import retrofit2.Call +import retrofit2.http.GET import retrofit2.http.POST import retrofit2.http.Url import com.streamamg.amg_playkit.playkitExtensions.MPCategory interface PlayKitIsLiveAPI { - @POST() - fun postIsLive(@Url url: String): Call - @POST() - fun postIsNotHarvested(@Url url: String): Call + @GET + fun getIsLive(@Url url: String): Call + @GET + fun getIsNotHarvested(@Url url: String): Call } \ No newline at end of file diff --git a/streamamg-sdk-playkit/src/main/java/com/streamamg/amg_playkit/playkitExtensions/AMGPlayKit+IsLive.kt b/streamamg-sdk-playkit/src/main/java/com/streamamg/amg_playkit/playkitExtensions/AMGPlayKit+IsLive.kt index 9b5cd58..d496c76 100644 --- a/streamamg-sdk-playkit/src/main/java/com/streamamg/amg_playkit/playkitExtensions/AMGPlayKit+IsLive.kt +++ b/streamamg-sdk-playkit/src/main/java/com/streamamg/amg_playkit/playkitExtensions/AMGPlayKit+IsLive.kt @@ -8,7 +8,7 @@ import retrofit2.Response fun AMGPlayKit.isLive(server: String, entryID: String, ks: String?, callBack: ((Boolean) -> Unit)) { val url = "$server/api_v3/?service=liveStream&action=islive&id=$entryID&protocol=applehttp&format=1" - val call = isLiveAPI.postIsLive(url) + val call = isLiveAPI.getIsLive(url) call.enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { Log.e("AMGISLIVE", "Call to IsLive failed: ${t.localizedMessage}") @@ -34,7 +34,7 @@ fun AMGPlayKit.isLive(server: String, entryID: String, ks: String?, callBack: (( return } val validURL = "$server/api_v3/?service=baseentry&action=get&entryId=$entryID&protocol=applehttp&format=1&ks=$ks" - val callHarvested = isLiveAPI.postIsNotHarvested(validURL) + val callHarvested = isLiveAPI.getIsNotHarvested(validURL) callHarvested.enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { callBack.invoke(true)