From f47d1cbbd086f1605fbc5a718db371da3304f978 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Tue, 21 Jul 2020 10:21:38 +0530 Subject: [PATCH 01/18] - Added starter guide --- StarterGuide.md | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 StarterGuide.md diff --git a/StarterGuide.md b/StarterGuide.md new file mode 100644 index 00000000..e505c0ea --- /dev/null +++ b/StarterGuide.md @@ -0,0 +1,104 @@ +###Kaltura Player Design Checklist + +Before delving into setting up player in your app. We have a list to check. + +[Kaltura-Player] (https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html) - If you are a Kaltura customer then you should check +[OTT Customer] (https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OTTSamples) +[OVP Customer] (https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OVPSamples) + +In case, if you are not Kaltura customer then also no need to get worried, +Checkout our [Samples](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/BasicSamples) + +Kaltura player internally uses [Playkit](https://github.com/kaltura/playkit-android), [Kava Analytics](https://github.com/kaltura/playkit-android-kava), [Download To Go(Offline Downloads)] (https://github.com/kaltura/playkit-dtg-android) and [Providers(Only for Kaltura customers)](https://github.com/kaltura/playkit-android-providers) + +Apart from *Playkit*, to other libraries; we call them *Plugins*. [To Know More check this](https://kaltura.github.io/playkit/#components) + +Moving on there is another way to use player; so for that instead of using Kaltura Player, you can choose to use Playkit and based on your requirement, can choose for [IMA Ads Plugin](https://github.com/kaltura/playkit-android-ima), [Kava](https://github.com/kaltura/playkit-android-kava) / [Youbora Analytics Plugins](https://github.com/kaltura/playkit-android-youbora), [Offline Downloader](https://github.com/kaltura/playkit-dtg-android) or [Providers](https://github.com/kaltura/playkit-android-providers). + +These plugins are written in very efficient and customised way to make sure that the applications need to write very less code to make the functionality to work. + +####Using Playkit and Plugins Standalone + +1. You can use our customized Log levels. [Check this Page](https://kaltura.github.io/playkit/guide/android/core/logging.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L117) +2. You need to check if the device supports DRM or not. If you are lookging to play DRM protected content. [Check this page](https://kaltura.github.io/playkit/guide/android/core/drm.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L318) +3. You need to register the plugins as per your requirement. [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L287) +4. Get the media source and DRM info from Kaltura Backend. If you are a Kaltura Customer, + - **OTT Customer** This uses our OTT backend. You need to pass, OTT partner Id, OTT BE url, OTT Kaltura Session(KS), format and MediaId [Please check this sample code](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L357) + + - **OVP Customer:** This uses our OVP backend. You need to pass, OVP partner Id, OVP BE url, OVP Kaltura Session(KS) and EntryId [Please check this sample code](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L443) + + ######For both OTT/OVP customers, you will get the call back after calling to the respective BE, [get callback](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L298) + +5. You need to create MediaSource, MediaEntry and DRMParams manually. + + - **OTT/OVP Customers:** + + You will get `PKMediaEntry` in the callback of 3rd step. Now you need to create `PKMediaConfig`. + + `Player player = PlayKitManager.loadPlayer(this, pluginConfig);` + + Now you can modify and various features of player using player's settings api, `player.getSettings()` [Please check this to know more](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) + +6. **Add Player listeners:** [Please check this](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916) + + It helps to get Player and its plugins' events to handle application's UI controls like, on `pause` player event you want to change the UI of player to pause ico and turn to play icon on `play` event. + +7. Add your application's UI to `playerview`. For this simply define your layout in [xml layout](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/res/layout/activity_main.xml#L106) + + ``` + FrameLayout layout = (FrameLayout) findViewById(R.id.player_view); + layout.addView(player.getView()); + ``` + +8. **Non Kaltura Customers:** + + Here you go check out the following snippet, + + ``` + List pkDrmDataList = new ArrayList<>(); + String licenseUri = "DRM License URL"; + PKDrmParams pkDrmParams = new PKDrmParams(licenseUri, PKDrmParams.Scheme.WidevineCENC); + pkDrmDataList.add(pkDrmParams); + + List mediaSourceList = new ArrayList<>(); + PKMediaSource pkMediaSource = new PKMediaSource(); + pkMediaSource.setUrl("Media URL"); + pkMediaSource.setMediaFormat(PKMediaFormat.dash); + + pkMediaSource.setDrmData(pkDrmDataList); + + PKMediaEntry pkMediaEntry = new PKMediaEntry(); + + mediaSourceList.add(pkMediaSource); + + pkMediaEntry.setSources(mediaSourceList); + + PKMediaConfig config = new PKMediaConfig(); + config.setMediaEntry(pkMediaEntry); + + PKPluginConfigs pluginConfigs = new PKPluginConfigs(); + + player = PlayKitManager.loadPlayer(this, pluginConfigs); + + player.getSettings().setAllowCrossProtocolRedirect(true); + + FrameLayout layout = (FrameLayout) findViewById(R.id.player_view); + layout.addView(player.getView()); + + controlsView = (PlaybackControlsView) this.findViewById(R.id.playerControls); + controlsView.setPlayer(player); + ``` + +9. Now prepare the player using the mediaConfig which you prepared. + + ``` + player.prepare(mediaConfig); + player.play(); + ``` + +10. Now there is an option to configure the plugins before preparing the plugin. *Make Sure to check 3rd step to register plugins* [Check out the player configuration](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L709) + +11. You can use single Player instance and use the same for the next medias, It means if you want to change a media on next or previous button so just need to configure the session given in 4th step. + +12. You can update the plugins on the change media, [Check it out](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L532) + From 240a0ae6cc0e77964927118000d89e61eb754932 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Tue, 21 Jul 2020 10:24:20 +0530 Subject: [PATCH 02/18] - Added missing alignment --- StarterGuide.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index e505c0ea..9bf361c2 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -1,10 +1,10 @@ -###Kaltura Player Design Checklist +### Kaltura Player Design Checklist Before delving into setting up player in your app. We have a list to check. -[Kaltura-Player] (https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html) - If you are a Kaltura customer then you should check -[OTT Customer] (https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OTTSamples) -[OVP Customer] (https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OVPSamples) +[Kaltura-Player](https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html) - If you are a Kaltura customer then you should check +[OTT Customer](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OTTSamples) +[OVP Customer](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OVPSamples) In case, if you are not Kaltura customer then also no need to get worried, Checkout our [Samples](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/BasicSamples) @@ -17,7 +17,7 @@ Moving on there is another way to use player; so for that instead of using Kaltu These plugins are written in very efficient and customised way to make sure that the applications need to write very less code to make the functionality to work. -####Using Playkit and Plugins Standalone +#### Using Playkit and Plugins Standalone 1. You can use our customized Log levels. [Check this Page](https://kaltura.github.io/playkit/guide/android/core/logging.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L117) 2. You need to check if the device supports DRM or not. If you are lookging to play DRM protected content. [Check this page](https://kaltura.github.io/playkit/guide/android/core/drm.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L318) @@ -27,7 +27,7 @@ These plugins are written in very efficient and customised way to make sure that - **OVP Customer:** This uses our OVP backend. You need to pass, OVP partner Id, OVP BE url, OVP Kaltura Session(KS) and EntryId [Please check this sample code](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L443) - ######For both OTT/OVP customers, you will get the call back after calling to the respective BE, [get callback](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L298) + ###### For both OTT/OVP customers, you will get the call back after calling to the respective BE, [get callback](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L298) 5. You need to create MediaSource, MediaEntry and DRMParams manually. From a501422e8ca06cc516de81b07a118aedfe550b86 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Tue, 21 Jul 2020 15:49:26 +0530 Subject: [PATCH 03/18] - Addons --- StarterGuide.md | 67 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index 9bf361c2..8af575b1 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -9,7 +9,7 @@ Before delving into setting up player in your app. We have a list to check. In case, if you are not Kaltura customer then also no need to get worried, Checkout our [Samples](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/BasicSamples) -Kaltura player internally uses [Playkit](https://github.com/kaltura/playkit-android), [Kava Analytics](https://github.com/kaltura/playkit-android-kava), [Download To Go(Offline Downloads)] (https://github.com/kaltura/playkit-dtg-android) and [Providers(Only for Kaltura customers)](https://github.com/kaltura/playkit-android-providers) +Kaltura player internally uses [Playkit](https://github.com/kaltura/playkit-android), [Kava Analytics](https://github.com/kaltura/playkit-android-kava), [Download To Go(Offline Downloads)](https://github.com/kaltura/playkit-dtg-android) and [Providers(Only for Kaltura customers)](https://github.com/kaltura/playkit-android-providers) Apart from *Playkit*, to other libraries; we call them *Plugins*. [To Know More check this](https://kaltura.github.io/playkit/#components) @@ -37,7 +37,7 @@ These plugins are written in very efficient and customised way to make sure that `Player player = PlayKitManager.loadPlayer(this, pluginConfig);` - Now you can modify and various features of player using player's settings api, `player.getSettings()` [Please check this to know more](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) + Now you can modify and various features of player using player's settings api, `player.getSettings()` [Please check this to know more](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) ☟☟☟ 6. **Add Player listeners:** [Please check this](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916) @@ -52,13 +52,13 @@ These plugins are written in very efficient and customised way to make sure that 8. **Non Kaltura Customers:** - Here you go check out the following snippet, + Here you go check out the following snippet, - ``` - List pkDrmDataList = new ArrayList<>(); - String licenseUri = "DRM License URL"; - PKDrmParams pkDrmParams = new PKDrmParams(licenseUri, PKDrmParams.Scheme.WidevineCENC); - pkDrmDataList.add(pkDrmParams); + ``` + List pkDrmDataList = new ArrayList<>(); + String licenseUri = "DRM License URL"; + PKDrmParams pkDrmParams = new PKDrmParams(licenseUri, PKDrmParams.Scheme.WidevineCENC); + pkDrmDataList.add(pkDrmParams); List mediaSourceList = new ArrayList<>(); PKMediaSource pkMediaSource = new PKMediaSource(); @@ -86,8 +86,8 @@ These plugins are written in very efficient and customised way to make sure that layout.addView(player.getView()); controlsView = (PlaybackControlsView) this.findViewById(R.id.playerControls); - controlsView.setPlayer(player); - ``` + controlsView.setPlayer(player); ``` + 9. Now prepare the player using the mediaConfig which you prepared. @@ -102,3 +102,50 @@ These plugins are written in very efficient and customised way to make sure that 12. You can update the plugins on the change media, [Check it out](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L532) + +☟☟☟ + +***PlayerSettings:*** We are providing more details about the few settings to give more flexibility to the Player. For more details, [Check it out](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) + +- In case, if you want to provide customized referrer instead of default referrer in the manifest. Use if after Step-5 + + `KalturaPlaybackRequestAdapter.install(player, "app://PlaykitTestApp");` + +- In case, if you want to provide customized referrer instead of default referrer for DRM License request Adapter. Use if after Step-5 + + `KalturaUDRMLicenseRequestAdapter.install(player, "app://PlaykitTestApp");` + +- `setAllowCrossProtocolRedirect`: Decide if *player should do cross protocol redirect or not*. By default it will be always set to `false`. + +- `allowClearLead`: If you want the player to use the initial clear chunks; by using this flag, player will play the *initial clear chunks available in manifest*. + +- `enableDecoderFallback`: In case, if the device is not able to initialize the decoders then this flag if it is set to `true` will allow the player to use *low priority decoders.* + +- `setSecureSurface`: Decide if player should use secure rendering on the surface. Known limitation - when `useTextureView` set to `true` and `isSurfaceSecured` set to `true` *secure rendering will have no effect*. + +- `setABRSettings`: Adaptive bitrate settings. [Check it out](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/player/ABRSettings.java) + +- `forceSinglePlayerEngine`*Useful when you use IMA ads*: Default value is `false`. In general, we prepare the content player when Ad Starts; but settings this flag `true` will force the playe not prepare with Ads. Useful for the devices where the low/less decoders. + +- `setCustomLoadControlStrategy`: Load control strategy. [Check it out](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/player/LoadControlBuffers.java) + +- `setMaxVideoSize`: Sets the maximum allowed video width and height.To set the maximum allowed video bitrate to sd resolution call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(anySize).setMaxVideoHeight(anySize)` +To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX_VALUE).setMaxVideoHeight(Integer.MAX_VALUE)` + +- `setMaxVideoBitrate`: Sets the maximum allowed video bitrate. Maximum allowed video bitrate in bits per second. + + +♨♨♨ + +**Additional Information** + +1. If you are facing build conflicts, please check [this](https://kaltura.github.io/playkit/guide/android/migration/v3.6.0.html#plugin-interface) +2. If you want to check DRM info of Android device, [use our app](https://play.google.com/store/apps/details?id=com.kaltura.kalturadeviceinfo) +3. We have some know limitations. [Check it out](https://kaltura.github.io/playkit/guide/android/core/drm.html#known-limitations) +4. To know more about Player and Additional events. *For Step-6* [Check it out](https://kaltura.github.io/playkit/guide/android/core/events.html) +5. [Check the proguard configuration](https://kaltura.github.io/playkit/guide/android/core/proguard.html) +6. We have **warmup** feature. It helps to give quicker playback. [Check it out](https://kaltura.github.io/playkit/guide/android/core/http.html) +7. Profiling the player. [Check it out](https://kaltura.github.io/playkit/guide/android/core/profiler.html) +8. **Google Play Services Security Provider**. [Check it out](https://kaltura.github.io/playkit/guide/android/google/security-provider.html) +9. Check out about our [Offline-Manager](https://kaltura.github.io/playkit/guide/android/core/offline-manager.html) which is a successor of Dowload-To-Go. +10. Learn more about [Download-To-Go(Offline Downloader)](https://kaltura.github.io/playkit/guide/android/dtg/) From 5b8700d6615c2f5a50902a4b4acfd1dd6305d63a Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Tue, 21 Jul 2020 15:54:11 +0530 Subject: [PATCH 04/18] - Corrected formatting --- StarterGuide.md | 64 +++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index 8af575b1..a7cfa2f2 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -53,40 +53,36 @@ These plugins are written in very efficient and customised way to make sure that 8. **Non Kaltura Customers:** Here you go check out the following snippet, - - ``` - List pkDrmDataList = new ArrayList<>(); - String licenseUri = "DRM License URL"; - PKDrmParams pkDrmParams = new PKDrmParams(licenseUri, PKDrmParams.Scheme.WidevineCENC); - pkDrmDataList.add(pkDrmParams); - - List mediaSourceList = new ArrayList<>(); - PKMediaSource pkMediaSource = new PKMediaSource(); - pkMediaSource.setUrl("Media URL"); - pkMediaSource.setMediaFormat(PKMediaFormat.dash); - - pkMediaSource.setDrmData(pkDrmDataList); - - PKMediaEntry pkMediaEntry = new PKMediaEntry(); - - mediaSourceList.add(pkMediaSource); - - pkMediaEntry.setSources(mediaSourceList); - - PKMediaConfig config = new PKMediaConfig(); - config.setMediaEntry(pkMediaEntry); - - PKPluginConfigs pluginConfigs = new PKPluginConfigs(); - - player = PlayKitManager.loadPlayer(this, pluginConfigs); - - player.getSettings().setAllowCrossProtocolRedirect(true); - - FrameLayout layout = (FrameLayout) findViewById(R.id.player_view); - layout.addView(player.getView()); - - controlsView = (PlaybackControlsView) this.findViewById(R.id.playerControls); - controlsView.setPlayer(player); ``` + + ``` + List pkDrmDataList = new ArrayList<>(); + String licenseUri = "DRM License URL"; + PKDrmParams pkDrmParams = new PKDrmParams(licenseUri, PKDrmParams.Scheme.WidevineCENC); + pkDrmDataList.add(pkDrmParams); + + List mediaSourceList = new ArrayList<>(); + PKMediaSource pkMediaSource = new PKMediaSource(); + pkMediaSource.setUrl("Media URL"); + pkMediaSource.setMediaFormat(PKMediaFormat.dash); + + pkMediaSource.setDrmData(pkDrmDataList); + + PKMediaEntry pkMediaEntry = new PKMediaEntry(); + + mediaSourceList.add(pkMediaSource); + + pkMediaEntry.setSources(mediaSourceList); + + PKMediaConfig config = new PKMediaConfig(); + config.setMediaEntry(pkMediaEntry); + + PKPluginConfigs pluginConfigs = new PKPluginConfigs(); + + player = PlayKitManager.loadPlayer(this, pluginConfigs); + + player.getSettings().setAllowCrossProtocolRedirect(true); + ``` + 9. Now prepare the player using the mediaConfig which you prepared. From ebe165fc1519822efe939953887dffcd136a22e0 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Tue, 21 Jul 2020 15:56:37 +0530 Subject: [PATCH 05/18] - Corrected formatting --- StarterGuide.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index a7cfa2f2..454ef81a 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -37,18 +37,21 @@ These plugins are written in very efficient and customised way to make sure that `Player player = PlayKitManager.loadPlayer(this, pluginConfig);` - Now you can modify and various features of player using player's settings api, `player.getSettings()` [Please check this to know more](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) ☟☟☟ + Now you can modify and various features of player using player's settings api, `player.getSettings()` + + [Please check this to know more](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) ☟☟☟ 6. **Add Player listeners:** [Please check this](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916) It helps to get Player and its plugins' events to handle application's UI controls like, on `pause` player event you want to change the UI of player to pause ico and turn to play icon on `play` event. 7. Add your application's UI to `playerview`. For this simply define your layout in [xml layout](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/res/layout/activity_main.xml#L106) + + ``` + FrameLayout layout = (FrameLayout) findViewById(R.id.player_view); + layout.addView(player.getView()); + ``` - ``` - FrameLayout layout = (FrameLayout) findViewById(R.id.player_view); - layout.addView(player.getView()); - ``` 8. **Non Kaltura Customers:** From 10fc1cdfaa15ea628d22b1e28e22e58f134b1e89 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Tue, 21 Jul 2020 16:39:21 +0530 Subject: [PATCH 06/18] - Added Kaltura Player details --- StarterGuide.md | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index 454ef81a..25fddb96 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -1,4 +1,4 @@ -### Kaltura Player Design Checklist +## Kaltura Player Design Checklist Before delving into setting up player in your app. We have a list to check. @@ -17,7 +17,7 @@ Moving on there is another way to use player; so for that instead of using Kaltu These plugins are written in very efficient and customised way to make sure that the applications need to write very less code to make the functionality to work. -#### Using Playkit and Plugins Standalone +### ►Using Playkit and Plugins Standalone 1. You can use our customized Log levels. [Check this Page](https://kaltura.github.io/playkit/guide/android/core/logging.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L117) 2. You need to check if the device supports DRM or not. If you are lookging to play DRM protected content. [Check this page](https://kaltura.github.io/playkit/guide/android/core/drm.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L318) @@ -39,7 +39,7 @@ These plugins are written in very efficient and customised way to make sure that Now you can modify and various features of player using player's settings api, `player.getSettings()` - [Please check this to know more](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) ☟☟☟ + [Please check this to know more](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) ✝✝✝ 6. **Add Player listeners:** [Please check this](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916) @@ -51,7 +51,6 @@ These plugins are written in very efficient and customised way to make sure that FrameLayout layout = (FrameLayout) findViewById(R.id.player_view); layout.addView(player.getView()); ``` - 8. **Non Kaltura Customers:** @@ -102,9 +101,36 @@ These plugins are written in very efficient and customised way to make sure that 12. You can update the plugins on the change media, [Check it out](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L532) -☟☟☟ -***PlayerSettings:*** We are providing more details about the few settings to give more flexibility to the Player. For more details, [Check it out](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) +### ►Using Kaltura Player and Plugins Standalone + +1. As we know that **Kaltura-Player** uses [Playkit](https://github.com/kaltura/playkit-android), [Kava Analytics](https://github.com/kaltura/playkit-android-kava), [Download To Go(Offline Downloads)](https://github.com/kaltura/playkit-dtg-android) and [Providers(Only for Kaltura customers)](https://github.com/kaltura/playkit-android-providers). It has three Players ***Basic Player***, **OTT Player** and **OVP Player**. + +2. Like the way, we configured the plugins, need to configure that. [Check it out](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L674) + +3. You need to create an object of `PlayerInitOptions`, this is same like `PlayerSettings`✝✝✝ + +4. Create KalturaPlayer based on your requirement [Check it out](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L306) + +5. Now load `KalturaPlayer`, [Use OTT Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L366), [Use OVP Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L391) and [Use Basic Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L348) + +6. Add your application's UI to `playerview`. For this simply define your layout in [xml layout](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/res/layout/activity_main.xml#L106) + + ``` + player?.setPlayerView(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT) + val container = findViewById(R.id.player_view) + container.addView(player?.playerView) + ``` +7. Add the player and other plugin's listeners [Check it out](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L852) + + + +-- + + +✝✝✝ + +***►PlayerSettings:*** We are providing more details about the few settings to give more flexibility to the Player. For more details, [Check it out](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) - In case, if you want to provide customized referrer instead of default referrer in the manifest. Use if after Step-5 @@ -136,7 +162,7 @@ To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX ♨♨♨ -**Additional Information** +**►Additional Information** 1. If you are facing build conflicts, please check [this](https://kaltura.github.io/playkit/guide/android/migration/v3.6.0.html#plugin-interface) 2. If you want to check DRM info of Android device, [use our app](https://play.google.com/store/apps/details?id=com.kaltura.kalturadeviceinfo) @@ -148,3 +174,10 @@ To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX 8. **Google Play Services Security Provider**. [Check it out](https://kaltura.github.io/playkit/guide/android/google/security-provider.html) 9. Check out about our [Offline-Manager](https://kaltura.github.io/playkit/guide/android/core/offline-manager.html) which is a successor of Dowload-To-Go. 10. Learn more about [Download-To-Go(Offline Downloader)](https://kaltura.github.io/playkit/guide/android/dtg/) +11. To know more about [***Kaltura Player***](https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html) +12. We support VR/360 content as well. [Check it out](https://kaltura.github.io/playkit/guide/android/core/vr.html) +13. If you are a Kaltura customer then you must be using our Backend so you can check our `GetPlaybackContext` API using the [OVP Endpoint check](https://kaltura.github.io/playkit/tools/gpc) and [OTT Endpoint check](https://kaltura.github.io/playkit/tools/gpc-ott) +14. Know more about our [Phoenix Media Provider](https://kaltura.github.io/playkit/guide/common/ott-media-provider.html) +15. Know more about [OVP Basics](https://kaltura.github.io/playkit/guide/common/ovp-basics.html) +16. Check out our awesome and continuosly updated samples, [Kaltura Player Samples](https://github.com/kaltura/kaltura-player-android-samples) and [Playkit Sample with Plugins](https://github.com/kaltura/playkit-android-samples) + From 7b8679c0b2d051ea18364368782fb49b778f305b Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Tue, 21 Jul 2020 17:24:52 +0530 Subject: [PATCH 07/18] - Addons --- StarterGuide.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/StarterGuide.md b/StarterGuide.md index 25fddb96..026cecf5 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -160,6 +160,27 @@ To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX - `setMaxVideoBitrate`: Sets the maximum allowed video bitrate. Maximum allowed video bitrate in bits per second. +☁☁☁ +**►Key points to remember** + +1. Sometimes, developers face issue where they see that player is still alive and eventually may find any memory leak. +➟ To solve this, make sure you destroy the player and remove the player listeners while destorying the activity/fragment. [Check it out](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L907) + +2. Make sure to call [`player.onApplicationPaused()`](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L895) in `onPause()` of call [`player.onApplicationResumed()`](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L1141) + +3. How to handle Internet connection/disconnection. +➟ Make sure that you check the internet before preparing the player. There shall be a case where internet can go off where player will retry for defined times[ It sends `Load_Error` in this case that is why it is *Recoverable* ] then it eventually will throw `Source_Error`[ It is *Fatal* error ] + +4. We throw various Player Errors [check it out](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/player/PKPlayerErrorType.java). +➟ Application can get it in `PKError` object. We provide `Severity`, `message`, `exception`, `errorType` and `errorCategory`. +`Severity` is `Recoverable` and some are `Fatal`. +We send [`PKErrorCategory`](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/PKErrorCategory.java), which can be `Load` and `Play` + +5. Checkout out [FullDemo](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916) to understand more about Events. + +6. Checkout out working and well maintained fully functional samples of [Playkit and its Plugins](https://github.com/kaltura/playkit-android-samples/tree/develop/FullDemo) and [Kaltura Player Sample](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/AdvancedSamples/TestApp) + + ♨♨♨ **►Additional Information** @@ -179,5 +200,5 @@ To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX 13. If you are a Kaltura customer then you must be using our Backend so you can check our `GetPlaybackContext` API using the [OVP Endpoint check](https://kaltura.github.io/playkit/tools/gpc) and [OTT Endpoint check](https://kaltura.github.io/playkit/tools/gpc-ott) 14. Know more about our [Phoenix Media Provider](https://kaltura.github.io/playkit/guide/common/ott-media-provider.html) 15. Know more about [OVP Basics](https://kaltura.github.io/playkit/guide/common/ovp-basics.html) -16. Check out our awesome and continuosly updated samples, [Kaltura Player Samples](https://github.com/kaltura/kaltura-player-android-samples) and [Playkit Sample with Plugins](https://github.com/kaltura/playkit-android-samples) +16. If you want to understand more about the individual functionalities like, Subtitles, IMA Ads, Chromecast, Analytics. Please check [Playkit and its Plugins](https://github.com/kaltura/playkit-android-samples) and [Kaltura Player Sample](https://github.com/kaltura/kaltura-player-android-samples). From 857efc09b646bc95fb4950e065f69c063a3227ce Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Tue, 21 Jul 2020 17:26:29 +0530 Subject: [PATCH 08/18] - Corrected formatting --- StarterGuide.md | 1 + 1 file changed, 1 insertion(+) diff --git a/StarterGuide.md b/StarterGuide.md index 026cecf5..9efb51ac 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -161,6 +161,7 @@ To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX ☁☁☁ + **►Key points to remember** 1. Sometimes, developers face issue where they see that player is still alive and eventually may find any memory leak. From 7e71e78c53c09e7f4eea03ae08e9de38beb9c4ca Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Wed, 22 Jul 2020 10:43:30 +0530 Subject: [PATCH 09/18] - Added missing alignment --- StarterGuide.md | 64 +++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index 9efb51ac..1fd3187f 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -1,6 +1,8 @@ -## Kaltura Player Design Checklist +

