Skip to content

Commit

Permalink
Merge pull request #17 from StreamAMG/release/1.2.4
Browse files Browse the repository at this point in the history
SE-362 Update POST to GET Requests
  • Loading branch information
StefanoStream authored Oct 4, 2023
2 parents ca37a38 + 23bc78f commit df9d40c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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<String>
@POST()
fun postIsNotHarvested(@Url url: String): Call<MPCategory>
@GET
fun getIsLive(@Url url: String): Call<String>
@GET
fun getIsNotHarvested(@Url url: String): Call<MPCategory>
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
override fun onFailure(call: Call<String>, t: Throwable) {
Log.e("AMGISLIVE", "Call to IsLive failed: ${t.localizedMessage}")
Expand All @@ -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<MPCategory> {
override fun onFailure(call: Call<MPCategory>, t: Throwable) {
callBack.invoke(true)
Expand Down

0 comments on commit df9d40c

Please sign in to comment.