百度智能云

All Product Document

          Multimedia Cloud Processing

          Android-Player-SDK-Introduction

          Baidu AI Cloud Player Android SDK (hereinafter referred to as "Player SDK") is a software development kit developed and launched officially by Baidu for Android platform.

          Advantages

          Player SDK has many advantages:

          • T5 player core developed by Baidu is built-in, supporting all the current mainstream video formats (mp4, avi, wmv, flv, mkv, mov, rmvb, etc.) and streaming media protocols (HLS, RTMP, RTSP), making up for the deficiency of native player in medium support format, and obviously improving in compatibility, stability and response speed.
          • Provide simple and rapid interfaces to help the developers effectively create media play applications and efficiently reduce the technical threshold of the multi-media application.
          • It provides calling methods on many levels. You can customize to develop the playback interface according to your own demands, or you can use the default playback interface to achieve rapid development.
          • Provide multi-media interactive play across TVs, PCs, tablets and smartphones, and currently support Android DLNA (Living Network Alliance) controller to control TVs, STB products and lots of smart devices compatible with DLNA protocol, support cross-device play of audio, video, images to realize basic remote control feature and provide rich and convenient interactive experience to you.

          Feature

          Player SDK provides abundant feature for you:

          Support the customization of the user while providing default playback control

          • Directly use BVideoView and BMediaController for rapid development

            To meet your needs of building a complicated and personalized media player and developing a customized player, the player SDK provides you with BVideoView and BMediaController, two interface types: 
            • BVideoView:Provide support to media play display.
            • BMediaController:Provide support for media play control.
          • Custom playback control interface based on BVideoView

            When BMediaController cannot satisfy your interface style and user interaction requirements, you can choose to disuse BMediaController and only use BVideoView for play display; meanwhile, self-customize the play control interface and get relevant paly information and registration listener through BVideoView to realize the feature of play control to realize UI and play feature separation. 

          Support plug-in subtitle

          The add-on subtitle feature supports to import the add-on subtitle during the playback of video, including downloading subtitle, loading local subtitle, subtitle display adjustment, etc. Currently, the subtitle in srt format is supported.

          Support multi-screen interaction

          Besides providing video play feature, player SDK also supports multi-screen interaction feature based on DLNA controller to realize the content sharing and interactions between cellphones, tablets, PCs and intelligent TVs (STBs). The entire library contains a complete set of SDK, containing rich API, covers the DLNA activation and deactivation, discovery of devices, setting of resource files, playback control, status query, event subscription and error notification to help the developers to create powerful media applications easily, and provides the users with high-quality audio entertainment and new experience of entertainment, with the following features:

          • Support such media files as photo, audio, video and other formats.
          • With compatibility, it supports mainstream TV (Sony) or set-top box (MI box, Letv and QvodPlayer big screen) .
          • With powerful feature, support drag and drop, volume control and other features, and replace remote control completely.
          • Low latency and quick response.
          • With a small size, and low resource loss at the operation.
          • Easy to use, you only need to import Jar package, without depending on additional libraries.
          • Call synchronously and simplify program; notify asynchronously, real-time and reliable.

          Currently, the player SDK only introduces DLNA controller feature, you can find and control the other DLNA devices in the network by using API; if you want the intelligent device to support DLNA protocol and be controlled by the other controllers, please pay attention to the subsequent SDK update.

          Component and Resource

          Component

          You need to integrate the player SDK into the application, including Jar package, underlying dynamic library and relevant resource files. Every application should integrate Jar pack and dynamic library independently as follows:

          Resource

          The complete download pack of the player SDK contains three parts of demos, Javadoc and libs:

          • demosDirectory: Three most typical Android sample projects

            • sample1:Demonstrate the using of two APIs, namely BVideoView and BMediaController simultaneously to develop player application, which is to use default playback control interface for quick development.
            • sample2: Demonstrate only to use BVideoView API to develop player APP, meaning to self-customize the play control interface.
            • DLNAControllerDemo:Demonstrate the implementation of multi-screen interaction.
          • Javadoc directory: The reference document of the player SDK related interfaces, can view index.html to get the detailed introduction of API offline.
          • Libs directory: Player SDK, including Jar kit, so and relevant resource documents

            • cyberplayer-sdk.jar:Java layer realization, you must cite in the project.
            • res:BMediaControllerResource file referred
            • cyberplayer-cores:The so compression packs of different cellphone types; get libs directory after compressing any pack, and combine the libs directory with the libs directory in the project root directory.

          The compressed directory structure is as follows:

          .
          ├── Baidu-T5Player-SDK-Android-<Version>-<Revision> 
          │   ├── demos 
          │   │   ├── VideoPlayerDemo 
          │   ├── extras 
          │   │   └── offline-downloader 
          │   ├── javadoc 
          │   ├── libs 
          │   │   ├── arm64-v8a 
          │   │   ├── armeabi-v7a 
          │   │   └── cyberplayer-sdk.jar 
          │   └── res 

          CPU Instruction Set Adaption

          CPU of mobile devices, according to different architectures, mainly include ARM series, X86 series, etc. APM series support the mainstream armv7 (further support the characteristics of vfp, vfpv3 and neon) and arm64.

          In order to get the best play performance, the play core has been optimized aiming at different CPUs and their characteristics, and different versions of so dynamic libraries are formed The mobile phone of higher version is compatible with the library of low version, but cannot use the hardware acceleration feature of this phone, which will affect the performance; therefore, you are recommended to choose the library that corresponds to the phone hardware for use. SDK provides 4 types of different CPU dynamic libraries, see the following list for details:

          Adaptability rules

          The dynamic library is directly associated with the CPU architecture and instruction set. If you select a dynamic library that does not match, it may cause the application to fail to play or crash. Therefore, recommend you adhering to the following principles to adapt:

          • Select the dynamic library that matches CPU to ensure the best playback experience of the video application.
          • The X86 processor can support the ARM instruction set through binary conversion, but it has a greater impact on performance. Recommend you to use the native x86 dynamic library on x86 mobile phones.

          Note

          • Ensure that the jar package, so package and res resource are added into the project and configuration.
          • Should ensure the numbers of the .so files of every CPU framework folder are the same. During the installation of application, the system will copy .so file of corresponding architecture to lib directory of private folder.
          • The mobile phone covers primary CPU architecture and secondary CPU architecture (compatible mode) in general. arm64/x86 cellphones are all compatible with armv7; therefore, the simplified installation package can keep only one CPU framework folder.
          Previous
          Android-Player-SDK-Developer Guide
          Next
          Version Update Record