+

Kaltura Player Design Checklist

+

-Before delving into setting up player in your app. We have a list to check. +Before delving into setting up player in your app or if you are currently using our player; we want to you to please go through this simple doc where we have explained the key features of player and will talk about critical points to remember. We tried explaining this based on our prior experience with customers. [Kaltura-Player](https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html) - If you are a Kaltura customer then you should check [OTT Customer](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OTTSamples) @@ -17,7 +19,11 @@ Moving on there is another way to use player; so for that instead of using Kaltu These plugins are written in very efficient and customised way to make sure that the applications need to write very less code to make the functionality to work. -### ►Using Playkit and Plugins Standalone +

+

►Using Playkit and Plugins Standalone

+

+ +We have defined Steps to check and use the following while integrating to your application. 1. You can use our customized Log levels. [Check this Page](https://kaltura.github.io/playkit/guide/android/core/logging.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L117) 2. You need to check if the device supports DRM or not. If you are lookging to play DRM protected content. [Check this page](https://kaltura.github.io/playkit/guide/android/core/drm.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L318) @@ -29,17 +35,17 @@ These plugins are written in very efficient and customised way to make sure that ###### For both OTT/OVP customers, you will get the call back after calling to the respective BE, [get callback](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L298) -5. You need to create MediaSource, MediaEntry and DRMParams manually. +5. You need to create MediaSource, MediaEntry. - - **OTT/OVP Customers:** - - You will get `PKMediaEntry` in the callback of 3rd step. Now you need to create `PKMediaConfig`. + **OTT/OVP Customers:** You will get `PKMediaEntry` in the callback of 3rd step. Now you need to create `PKMediaConfig`. [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L304) - `Player player = PlayKitManager.loadPlayer(this, pluginConfig);` + `Player player = PlayKitManager.loadPlayer(this, pluginConfig);` - Now you can modify and various features of player using player's settings api, `player.getSettings()` + Now you can modify and various features of player using player's settings api, `player.getSettings()` - [Please check this to know more](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) ✝✝✝ + [Please check this to know more about Settings](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) ✝✝✝ + + **Non Kaltura customers:** Please check 8th point. 6. **Add Player listeners:** [Please check this](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916) @@ -101,14 +107,15 @@ These plugins are written in very efficient and customised way to make sure that 12. You can update the plugins on the change media, [Check it out](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L532) - -### ►Using Kaltura Player and Plugins Standalone +

+

►Using Kaltura Player and Plugins Standalone

+

1. As we know that **Kaltura-Player** uses [Playkit](https://github.com/kaltura/playkit-android), [Kava Analytics](https://github.com/kaltura/playkit-android-kava), [Download To Go(Offline Downloads)](https://github.com/kaltura/playkit-dtg-android) and [Providers(Only for Kaltura customers)](https://github.com/kaltura/playkit-android-providers). It has three Players ***Basic Player***, **OTT Player** and **OVP Player**. 2. Like the way, we configured the plugins, need to configure that. [Check it out](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L674) -3. You need to create an object of `PlayerInitOptions`, this is same like `PlayerSettings`✝✝✝ +3. You need to create an object of `PlayerInitOptions`, this is same like `PlayerSettings`✝ 4. Create KalturaPlayer based on your requirement [Check it out](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L306) @@ -127,8 +134,7 @@ These plugins are written in very efficient and customised way to make sure that -- - -✝✝✝ +✝ ***►PlayerSettings:*** We are providing more details about the few settings to give more flexibility to the Player. For more details, [Check it out](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) @@ -160,31 +166,37 @@ To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX - `setMaxVideoBitrate`: Sets the maximum allowed video bitrate. Maximum allowed video bitrate in bits per second. -☁☁☁ +

+

☁ Key points to remember

+

+ +1. You need to check if the device supports DRM or not. If you are lookging to play DRM protected content. An application that uses DRM should call the following API as early as possible (if applicable, in the splash screen): -**►Key points to remember** + `MediaSupport.initializeDrm(Context, DrmInitCallback)` + + Calling this function makes sure that the DRM subsystem (in particular, Widevine) is ready before playback starts. In some cases, devices have to be provisioned to use Widevine, a process that involves connecting to a Google service over the network. [Check this out to know more](https://kaltura.github.io/playkit/guide/android/core/drm.html) [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L117) -1. Sometimes, developers face issue where they see that player is still alive and eventually may find any memory leak. +2. Sometimes, developers face issue where they see that player is still alive and eventually may find any memory leak. ➟ To solve this, make sure you destroy the player and remove the player listeners while destorying the activity/fragment. [Check it out](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L907) -2. Make sure to call [`player.onApplicationPaused()`](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L895) in `onPause()` of call [`player.onApplicationResumed()`](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L1141) +3. Make sure to call [`player.onApplicationPaused()`](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L895) in `onPause()` of call [`player.onApplicationResumed()`](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L1141) -3. How to handle Internet connection/disconnection. +4. How to handle Internet connection/disconnection. ➟ Make sure that you check the internet before preparing the player. There shall be a case where internet can go off where player will retry for defined times[ It sends `Load_Error` in this case that is why it is *Recoverable* ] then it eventually will throw `Source_Error`[ It is *Fatal* error ] -4. We throw various Player Errors [check it out](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/player/PKPlayerErrorType.java). +5. We throw various Player Errors [check it out](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/player/PKPlayerErrorType.java). ➟ Application can get it in `PKError` object. We provide `Severity`, `message`, `exception`, `errorType` and `errorCategory`. `Severity` is `Recoverable` and some are `Fatal`. We send [`PKErrorCategory`](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/PKErrorCategory.java), which can be `Load` and `Play` -5. Checkout out [FullDemo](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916) to understand more about Events. - -6. Checkout out working and well maintained fully functional samples of [Playkit and its Plugins](https://github.com/kaltura/playkit-android-samples/tree/develop/FullDemo) and [Kaltura Player Sample](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/AdvancedSamples/TestApp) +6. Checkout out [FullDemo](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916) to understand more about Events. +7. Checkout out working and well maintained fully functional samples of [Playkit and its Plugins](https://github.com/kaltura/playkit-android-samples/tree/develop/FullDemo) and [Kaltura Player Sample](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/AdvancedSamples/TestApp) -♨♨♨ -**►Additional Information** +

+

♨ Important Information

+

1. If you are facing build conflicts, please check [this](https://kaltura.github.io/playkit/guide/android/migration/v3.6.0.html#plugin-interface) 2. If you want to check DRM info of Android device, [use our app](https://play.google.com/store/apps/details?id=com.kaltura.kalturadeviceinfo) From 346d4a1358c083495aac03e487730a9333502b27 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Wed, 22 Jul 2020 10:46:15 +0530 Subject: [PATCH 10/18] - Corrected formatting --- StarterGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StarterGuide.md b/StarterGuide.md index 1fd3187f..7c4fc4f0 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -43,7 +43,7 @@ We have defined Steps to check and use the following while integrating to your a Now you can modify and various features of player using player's settings api, `player.getSettings()` - [Please check this to know more about Settings](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) ✝✝✝ + [Please check this to know more about Settings](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) ✝ **Non Kaltura customers:** Please check 8th point. From e855a98232a19cc635df1b4080becde50b6200c9 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Wed, 22 Jul 2020 12:12:32 +0530 Subject: [PATCH 11/18] - Corrected formatting --- StarterGuide.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index 7c4fc4f0..18813a95 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -43,7 +43,7 @@ We have defined Steps to check and use the following while integrating to your a Now you can modify and various features of player using player's settings api, `player.getSettings()` - [Please check this to know more about Settings](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) ✝ + [Please check this to know more about Settings](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) **Non Kaltura customers:** Please check 8th point. @@ -60,12 +60,12 @@ We have defined Steps to check and use the following while integrating to your a 8. **Non Kaltura Customers:** - Here you go check out the following snippet, + Here you go check out the following snippet - ``` + ``` List pkDrmDataList = new ArrayList<>(); String licenseUri = "DRM License URL"; - PKDrmParams pkDrmParams = new PKDrmParams(licenseUri, PKDrmParams.Scheme.WidevineCENC); + PKDrmParams pkDrmParams = new PKDrmParams(licenseUri,PKDrmParams.Scheme.WidevineCENC); pkDrmDataList.add(pkDrmParams); List mediaSourceList = new ArrayList<>(); @@ -89,7 +89,7 @@ We have defined Steps to check and use the following while integrating to your a player = PlayKitManager.loadPlayer(this, pluginConfigs); player.getSettings().setAllowCrossProtocolRedirect(true); - ``` + ``` @@ -115,7 +115,7 @@ We have defined Steps to check and use the following while integrating to your a 2. Like the way, we configured the plugins, need to configure that. [Check it out](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L674) -3. You need to create an object of `PlayerInitOptions`, this is same like `PlayerSettings`✝ +3. You need to create an object of `PlayerInitOptions`, this is same like `PlayerSettings` 4. Create KalturaPlayer based on your requirement [Check it out](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L306) @@ -134,8 +134,6 @@ We have defined Steps to check and use the following while integrating to your a -- -✝ - ***►PlayerSettings:*** We are providing more details about the few settings to give more flexibility to the Player. For more details, [Check it out](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) - In case, if you want to provide customized referrer instead of default referrer in the manifest. Use if after Step-5 From 9f2f74e202ff6fbe76835b56fee6cbf89cd7acb7 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Wed, 22 Jul 2020 17:27:18 +0530 Subject: [PATCH 12/18] - Corrected formatting --- StarterGuide.md | 152 ++++++++++++++++++++++++------------------------ 1 file changed, 75 insertions(+), 77 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index 18813a95..b2ccf3de 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -2,22 +2,46 @@

Kaltura Player Design Checklist

-Before delving into setting up player in your app or if you are currently using our player; we want to you to please go through this simple doc where we have explained the key features of player and will talk about critical points to remember. We tried explaining this based on our prior experience with customers. +Before delving into setting up player in your app or if you are currently using our player; we want you to please go through this simple doc where we have explained the key features of player and will talk about critical points to take an account. We tried explaining this based on our prior experience with customers. -[Kaltura-Player](https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html) - If you are a Kaltura customer then you should check -[OTT Customer](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OTTSamples) -[OVP Customer](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OVPSamples) +[Kaltura-Player](https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html) - If you are using Kaltura backend then you might want to check +[OTT Backend Customer Sample Code](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OTTSamples) OR +[OVP Backend Customer Sample Code](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OVPSamples). -In case, if you are not Kaltura customer then also no need to get worried, -Checkout our [Samples](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/BasicSamples) +In case, if you are not using Kaltura backend then also you might want to check, our [Basic Sample Code](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/BasicSamples). -Kaltura player internally uses [Playkit](https://github.com/kaltura/playkit-android), [Kava Analytics](https://github.com/kaltura/playkit-android-kava), [Download To Go(Offline Downloads)](https://github.com/kaltura/playkit-dtg-android) and [Providers(Only for Kaltura customers)](https://github.com/kaltura/playkit-android-providers) +Kaltura player internally uses [Playkit](https://github.com/kaltura/playkit-android), [Kava Analytics](https://github.com/kaltura/playkit-android-kava), [Download To Go(Offline Downloads)](https://github.com/kaltura/playkit-dtg-android) and [Media Providers (Only for Kaltura backend customers)](https://github.com/kaltura/playkit-android-providers). -Apart from *Playkit*, to other libraries; we call them *Plugins*. [To Know More check this](https://kaltura.github.io/playkit/#components) +Apart from *Playkit Core Player*, to other libraries; we call *Plugins*. [To Know More check this](https://kaltura.github.io/playkit/#components) -Moving on there is another way to use player; so for that instead of using Kaltura Player, you can choose to use Playkit and based on your requirement, can choose for [IMA Ads Plugin](https://github.com/kaltura/playkit-android-ima), [Kava](https://github.com/kaltura/playkit-android-kava) / [Youbora Analytics Plugins](https://github.com/kaltura/playkit-android-youbora), [Offline Downloader](https://github.com/kaltura/playkit-dtg-android) or [Providers](https://github.com/kaltura/playkit-android-providers). +In Kaltura Player, you can add extra plugins as per your requirement [IMA SDK](https://github.com/kaltura/playkit-android-ima), [Youbora Analytics](https://github.com/kaltura/playkit-android-youbora), [Chromecast](https://github.com/kaltura/playkit-android-googlecast), [VR/360](https://github.com/kaltura/playkit-android-vr) + + +

+

►Using Kaltura Player and Plugins Standalone

+

+ +1. As we know that **Kaltura-Player** uses [Playkit](https://github.com/kaltura/playkit-android), [Kava Analytics](https://github.com/kaltura/playkit-android-kava), [Download To Go(Offline Downloads)](https://github.com/kaltura/playkit-dtg-android) and [Providers(Only for Kaltura backend customers)](https://github.com/kaltura/playkit-android-providers). It has three Players ***Basic Player***, ***OTT Player*** and ***OVP Player***. + +2. Intitalize the Player [Initialize OVP Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/OVPSamples/BasicSetup/app/src/main/java/com/kaltura/playkit/samples/basicsample/DemoApplication.kt#L13), [Initialize OTT Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/OTTSamples/BasicSetup/app/src/main/java/com/kaltura/playkit/samples/basicsample/DemoApplication.kt#L13). There is no need to do this for Basic Player. + +3. You need to configure Plugins. [Code Sample](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L674). + +4. You need to create an object of `PlayerInitOptions`, this has the same properties like `PlayerSettings`. + +5. Create KalturaPlayer based on your requirement [Code Sample](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L306). + +6. Now load `KalturaPlayer`, [Use OTT Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L366), [Use OVP Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L391) and [Use Basic Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L348). + +7. Add your application's UI to `playerview`. For this simply define your layout in [xml layout](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/res/layout/activity_main.xml#L106). + + ``` + player?.setPlayerView(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT) + val container = findViewById(R.id.player_view) + container.addView(player?.playerView) + ``` +8. Add the player and other plugin's listeners [Code Sample](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L852). -These plugins are written in very efficient and customised way to make sure that the applications need to write very less code to make the functionality to work.

►Using Playkit and Plugins Standalone

@@ -25,42 +49,42 @@ These plugins are written in very efficient and customised way to make sure that We have defined Steps to check and use the following while integrating to your application. -1. You can use our customized Log levels. [Check this Page](https://kaltura.github.io/playkit/guide/android/core/logging.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L117) -2. You need to check if the device supports DRM or not. If you are lookging to play DRM protected content. [Check this page](https://kaltura.github.io/playkit/guide/android/core/drm.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L318) -3. You need to register the plugins as per your requirement. [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L287) -4. Get the media source and DRM info from Kaltura Backend. If you are a Kaltura Customer, - - **OTT Customer** This uses our OTT backend. You need to pass, OTT partner Id, OTT BE url, OTT Kaltura Session(KS), format and MediaId [Please check this sample code](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L357) +1. You can use our customized Log levels. [Check this Page](https://kaltura.github.io/playkit/guide/android/core/logging.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L117). +2. You need to check if the device supports DRM or not. If you are lookging to play DRM protected content. [Check this page](https://kaltura.github.io/playkit/guide/android/core/drm.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L318). +3. You need to register the plugins as per your requirement. [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L287). +4. Get the media source and DRM info from Kaltura Backend. If you are a Kaltura backend customer, + - **OTT Backend Customer** This uses our OTT backend. You need to pass, OTT partner Id, OTT BE url, OTT Kaltura Session(KS), format and MediaId [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L357). - - **OVP Customer:** This uses our OVP backend. You need to pass, OVP partner Id, OVP BE url, OVP Kaltura Session(KS) and EntryId [Please check this sample code](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L443) + - **OVP Backend Customer:** This uses our OVP backend. You need to pass, OVP partner Id, OVP BE url, OVP Kaltura Session(KS) and EntryId [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L443). - ###### For both OTT/OVP customers, you will get the call back after calling to the respective BE, [get callback](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L298) + ###### For both OTT/OVP backend customers, you will get the call back after calling to the respective BE, [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L298). 5. You need to create MediaSource, MediaEntry. - **OTT/OVP Customers:** You will get `PKMediaEntry` in the callback of 3rd step. Now you need to create `PKMediaConfig`. [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L304) + **OTT/OVP Backend Customers:** You will get `PKMediaEntry` in the callback of 3rd step. Now you need to create `PKMediaConfig`. [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L304). `Player player = PlayKitManager.loadPlayer(this, pluginConfig);` - Now you can modify and various features of player using player's settings api, `player.getSettings()` + Now you can modify and various features of player using player's settings API, `player.getSettings()` - [Please check this to know more about Settings](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) + [Please check this to know more about Settings](https://kaltura.github.io/playkit/guide/android/core/player-settings.html). - **Non Kaltura customers:** Please check 8th point. + **Non Kaltura backend customers:** Please check ***8th point***. -6. **Add Player listeners:** [Please check this](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916) +6. **Add Player listeners:** [Please check this](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916). It helps to get Player and its plugins' events to handle application's UI controls like, on `pause` player event you want to change the UI of player to pause ico and turn to play icon on `play` event. -7. Add your application's UI to `playerview`. For this simply define your layout in [xml layout](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/res/layout/activity_main.xml#L106) +7. Add your application's UI to `playerview`. For this simply define your layout in [xml layout](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/res/layout/activity_main.xml#L106). ``` FrameLayout layout = (FrameLayout) findViewById(R.id.player_view); layout.addView(player.getView()); ``` -8. **Non Kaltura Customers:** +8. **Non Kaltura Backend Customers:** - Here you go check out the following snippet + Here you go check out the following snippet ``` List pkDrmDataList = new ArrayList<>(); @@ -100,47 +124,21 @@ We have defined Steps to check and use the following while integrating to your a player.play(); ``` -10. Now there is an option to configure the plugins before preparing the plugin. *Make Sure to check 3rd step to register plugins* [Check out the player configuration](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L709) +10. Now there is an option to configure the plugins before preparing the plugin. *Make Sure to check 3rd step to register plugins* [Code Sample for player configuration](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L709). 11. You can use single Player instance and use the same for the next medias, It means if you want to change a media on next or previous button so just need to configure the session given in 4th step. -12. You can update the plugins on the change media, [Check it out](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L532) - - -

-

►Using Kaltura Player and Plugins Standalone

-

- -1. As we know that **Kaltura-Player** uses [Playkit](https://github.com/kaltura/playkit-android), [Kava Analytics](https://github.com/kaltura/playkit-android-kava), [Download To Go(Offline Downloads)](https://github.com/kaltura/playkit-dtg-android) and [Providers(Only for Kaltura customers)](https://github.com/kaltura/playkit-android-providers). It has three Players ***Basic Player***, **OTT Player** and **OVP Player**. - -2. Like the way, we configured the plugins, need to configure that. [Check it out](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L674) - -3. You need to create an object of `PlayerInitOptions`, this is same like `PlayerSettings` - -4. Create KalturaPlayer based on your requirement [Check it out](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L306) - -5. Now load `KalturaPlayer`, [Use OTT Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L366), [Use OVP Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L391) and [Use Basic Player](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L348) - -6. Add your application's UI to `playerview`. For this simply define your layout in [xml layout](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/res/layout/activity_main.xml#L106) - - ``` - player?.setPlayerView(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT) - val container = findViewById(R.id.player_view) - container.addView(player?.playerView) - ``` -7. Add the player and other plugin's listeners [Check it out](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L852) - - +12. You can update the plugins on the change media, [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L532). -- -***►PlayerSettings:*** We are providing more details about the few settings to give more flexibility to the Player. For more details, [Check it out](https://kaltura.github.io/playkit/guide/android/core/player-settings.html) +***►PlayerSettings:*** We are providing more details about the few settings to give more flexibility to the Player. For more details, [Check this page](https://kaltura.github.io/playkit/guide/android/core/player-settings.html). -- In case, if you want to provide customized referrer instead of default referrer in the manifest. Use if after Step-5 +- In case, if you want to provide customized referrer instead of default referrer in the manifest. Use if after ***Step-5***. `KalturaPlaybackRequestAdapter.install(player, "app://PlaykitTestApp");` -- In case, if you want to provide customized referrer instead of default referrer for DRM License request Adapter. Use if after Step-5 +- In case, if you want to provide customized referrer instead of default referrer for DRM License request Adapter. Use if after ***Step-5***. `KalturaUDRMLicenseRequestAdapter.install(player, "app://PlaykitTestApp");` @@ -152,14 +150,14 @@ We have defined Steps to check and use the following while integrating to your a - `setSecureSurface`: Decide if player should use secure rendering on the surface. Known limitation - when `useTextureView` set to `true` and `isSurfaceSecured` set to `true` *secure rendering will have no effect*. -- `setABRSettings`: Adaptive bitrate settings. [Check it out](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/player/ABRSettings.java) +- `setABRSettings`: Adaptive bitrate settings. [Check it out](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/player/ABRSettings.java). - `forceSinglePlayerEngine`*Useful when you use IMA ads*: Default value is `false`. In general, we prepare the content player when Ad Starts; but settings this flag `true` will force the playe not prepare with Ads. Useful for the devices where the low/less decoders. -- `setCustomLoadControlStrategy`: Load control strategy. [Check it out](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/player/LoadControlBuffers.java) +- `setCustomLoadControlStrategy`: Load control strategy. [Check it out](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/player/LoadControlBuffers.java). -- `setMaxVideoSize`: Sets the maximum allowed video width and height.To set the maximum allowed video bitrate to sd resolution call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(anySize).setMaxVideoHeight(anySize)` -To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX_VALUE).setMaxVideoHeight(Integer.MAX_VALUE)` +- `setMaxVideoSize`: Sets the maximum allowed video width and height.To set the maximum allowed video bitrate to sd resolution call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(anySize).setMaxVideoHeight(anySize)`. +To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX_VALUE).setMaxVideoHeight(Integer.MAX_VALUE)`. - `setMaxVideoBitrate`: Sets the maximum allowed video bitrate. Maximum allowed video bitrate in bits per second. @@ -180,36 +178,36 @@ To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX 3. Make sure to call [`player.onApplicationPaused()`](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L895) in `onPause()` of call [`player.onApplicationResumed()`](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L1141) 4. How to handle Internet connection/disconnection. -➟ Make sure that you check the internet before preparing the player. There shall be a case where internet can go off where player will retry for defined times[ It sends `Load_Error` in this case that is why it is *Recoverable* ] then it eventually will throw `Source_Error`[ It is *Fatal* error ] +➟ Make sure that you check the internet before preparing the player. There shall be a case where internet can go off where player will retry for defined times[ It sends `Load_Error` in this case that is why it is *Recoverable* ] then it eventually will throw `Source_Error`[ It is *Fatal* error ]. 5. We throw various Player Errors [check it out](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/player/PKPlayerErrorType.java). ➟ Application can get it in `PKError` object. We provide `Severity`, `message`, `exception`, `errorType` and `errorCategory`. `Severity` is `Recoverable` and some are `Fatal`. -We send [`PKErrorCategory`](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/PKErrorCategory.java), which can be `Load` and `Play` +We send [`PKErrorCategory`](https://github.com/kaltura/playkit-android/blob/dev/playkit/src/main/java/com/kaltura/playkit/PKErrorCategory.java), which can be `Load` and `Play`. 6. Checkout out [FullDemo](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L916) to understand more about Events. -7. Checkout out working and well maintained fully functional samples of [Playkit and its Plugins](https://github.com/kaltura/playkit-android-samples/tree/develop/FullDemo) and [Kaltura Player Sample](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/AdvancedSamples/TestApp) +7. Checkout out working and well maintained fully functional samples of [Playkit and its Plugins](https://github.com/kaltura/playkit-android-samples/tree/develop/FullDemo) and [Kaltura Player Sample](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/AdvancedSamples/TestApp).

♨ Important Information

-1. If you are facing build conflicts, please check [this](https://kaltura.github.io/playkit/guide/android/migration/v3.6.0.html#plugin-interface) -2. If you want to check DRM info of Android device, [use our app](https://play.google.com/store/apps/details?id=com.kaltura.kalturadeviceinfo) -3. We have some know limitations. [Check it out](https://kaltura.github.io/playkit/guide/android/core/drm.html#known-limitations) -4. To know more about Player and Additional events. *For Step-6* [Check it out](https://kaltura.github.io/playkit/guide/android/core/events.html) -5. [Check the proguard configuration](https://kaltura.github.io/playkit/guide/android/core/proguard.html) -6. We have **warmup** feature. It helps to give quicker playback. [Check it out](https://kaltura.github.io/playkit/guide/android/core/http.html) -7. Profiling the player. [Check it out](https://kaltura.github.io/playkit/guide/android/core/profiler.html) -8. **Google Play Services Security Provider**. [Check it out](https://kaltura.github.io/playkit/guide/android/google/security-provider.html) +1. If you are facing build conflicts, please check [this](https://kaltura.github.io/playkit/guide/android/migration/v3.6.0.html#plugin-interface). +2. If you want to check DRM info of Android device, [use our app](https://play.google.com/store/apps/details?id=com.kaltura.kalturadeviceinfo). +3. We have some know limitations. [Check it out](https://kaltura.github.io/playkit/guide/android/core/drm.html#known-limitations). +4. To know more about Player and Additional events. *For Step-6* [Check it out](https://kaltura.github.io/playkit/guide/android/core/events.html). +5. [Check the proguard configuration](https://kaltura.github.io/playkit/guide/android/core/proguard.html). +6. We have **warmup** feature. It helps to give quicker playback. [Check it out](https://kaltura.github.io/playkit/guide/android/core/http.html). +7. Profiling the player. [Check it out](https://kaltura.github.io/playkit/guide/android/core/profiler.html). +8. **Google Play Services Security Provider**. [Check it out](https://kaltura.github.io/playkit/guide/android/google/security-provider.html). 9. Check out about our [Offline-Manager](https://kaltura.github.io/playkit/guide/android/core/offline-manager.html) which is a successor of Dowload-To-Go. -10. Learn more about [Download-To-Go(Offline Downloader)](https://kaltura.github.io/playkit/guide/android/dtg/) -11. To know more about [***Kaltura Player***](https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html) -12. We support VR/360 content as well. [Check it out](https://kaltura.github.io/playkit/guide/android/core/vr.html) -13. If you are a Kaltura customer then you must be using our Backend so you can check our `GetPlaybackContext` API using the [OVP Endpoint check](https://kaltura.github.io/playkit/tools/gpc) and [OTT Endpoint check](https://kaltura.github.io/playkit/tools/gpc-ott) -14. Know more about our [Phoenix Media Provider](https://kaltura.github.io/playkit/guide/common/ott-media-provider.html) -15. Know more about [OVP Basics](https://kaltura.github.io/playkit/guide/common/ovp-basics.html) +10. Learn more about [Download-To-Go(Offline Downloader)](https://kaltura.github.io/playkit/guide/android/dtg/). +11. To know more about [***Kaltura Player***](https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html). +12. We support VR/360 content as well. [Check it out](https://kaltura.github.io/playkit/guide/android/core/vr.html). +13. If you are a Kaltura backend customer then you must be using our Backend so you can check our `GetPlaybackContext` API using the [OVP Endpoint check](https://kaltura.github.io/playkit/tools/gpc) and [OTT Endpoint check](https://kaltura.github.io/playkit/tools/gpc-ott). +14. Know more about our [Phoenix Media Provider](https://kaltura.github.io/playkit/guide/common/ott-media-provider.html). +15. Know more about [OVP Basics](https://kaltura.github.io/playkit/guide/common/ovp-basics.html). 16. If you want to understand more about the individual functionalities like, Subtitles, IMA Ads, Chromecast, Analytics. Please check [Playkit and its Plugins](https://github.com/kaltura/playkit-android-samples) and [Kaltura Player Sample](https://github.com/kaltura/kaltura-player-android-samples). From a0cbb334f8d5417e5a9f050d541cd25af3807cf6 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Wed, 12 Aug 2020 16:10:56 +0530 Subject: [PATCH 13/18] - Added preferred video/audio codec player settings. --- StarterGuide.md | 20 ++++++++++++++++++++ tvplayer/build.gradle | 18 +++++++++--------- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index b2ccf3de..eca5186e 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -161,6 +161,26 @@ To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX - `setMaxVideoBitrate`: Sets the maximum allowed video bitrate. Maximum allowed video bitrate in bits per second. +- `setPreferredVideoCodecSettings`: Set Preferred codec for video track. If the video has multiple codes (Ex: HEVC, AVC, AV1, VP9, VP8). +`player.getSettings().setPreferredVideoCodecSettings(new VideoCodecSettings().setVideoCodecPriorityList(Collections.singletonList(PKVideoCodec.HEVC))); +` + +- `setPreferredAudioCodecSettings`: Set Preferred codec for audio track. If the video has multiple codes (Ex: AAC, AC3, E_AC3, OPUS). +`player.getSettings().setPreferredAudioCodecSettings(new AudioCodecSettings().setAudioCodecPriorityList(Collections.singletonList(AAC))); +` + + In both the above preferred codec Settings, you can pass your custom preferred list Singleton. There are other setters as well for Codec Settings, + + * `VideoCodecSettings` + + `allowSoftwareDecoder` to allow the player to user software decoder if hardware decoder is not at all available, by default it is `false`. + + `allowVideoMixedMimeTypeAdaptiveness` if it is true then it will override your preferred codec list. It will add all the video codec in the tracks. If media has multiple codec available for video. + + * `AudioCodecSettings` + + `allowAudioMixedMimeTypes` if it is true then it will override your preferred codec list. It will add all the audio codec in the tracks. If media has multiple codec available for audio. +

☁ Key points to remember

diff --git a/tvplayer/build.gradle b/tvplayer/build.gradle index d8ab978b..82b62d02 100644 --- a/tvplayer/build.gradle +++ b/tvplayer/build.gradle @@ -29,15 +29,15 @@ android { dependencies { - api 'com.kaltura:playkit-android:dev-SNAPSHOT' - api 'com.kaltura:playkit-android-providers:develop-SNAPSHOT' - api 'com.kaltura:playkit-android-kava:develop-SNAPSHOT' - api 'com.kaltura:playkit-dtg-android:current-SNAPSHOT' - -// api project(":playkit") -// api project(":providers") -// api project(":kava") -// api project(":dtglib") +// api 'com.kaltura:playkit-android:dev-SNAPSHOT' +// api 'com.kaltura:playkit-android-providers:develop-SNAPSHOT' +// api 'com.kaltura:playkit-android-kava:develop-SNAPSHOT' +// api 'com.kaltura:playkit-dtg-android:current-SNAPSHOT' + + api project(":playkit") + api project(":providers") + api project(":kava") + api project(":dtglib") implementation "androidx.work:work-runtime:2.1.0" implementation 'androidx.annotation:annotation:1.1.0' From babb55b0990274230e002563b629c06c948069e1 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Thu, 13 Aug 2020 17:49:19 +0530 Subject: [PATCH 14/18] - Updated doc --- StarterGuide.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index eca5186e..40dc8de5 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -162,11 +162,11 @@ To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX - `setMaxVideoBitrate`: Sets the maximum allowed video bitrate. Maximum allowed video bitrate in bits per second. - `setPreferredVideoCodecSettings`: Set Preferred codec for video track. If the video has multiple codes (Ex: HEVC, AVC, AV1, VP9, VP8). -`player.getSettings().setPreferredVideoCodecSettings(new VideoCodecSettings().setVideoCodecPriorityList(Collections.singletonList(PKVideoCodec.HEVC))); +`player.getSettings().setPreferredVideoCodecSettings(new VideoCodecSettings().setCodecPriorityList(Collections.singletonList(PKVideoCodec.HEVC))); ` - `setPreferredAudioCodecSettings`: Set Preferred codec for audio track. If the video has multiple codes (Ex: AAC, AC3, E_AC3, OPUS). -`player.getSettings().setPreferredAudioCodecSettings(new AudioCodecSettings().setAudioCodecPriorityList(Collections.singletonList(AAC))); +`player.getSettings().setPreferredAudioCodecSettings(new AudioCodecSettings().setCodecPriorityList(Collections.singletonList(PKAudioCodec.AAC))); ` In both the above preferred codec Settings, you can pass your custom preferred list Singleton. There are other setters as well for Codec Settings, @@ -175,11 +175,11 @@ To reset call:`setMaxVideoSize(new PKMaxVideoSize().setMaxVideoWidth(Integer.MAX `allowSoftwareDecoder` to allow the player to user software decoder if hardware decoder is not at all available, by default it is `false`. - `allowVideoMixedMimeTypeAdaptiveness` if it is true then it will override your preferred codec list. It will add all the video codec in the tracks. If media has multiple codec available for video. + `allowMixedCodecAdaptiveness` if it is true then it will override your preferred codec list. It will add all the video codec in the tracks. If media has multiple codec available for video. * `AudioCodecSettings` - `allowAudioMixedMimeTypes` if it is true then it will override your preferred codec list. It will add all the audio codec in the tracks. If media has multiple codec available for audio. + `allowMixedCodecs` if it is true then it will override your preferred codec list. It will add all the audio codec in the tracks. If media has multiple codec available for audio.

From 2555673c7027619d5404c14025391cb4de1fb787 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Wed, 2 Sep 2020 20:22:24 +0530 Subject: [PATCH 15/18] - Reverted wrong committed gradle file --- tvplayer/build.gradle | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tvplayer/build.gradle b/tvplayer/build.gradle index 82b62d02..d8ab978b 100644 --- a/tvplayer/build.gradle +++ b/tvplayer/build.gradle @@ -29,15 +29,15 @@ android { dependencies { -// api 'com.kaltura:playkit-android:dev-SNAPSHOT' -// api 'com.kaltura:playkit-android-providers:develop-SNAPSHOT' -// api 'com.kaltura:playkit-android-kava:develop-SNAPSHOT' -// api 'com.kaltura:playkit-dtg-android:current-SNAPSHOT' - - api project(":playkit") - api project(":providers") - api project(":kava") - api project(":dtglib") + api 'com.kaltura:playkit-android:dev-SNAPSHOT' + api 'com.kaltura:playkit-android-providers:develop-SNAPSHOT' + api 'com.kaltura:playkit-android-kava:develop-SNAPSHOT' + api 'com.kaltura:playkit-dtg-android:current-SNAPSHOT' + +// api project(":playkit") +// api project(":providers") +// api project(":kava") +// api project(":dtglib") implementation "androidx.work:work-runtime:2.1.0" implementation 'androidx.annotation:annotation:1.1.0' From 040d6e611adf042a19de0db5eb92d734c0bb7009 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Fri, 15 Apr 2022 18:47:06 +0530 Subject: [PATCH 16/18] - Updated Document --- StarterGuide.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/StarterGuide.md b/StarterGuide.md index 40dc8de5..f003f99a 100644 --- a/StarterGuide.md +++ b/StarterGuide.md @@ -1,8 +1,8 @@

-

Kaltura Player Design Checklist

+

Started Guide / Design Checklist

-Before delving into setting up player in your app or if you are currently using our player; we want you to please go through this simple doc where we have explained the key features of player and will talk about critical points to take an account. We tried explaining this based on our prior experience with customers. +Before delving into setting up player in your app or if you are currently using our player; we want you to go through this simple doc where we have explained the key features of player and will talk about critical points to take an account. [Kaltura-Player](https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html) - If you are using Kaltura backend then you might want to check [OTT Backend Customer Sample Code](https://github.com/kaltura/kaltura-player-android-samples/tree/develop/OTTSamples) OR @@ -27,7 +27,7 @@ In Kaltura Player, you can add extra plugins as per your requirement [IMA SDK](h 3. You need to configure Plugins. [Code Sample](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L674). -4. You need to create an object of `PlayerInitOptions`, this has the same properties like `PlayerSettings`. +4. You need to create an object of `PlayerInitOptions`, this has the same properties like `PlayerSettings` of Playkit. 5. Create KalturaPlayer based on your requirement [Code Sample](https://github.com/kaltura/kaltura-player-android-samples/blob/78c1f6b4f3898c301d394947061b4a458ab284ea/AdvancedSamples/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.kt#L306). @@ -50,7 +50,7 @@ In Kaltura Player, you can add extra plugins as per your requirement [IMA SDK](h We have defined Steps to check and use the following while integrating to your application. 1. You can use our customized Log levels. [Check this Page](https://kaltura.github.io/playkit/guide/android/core/logging.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L117). -2. You need to check if the device supports DRM or not. If you are lookging to play DRM protected content. [Check this page](https://kaltura.github.io/playkit/guide/android/core/drm.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L318). +2. You need to check if the device supports DRM or not. If you are looking to play DRM protected content. [Check this page](https://kaltura.github.io/playkit/guide/android/core/drm.html) [ Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L318). 3. You need to register the plugins as per your requirement. [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L287). 4. Get the media source and DRM info from Kaltura Backend. If you are a Kaltura backend customer, - **OTT Backend Customer** This uses our OTT backend. You need to pass, OTT partner Id, OTT BE url, OTT Kaltura Session(KS), format and MediaId [Code Sample](https://github.com/kaltura/playkit-android-samples/blob/1141bd1d95edf4dc172b3e8dad3b3c7eb78676ab/FullDemo/playkitdemo/src/main/java/com/kaltura/playkitdemo/MainActivity.java#L357). From 9832f2e4d002d39665115093a5b95f820747feec Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Sat, 16 Apr 2022 22:15:06 +0530 Subject: [PATCH 17/18] - Added PlayerInitOptions details. --- README.md | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 164 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5344f27c..4db641ea 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,170 @@ OR container.addView(player?.playerView) player?.setMedia(pkMediaEntry, START_POSITION) } -``` +``` + +#### PlayerInitOptions + +`PlayerInitOptions` is an important API to get most of the Player. If you are currently using `Playkit` then it is similar to `PlayerSettings` there. + +##### `setAutoPlay(Boolean autoplay)` +Default is `true`. Allows the playback to start automatically after the preparation. + +##### `setPreload(Boolean preload)` +Default is `true`. Allows the player to prepare itself. If set to `false` the after player load, App needs to call `prepare()`. +If autoplay is `true` then preload is being treated as `true`. + +##### `setReferrer(String referrer)` +Default is empty. Referred string for the backend. + +##### `setAudioLanguage(String audioLanguage, PKTrackConfig.Mode audioLanguageMode)` +Preferred audio language for the player. If given then player will pick the given audio language automatically if available in the media. + +`audioLanguageMode` is `OFF`, `AUTO` and `SELECTION`. Default is `OFF`. If selected `AUTO`, player will try to take the device langauge (Locale) and will pick the audio language if available in the media. If selected `Selection` then it will pick the language passed in the `audioLanguage` parameter. + +> Similar to `setPreferredAudioTrack(PKTrackConfig preferredAudioTrackConfig)` of `PlayerSettings`. + +##### `setTextLanguage(String textLanguage, PKTrackConfig.Mode textLanguageMode)` +Preferred text language for the player. If given then player will pick the given text language automatically if available in the media. + +`textLanguageMode ` is `OFF`, `AUTO` and `SELECTION`. Default is `OFF`. If selected `AUTO`, player will try to take the device langauge (Locale) and will pick the text if available in the media. If selected `Selection` then it will pick the language passed in the `textLanguage ` parameter. + +> Similar to `setPreferredTextTrack(PKTrackConfig preferredTextTrackConfig)` of `PlayerSettings`. + +##### `setPreferredMediaFormat(PKMediaFormat preferredMediaFormat)` +If backend response contains multiple formats (Dash, HLS etc) then if this API is set with a specific format, Player will pick the given format. + +> Similar to `setPreferredMediaFormat(PKMediaFormat preferredMediaFormat)` of `PlayerSettings`. + +##### `setEnableDecoderFallback(Boolean enableDecoderFallback)` +Decide whether to enable fallback to lower-priority decoders if decoder initialization fails. + +##### `useTextureView(Boolean useTextureView)` +Decide if player should use android.view.TextureView as primary surface +to render the video content. If set to `false`, will use the android.view.SurfaceView instead. + +Note! Use this carefully, because android.view.TextureView is more expensive and not DRM protected. But it allows dynamic animations/scaling e.t.c on the player. By default it will be always set to `false`. + +##### `setSecureSurface(Boolean secureSurface)` +Default is `false`. Decide if player should use secure rendering on the surface. +Known limitation - when `useTextureView` set to `true` and `isSurfaceSecured` set to `true` then secure rendering will have no effect. + +##### `setAdAutoPlayOnResume(Boolean adAutoPlayOnResume)` +Default is `true`. Decide the Ad will be auto played when comes to foreground from background. + +##### `setVRSettings(VRSettings vrSettings)` +Set VR Settings on the player for VR/360 media. + +##### `setVrPlayerEnabled(Boolean vrPlayerEnabled)` +Default is `true`. Set the Player's VR/360 support. If 360 media should be played on VR player or default player. If `setVRSettings(VRSettings vrSettings)` are set then only this flag works otherwise, treat it as no-op. + +##### `setPKLowLatencyConfig(PKLowLatencyConfig pkLowLatencyConfig)` +Creates a Low Latency Live playback configuration. Please check `PKLowLatencyConfig` class' setter methods for more details. + +##### `setPKRequestConfig(PKRequestConfig pkRequestConfig)` +Creates a request configuration for HttpDataSourceFactory used during player network calls. + +App can set cross protocol redirections (`http` to `https` or viceversa), read and connect timeouts. App can set tell player the maximum number of times to retry a load in the case of a load error, before propagating the error. + +##### `setIsVideoViewHidden(Boolean isVideoViewHidden)` +In case of audio only content, app can hide the video view using this API. Set the flag which handles the video view. + +##### `forceSinglePlayerEngine(Boolean forceSinglePlayerEngine)` +Default value is set to 'false'. Do not prepare the content player when the Ad starts(if exists); instead content player will be prepared when content_resume_requested is called. + +This flag works where ad and content playback is there. In case, if because of the decoders content playback is jittery or having some issues then set this flag to `true`. Mostly handy in Android TV cases. + +##### `allowChunklessPreparation(Boolean allowChunklessPreparation)` +This flag is only for the HLS Streams. Default is `true`. +Player will only use the information in the multivariant playlist to prepare the stream, which works if the `#EXT-X-STREAM-INF` tags contain the `CODECS` attribute. + +##### `forceWidevineL3Playback(Boolean forceWidevineL3Playback)` +If the device codec is known to fail if security level L1 is used then set flag to true, it will force the player to use Widevine L3. It will work only SDK level 18 or above. + +##### `setDrmSettings(DRMSettings drmSettings)` +Creates a DRM playback configuration. Default is set to play the Widevine DRM content. In case, if App wants to use Playready DRM then set the DRMSchema to +`PKDrmParams.Scheme.PlayReadyCENC`. + +App can set the multi session DRM in this config. +In stream DRM support can also be set using `setIsForceDefaultLicenseUri`. For more info please look at `DRMSettings` class. + +##### `setSubtitleStyle(SubtitleStyleSettings setSubtitleStyle)` +Give styles to the subtitles. Works for both internal and external subtitles. +Can change font, typeface, text color, background color etc. + +##### `setAspectRatioResizeMode(PKAspectRatioResizeMode aspectRatioResizeMode)` +Set the Player's AspectRatio resize Mode. It is very handy for different aspect ratio medias like full screen portrait medias. + +##### `setContentRequestAdapter(PKRequestParams.Adapter contentRequestAdapter)` +Add headers on the manifest, chunk or the segments network requests. It can be set one time. We don't not support on the fly header manipulation. + +##### `setLicenseRequestAdapter(PKRequestParams.Adapter licenseRequestAdapter)` +Add headers on the DRM server requests. + +##### `setLoadControlBuffers(LoadControlBuffers loadControlBuffers)` +Set the player buffers size. App can set the min/max buffer size before the actual playback starts/resume or seeked. For more info please check `LoadControlBuffers` class. + +##### `setAbrSettings(ABRSettings abrSettings)` +Set the Player's ABR settings. ABR is supported based on Bitrate, height, width and Pixel level. + +##### `setTVPlayerParams(TVPlayerParams tvPlayerParams)` +Sets the initial bitrate estimate in bits per second that should be assumed when a bandwidth estimate is unavailable. To reset it, set it to null. + +##### `setCea608CaptionsEnabled(Boolean cea608CaptionsEnabled)` +Enable/disable cea-608 text tracks. By default they are disabled. Note! Once set, this value will be applied to all mediaSources for that instance of Player. In order to disable/enable it again, you should update that value once again. Otherwise it will stay in the previous state. + +##### `setMpgaAudioFormatEnabled(Boolean mpgaAudioFormatEnabled)` +Enable/disable MPGA audio tracks. By default they are disabled. Note! Once set, this value will be applied to all mediaSources for that instance of Player. In order to disable/enable it again, you should update that value once again. Otherwise it will stay in the previous state. + +##### `setVideoCodecSettings(VideoCodecSettings videoCodecSettings)` +Set Preferred codec for video track. App can give the codec priority list like HEVC, AV1, VP9, VP8, AVC. + +App can pass `allowSoftwareDecoder` to `VideoCodecSettings`. Using this flag, app is giving freedom to player to choose the software based decoders as well. Default is `false`. + +App can pass `allowMixedCodecAdaptiveness` to `VideoCodecSettings`, using this player will take all the available tracks of different codecs as well. + +> Similar to `setPreferredVideoCodecSettings(VideoCodecSettings videoCodecSettings)` of `PlayerSettings`. + +##### `setAudioCodecSettings(AudioCodecSettings audioCodecSettings)` +Set Preferred codec for audio track. App can give the codec priority list like E_AC3, AC3, OPUS, AAC. + +App can pass `allowMixedCodecs` to `AudioCodecSettings `. Using this flag, app is giving freedom to player to take all the available audio codecs from the different adaptation set of the manifest. Default is `false`. + +App can pass `allowMixedBitrates` to `AudioCodecSettings `, using this player will take all the available bitrate tracks. + +> Similar to `setPreferredAudioCodecSettings(AudioCodecSettings audioCodecSettings)` of `PlayerSettings`. + + +##### `setTunneledAudioPlayback(Boolean isTunneledAudioPlayback)` +Default is `false`. Set Tunneled Audio Playback. + +##### `setHandleAudioBecomingNoisy(Boolean handleAudioBecomingNoisyEnabled)` +Default is `false`. Set HandleAudioBecomingNoisy - Sets whether the player should pause automatically when audio is rerouted from a headset to device speakers. + +##### `setHandleAudioFocus(Boolean handleAudioFocus)` +Default is `false`. Set HandleAudioFocus - Support for automatic audio focus handling + +##### `setWakeMode(PKWakeMode wakeMode)` +Set WakeLock Mode - Sets whether the player should not handle wakeLock or should handle a wake lock only or both wakeLock & wifiLock when the screen is off. + +##### `setSubtitlePreference(PKSubtitlePreference subtitlePreference)` +Set preference to choose internal subtitles over external subtitles (Only in the case if the same language is present in both Internal and External subtitles) - Default is true (Internal is preferred). + +- `PKSubtitlePreference.INTERNAL`, Internal will be present and External subtitle will be discarded +- `PKSubtitlePreference.EXTERNAL`, External will be present and Internal subtitle will be discarded +- `PKSubtitlePreference.OFF`, Both internal and external subtitles will be there + +##### `setMaxAudioChannelCount(Integer maxAudioChannelCount)` +Sets the maximum allowed audio channel count. Default is `Integer.MAX_VALUE` + +##### `setMulticastSettings(MulticastSettings multicastSettings)` +Sets the multicastSettings for udp streams. `maxPacketSize` default is 3000 & `socketTimeoutMillis` default is 10000. +Please check the `MulticastSettings` class for more details. + +##### `setMediaEntryCacheConfig(MediaEntryCacheConfig mediaEntryCacheConfig)` +##### `setOfflineProvider(OfflineManager.OfflineProvider offlineProvider)` + + **Notes** From 8aded5a2054ac28784bd3784ff68481ad69d96e9 Mon Sep 17 00:00:00 2001 From: Gourav Saxena Date: Thu, 21 Apr 2022 22:18:56 +0530 Subject: [PATCH 18/18] - Updated document --- README.md | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 4db641ea..3f5963d0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ # Kaltura Player for Android -**Kaltura Player** - This `Playkit` wrapper simplifies the player integration so that client applications will require less boilerplate code, which ensures a faster integration. +**Kaltura Player** - This [`Playkit`](https://github.com/kaltura/playkit-android) wrapper simplifies the player integration so that client applications will require less boilerplate code, which ensures a faster integration. ## Kaltura Player Features: @@ -15,20 +15,21 @@ * HLS * MP4 * MP3 -* Multicast(udp) +* Multicast(UDP) * Multiple Codecs support * Live / Live DVR * TrackSelection (Video/Audio/Text) -* External subtitles -* Player Rate +* External subtitles / Subtitle positioning and styling +* Playback Rate * ABR Configuration -* VR /360 -* Dash Instream Thumbnails +* VR /360 media playback +* Dash Instream Thumbnails +* External Sprite Image support for Thumbnails * Change Media * Playlist * ID3 Timed Metadata * Screen recording blocking -* Playback Adapter - allow app to change the manifest url query param or headers changes +* Playback Adapter - allow app to change the manifest url query param or headers changes #### DRM: @@ -44,10 +45,11 @@ #### Monitization: * IMA -* DAI -* Ad Schedualer -* Ad Warterfalling -* Ad-Hoc Ad playback +* DAI +* [Ad Layout Configuration](https://kaltura.github.io/playkit/guide/android/core/advertising-layout.html) + - Ad Warterfalling + - Ad Schedualer + - Ad-Hoc Ad playback #### CDN: @@ -69,7 +71,7 @@ Gradle Dependency: `implementation 'com.kaltura.player:tvplayer:4.x.x'` + add m This dependency already includes **Playkit, Kava Analytics Player Providers and Download-to-Go libraries** internally, so no need to add them to the client app's `build.gradle`. -[Kaltura Player Migration Guide](https://kaltura.github.io/playkit/guide/android) +[Kaltura Player Migration Guide](https://kaltura.github.io/playkit/guide/android/migration/KalturaPlayer.html) [Kaltura Player Docs](https://developer.kaltura.com/player/android/getting-started-android) @@ -79,7 +81,9 @@ This dependency already includes **Playkit, Kava Analytics Player Providers and [Kaltura Player Basic Player Samples](https://github.com/kaltura/kaltura-player-android-samples/tree/master/BasicSamples) -[Kaltura Player Advanced Samples](https://github.com/kaltura/kaltura-player-android-samples/tree/master/AdvancedSamples) +[Kaltura Player Advanced Samples](https://github.com/kaltura/kaltura-player-android-samples/tree/master/AdvancedSamples) + +Kaltura Player Advanced Samples includes the advanced features like AdLayout, MediaPreviewSample for showing the thumbanail image on seekbar using external sprite image URL, RecyclerView Sample for showing media autoplay feature, DashThumbnail sample for showing in-stream image thumbnails. [Kaltura Player Offline Sample](https://github.com/kaltura/kaltura-player-android-samples/tree/master/OfflineDemo) @@ -93,9 +97,9 @@ Client application should call a mandatory initialization method calls at the ti `KalturaPlayer.initializeOTT(this, OTT_PARNTER_ID, OTT_SERVER_URL);` `KalturaPlayer.initializeOVP(this, OVP_PARNTER_ID, OVP_SERVER_URL);` -###### OTT Ex. -`public static final String OTT_SERVER_URL = "https://rest-us.ott.kaltura.com/v4_5/";` -`public static final int OTT_PARNTER_ID = 3009;` +###### OTT +`public static final String OTT_SERVER_URL = "https://url_of_kaltura_be";` +`public static final int OTT_PARNTER_ID = kaltura_partner_id;` #### Note: Without calling the initialization code on startup `KalturaPlayerNotInitializedError`, error will be fired on the `player.loadMedia` callback phase. @@ -170,7 +174,7 @@ OR } ``` -#### PlayerInitOptions +## `PlayerInitOptions` `PlayerInitOptions` is an important API to get most of the Player. If you are currently using `Playkit` then it is similar to `PlayerSettings` there. @@ -331,10 +335,4 @@ Please check the `MulticastSettings` class for more details. ##### `setMediaEntryCacheConfig(MediaEntryCacheConfig mediaEntryCacheConfig)` ##### `setOfflineProvider(OfflineManager.OfflineProvider offlineProvider)` - - -**Notes** - -In `playerInitOptions` the default value for player autoplay is true. -In `playerInitOptions` the default value for player media preload from the BE is true.