Playcraft is a Kotlin library for streaming video playback.
- Download this repository.
- Drag all the files under folder sdk into your project's libs/.
- Implement all AAR files in libs/.
- Prepare PaaSparameter and set it into PaaSView
val kksPlayerServiceParamData = PaaSParameter(
hostUrl = "${VIDEO_HOST_SERVER_URL_PATH}",
contentId = "${VIDEO_CONTENT_ID}",
contentType = VIDEO_CONTENT_TYPE,
accessToken = "${ACCRSS_TOKEN}",
deviceId = InjectorUtils.provideDeviceId(context),
)
try {
paasProvider = kksPlayerView.setup(
paasParameter = kksPlayerServiceParamData,
lifecycle = lifecycle
)
} catch (e: PaaSErrorEvent) {
Log.e(TAG, e.getErrorMessage(requireContext()))
}
More description about parameters:
hostUrl
: The host url, the player will auto verify that the url is available or not.contentId
: The id is unique and it is used to fetch content data and related resourcescontentType
: An enum(ContentType) value that includes Videos, Lives and OfflineaccessToken
: Authorization tokendeviceId
: Settings.Secure.ANDROID_ID