diff --git a/player/src/main/java/video/api/player/models/ApiVideoMediaFactory.kt b/player/src/main/java/video/api/player/models/ApiVideoMediaFactory.kt index 43d47c4..609381d 100644 --- a/player/src/main/java/video/api/player/models/ApiVideoMediaFactory.kt +++ b/player/src/main/java/video/api/player/models/ApiVideoMediaFactory.kt @@ -62,7 +62,6 @@ class ApiVideoMediaFactory( } else { RequestManager.getSessionToken( videoOptions.sessionTokenUrl, - videoOptions.videoType, { xTokenSession = it onSuccess(PlayerMediaRequest(uri, xTokenSession)) diff --git a/player/src/main/java/video/api/player/models/VideoOptions.kt b/player/src/main/java/video/api/player/models/VideoOptions.kt index ac1e65f..1a15a1e 100644 --- a/player/src/main/java/video/api/player/models/VideoOptions.kt +++ b/player/src/main/java/video/api/player/models/VideoOptions.kt @@ -48,7 +48,7 @@ data class VideoOptions( internal val sessionTokenUrl = if (videoType == VideoType.VOD) { "$vodUrl/session" } else { - hlsManifestUrl // Temp: return the same url as hlsManifestUrl for live + "$liveUrl/session" } /** diff --git a/player/src/main/java/video/api/player/utils/RequestManager.kt b/player/src/main/java/video/api/player/utils/RequestManager.kt index d094448..7ee1a7c 100644 --- a/player/src/main/java/video/api/player/utils/RequestManager.kt +++ b/player/src/main/java/video/api/player/utils/RequestManager.kt @@ -7,7 +7,6 @@ import com.android.volley.toolbox.BasicNetwork import com.android.volley.toolbox.HurlStack import com.android.volley.toolbox.ImageRequest import com.android.volley.toolbox.NoCache -import video.api.player.models.PlayerJsonRequest import video.api.player.models.SessionTokenRequest import video.api.player.models.VideoType @@ -17,11 +16,10 @@ object RequestManager { fun getSessionToken( url: String, - videoType: VideoType, onSuccess: (String?) -> Unit, onError: (Exception) -> Unit ) { - val sessionTokenRequest = if (videoType == VideoType.VOD) { + val sessionTokenRequest = SessionTokenRequest(url, { sessionTokenResult -> onSuccess(sessionTokenResult.sessionToken) @@ -30,16 +28,6 @@ object RequestManager { onError(error) } ) - } else { - PlayerJsonRequest(url, - { sessionTokenResult -> - onSuccess(sessionTokenResult.sessionToken) - }, - { error -> - onError(error) - } - ) - } queue.add(sessionTokenRequest) }