ArcMediaClient

class ArcMediaClient

This class is used to interface with the Arc server. The API allows for the retrieval of video objects and playlist objects. The client uses the methods in this class to return ArcVideoStream objects. These objects can then be used to play videos using the ArcMediaPlayer.

How does it relate to other important Video SDK classes?

This class does not interact with other classes.

What are the core components that make it up?

var arcMediaClientService: ArcMediaClientService - This is the retrofit interface that defines the server calls.

How is the class used?

Instantiating the media client

class MyFragment : Fragment() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ArcMediaClient.instantiate("http://baseurl.com")
}

fun doSomething() {
var mediaClient = ArcMediaClient.getInstance()
mediaClient.findByUuid(.....)
}

}
class MyFragment: Fragment() {
var client1 : ArcMediaClient? = null
var client2: ArcMediaClient? = null

fun connect() {
client1 = ArcMediaClient.createClient("http://client1base")
client2 = ArcMediaClient.createClient("http://client2base")
}

fun useClient1() {
client1.findByUuid(.....)
}

fun useClient2() {
client2.findByUuid(....)
}
}
}
var mediaClient = ArcMediaClient.instantiate("http://baseurl.com")

mediaClient.findByUuid("xxxx-xxx-xxxx-xxxx",
object : ArcVideoStreamCallback {
override fun onVideoStream(videos: List<ArcVideoStream>?) {
//play the video stream
}
}

override fun onError(type: ArcXPSDKErrorType, message: String, value: Any?) {
//process error
}
})

Constructors

Link copied to clipboard
fun ArcMediaClient(baseUrl: String)
Link copied to clipboard
fun ArcMediaClient(orgName: String, serverEnvironment: String)

Functions

Link copied to clipboard
fun findByPlaylist(    name: String,     count: Int,     listener: ArcVideoPlaylistCallback)

Returns the playlist with the given name containing the first count number of objects. A playlist is a list of ArcVideoStream objects.

Link copied to clipboard
fun findByPlaylistAsJson(    name: String,     count: Int,     listener: ArcVideoPlaylistCallback)

Returns the playlist as json with the given name containing the first count number of objects. A playlist is a list of ArcVideoStream objects.

Link copied to clipboard
fun findByUuid(    uuid: String,     listener: ArcVideoStreamCallback,     shouldUseVirtualChannel: Boolean = false)

Returns an array containing a single ArcVideoStream object

Link copied to clipboard
fun findByUuidAsJson(    uuid: String,     listener: ArcVideoStreamCallback,     shouldUseVirtualChannel: Boolean = false)

Returns an json representation of array containing a single ArcVideoStream object

Link copied to clipboard
fun findByUuids(listener: ArcVideoStreamCallback, vararg uuids: String)
fun findByUuids(uuids: List<String>, listener: ArcVideoStreamCallback)

fun findByUuids(vararg uuids: String, listener: ArcVideoStreamCallback)

Returns an array containing the ArcVideoStream objects for the given UUIDs

Link copied to clipboard
fun findByUuidsAsJson(listener: ArcVideoStreamCallback, vararg uuids: String)
fun findByUuidsAsJson(uuids: List<String>, listener: ArcVideoStreamCallback)

fun findByUuidsAsJson(vararg uuids: String, listener: ArcVideoStreamCallback)

Returns a json representation of an array containing the ArcVideoStream objects for the given UUIDs

Link copied to clipboard
fun findLive(listener: ArcVideoStreamCallback)

Returns list of current live videos

Link copied to clipboard
fun findLiveAsJson(listener: ArcVideoStreamCallback)

Returns list of current live videos as json String

Link copied to clipboard
suspend fun findLiveSuspend(): Either<ArcXPException, List<VideoVO>>

Returns list of current live videos (suspend)

Link copied to clipboard
suspend fun findLiveSuspendAsJson(): Either<ArcXPException, String>

Returns list of current live videos (suspend) as json String