Mobile video 12th day, integrated Vitamio Universal player

Source: Internet
Author: User

Vitamio is an all-in-one multimedia development framework on Android and IOS platforms that supports both hardware decoding and GPU rendering. With its simple and easy-to-use API interface, Vitamio has won the favor of many developers around the world. To date, more than 10,000 applications worldwide have been using Vitamio, covering more than 500 million users.

Vitamio can seamlessly play videos in common formats such as 720P or 1080P HD MKV,FLV,MP4,MOV,TS,RMVB, as well as cross-platform support for MMS, RTSP, RTMP, HLS (m3u8) on Android and IOS A variety of common video streaming protocols, including on-demand and live streaming.

First, the integration of Vitamio

1.1 Downloads Vitamio

To the official website address https://www.vitamio.org/Download/Download the latest Vitamio, download good has 2 folders to note: 1 Vitamio another is vitamio-simple, These 2 folders are then imported into Android Studio.

1.2 Importing Vitamio

Open Android, in the file----new----import module, and then the path to select the Vitamio mentioned above, click OK;

Also use the above method to import vitamio-simple.

Imported Vitamio build.gradle the corresponding SDK version, you need to compare the project you created, modify the local SDK version and other information, modify the re-sync project.


1.3 Integration of Vitamio into the project

1.3.1 Associated So Library

Referring to the example of compile in the Build.gradle in Vitamio-simple, the associated Vitamio library, such as

                             compile project (': Vitamio ')                  1.3.2  Copy the file that corresponds to the function list in the past                           a, Permissions:                         <uses-permission android:name= "Android.permission.WAKE_LOCK"  />                         <uses-permission android : Name= "Android.permission.INTERNET"  />               &Nbsp;         <uses-permission android:name= " Android.permission.ACCESS_NETWORK_STATE " />                         <uses-permission  android:name= "Android.permission.READ_EXTERNAL_STORAGE"  />                          <uses-permission android:name= "Android.permission.ACCESS_WIFI_STATE"  />                          <uses-permission android:name= "Android.permission.READ_PHONE_STATE"  />

B, configuration, this configuration must not be less, the official also prompted the need to add

                <!--  Don ' t forgot initactivity -->                 <activity                     android:name= "Io.vov.vitamio.activity.InitActivity "                     android:configchanges= "orientation|screensize|smallestscreensize|keyboard|keyboardhidden| Navigation "                     android:launchmode= "Singletop"                      android:theme= "@android: style/ Theme.notitlebar "    &nbsP;               android: Windowsoftinputmode= "Statealwayshidden"  />                 <activity android:name= ". Vitamiolistactivity " >

1.4 Copy the Systemvideoplayer we wrote earlier, change it to Vitamiovideoplayer, and the package inside refers to the Vitamio bag, especially the Videoview,mediaplayer class.

1.5 layout file Activity_system_video_player.xml Copy to Activity_vitamio_video_player.xml, the package referenced in the Vitamio class is changed


1.6 Initialize the Vitamio before loading the layout file

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/9C/DA/wKioL1l291_DxNxfAAC--U_ikdk914.png-wh_500x0-wm_ 3-wmp_4-s_3700257205.png "title=" qq picture 20170725154710.png "alt=" Wkiol1l291_dxnxfaac--u_ikdk914.png-wh_50 "/>


1.7 When the video playback error, jump to the universal player Vitamiovideoplayer play

This article is from the "Yuangushi" blog, make sure to keep this source http://cm0425.blog.51cto.com/10819451/1950895

Mobile video 12th day, integrated Vitamio Universal player

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.