Git Product home page Git Product logo

playkit-android-broadpeak-smartlib's Introduction

CI Status Download License Android

Kaltura plugin for Broadpeak SmartLib for Kaltura Player on Android

About Kaltura Plugin for Broadpeak SmartLib

Broadpeak plugin is designed for integration a Broadpeak service

Kaltura Plugin for Broadpeak SmartLib Integration

The easiest way to get the BroadpeakPlugin is to add it as a Gradle dependency. First, add Smartlib repository with your credentials to your root build.gradle

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            credentials {
                username "username"
                password "password"
            }
            url "https://delivery-platform.broadpeak.tv/android/repository/smartlib"
        }
    }
}

Next, add the BroadpeakPlugin dependency to the build.gradle file of your app module

implementation 'com.kaltura.playkit:broadpeakplugin:4.x.x'

This dependency includes com.kaltura.player:tvplayer internally, so no need to add them to the client app's build.gradle.

Next, lets see how to use the BroadpeakPlugin in your application.

Plugin Configurations

Like Kaltura's other Playkit plugins, Kaltura Plugin for Broadpeak SmartLib includes configurations that can be used by your application.

In the following code snippet, you can see how to configure BroadpeakPlugin with custom parameters. Below are detailed explanation of each field.

class MainActivity : AppCompatActivity() {
    private lateinit var player: KalturaPlayer
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        loadPlaykitPlayer()
    }
    private fun loadPlaykitPlayer() {
        // PlayerInitOptions
        val playerInitOptions = PlayerInitOptions(PARTNER_ID)
        playerInitOptions.setAutoPlay(true)
        playerInitOptions.setAllowCrossProtocolEnabled(true)
        // Broadpeak Configuration
        val pkPluginConfigs = PKPluginConfigs()
        val broadpeakConfig = BroadpeakConfig().apply {
            // analyticsAddress - The address of the analytics server to send metrics to
            analyticsAddress = "https://analytics.kaltura.com/api_v3/index.php"
            // nanoCDNHost The address inside the home network of the device where the nanoCDN is embedded or "discover" if the discovery is enabled on the nanoCDN.
            nanoCDNHost = "cdnapisec.kaltura.com"
            // broadpeakDomainNames The domain name list to use to identify url(s) using broadpeak product (i.e "cdn.broadpeak.com,cdn2.broadpeak.com"). "*" specific value is used to declare that all given url are using broadpeak product. Empty value "" is used to declare that all given url are not using broadpeak value
            broadpeakDomainNames = "*"
        }
        pkPluginConfigs.setPluginConfig(BroadpeakPlugin.factory.name, broadpeakConfig)
        playerInitOptions.setPluginConfigs(pkPluginConfigs)
        player = KalturaOttPlayer.create(this@MainActivity, playerInitOptions)

        // handle Broadpeak error event
         player.addListener(this, BroadpeakEvent.error) { event ->
            Log.i(TAG, "BROADPEAK ERROR " + event.errorMessage)
        }
    }
}

Error Handling

Incase there is failure from the Broadpeak SDK side error will be fired and in case app is registered to this error it will be received in the listener.

The event payload contains 3 parameters

 BroadpeakEvent.Type.ERROR
 errorCode
 errorMessage
player?.addListener(this, BroadpeakEvent.error) { event ->
            Log.i(TAG, "BROADPEAK ERROR " + event.errorMessage)
}

Sample

Broadpeak Sample

In this sample you will have to provide the username and password for the broadpeak sdk (in build.gradle) and the partner and media information as well in order for it to work properly.

License and Copyright Information

All code in this project is released under the AGPLv3 license unless a different license for a particular library is specified in the applicable library path.

Copyright © Kaltura Inc. All rights reserved.
Authors and contributors: See GitHub contributors list.

Broadpeak SmartLib libraries the Broadpeak SDK, and all associated APIs, and header files (collectively, the “Broadpeak Materials”) are the exclusive property of Broadpeak and subject to Broadpeak license terms. Notwithstanding anything to the contrary stated in this repository, Kaltura, as copyright holder on the Plug in program, hereby (i) confirms that the Broadpeak Materials is an independent program and set of materials, and are not licensed under nor intended to be otherwise subject to the AGPL-3.0 license nor any other open source license, but used only under the terms of Broadpeak license and ; (ii) gives express permission, as a special exception to AGPL license terms, to link such AGPL code or portion of this code, with the Broadpeak Materials or any part thereof, regardless of the license terms of the AGPL code, and to produce an executable, copy and distribute the resulting executable, provided that you also mee the applicable license terms and conditions of the Broadpeak Materials and the AGPL code;
To obtain licensing information regarding the Broadpeak Materials, contact: https://broadpeak.tv/form/contact-broadpeak/

[Broadpeak® SmartLib] Copyright © 2020–2021 Broadpeak, S.A.S. All Rights Reserved

This program contains proprietary information, which is confidential and trade secret of Broadpeak, SAS.

It is protected by intellectual property as an unpublished work under applicable Copyright laws and international conventions.

Certain functionalities and/or features of such program may also be subject to some patent and pending patent applications.

Broadpeak® is registered trademark and trade name of Broadpeak, S.A.S., and shall not be used in any manner without express written from Broadpeak, S.A.S.

Unless expressly otherwise agreed in writing by Broadpeak, such as under commercial agreement executed by authorized representative of Broadpeak, the use of the program and its documentation is strictly limited to your own internal evaluation of such program and its functionalities for potential collaboration with Broadpeak. Recipient shall retain this program, documentations, and materials in confidence and is not allowed to make any copy, decompile, reverse engineer, disassemble, and attempt to derive the source code of, modify, or create derivative works of the program, any update, or any part thereof, other than as expressly permitted or expressly made mandatory by applicable laws.

Any attempt to do so is a violation of the rights of Broadpeak. If you or any person under your control or authority breach this restriction, you may be subject to prosecution and damages.

Contact: https://broadpeak.tv/form/contact-broadpeak/

playkit-android-broadpeak-smartlib's People

Contributors

giladna avatar gouravsna avatar volodymyr-bondarenko85 avatar orenme avatar alex-litvinenko avatar litvinenko-kaltura avatar noamtamim avatar

Watchers

Zohar Babin avatar iKinnrot avatar Sergey Chausov avatar James Cloos avatar  avatar KCorpIT avatar  avatar Tomáš Garba avatar Alex avatar Kaltura GitHub Hooks avatar Elad Plotski avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.