Introduction to "Vlc-android" LIBVLC API (equivalent to VLC MediaPlayer)

Source: Internet
Author: User


Objective

Learning new things API is very important, here to organize a bit, welcome feedback!

Statement

Welcome reprint, but please keep the original source of the article:) Blog Park: http://www.cnblogs.com farmer Uncle: http://over140.cnblogs.com

Body

The LIBVLC of vlc-android is equivalent to the MediaPlayer object, and the corresponding relationship is listed here.

1. public void PLAYMRL(String MRL)

corresponding to the Setdatasource of MediaPlayer, be careful not to turn the URI to ToString again, otherwise it will not play. Use the following:

PLAYMRL ("http://live.3gv.ifeng.com/zixun.m3u8")  

2. Public native void Play ()

the start () corresponding to the MediaPlayer starts playing.

3. Public native void pause()

corresponding MediaPlayer's pause (), pauses playback.

4.Public native void stop()

corresponding MediaPlayer's Stop (), stops playback.

5. PublicNative Boolean isplaying()

Corresponds to the MediaPlayer isplaying, is playing.

6, publicnative int getplayerstate();

Gets the status of the player.

7.public native int getvolume()

gets the volume.

8, publicnative int setvolume(int volume)

Set the volume. (The value range is not the same as MediaPlayer )

9, publicnative long getlength()

corresponding MediaPlayer's getduration. Gets the length of the video, in milliseconds.

10, publicnative long getTime()

Returns the current time of the video, in milliseconds.

11, publicnative long settime(long time)

Sets the current time of the video, in milliseconds.

12.publicnative float getPosition()

corresponding to the MediaPlayer GetCurrentPosition.  Sets the current location of the video.

13.publicnative void setposition(float POS)

corresponding MediaPlayer's Seekto. sets the current location of the video.


14. Publicnative void setrate(float rate)

Set playback speed (can achieve fast forward rewind) 1 is the normal speed, 2 is twice times the speed (I guess the same value as Vitamio is 0.5 ~ 2.0), corresponding to the Getrate method.

15. PublicNative Boolean isseekable()

Whether to support seek (drag). For example, live broadcasts do not support seek operations

16. Publicvoid destroy()

corresponding MediaPlayer's release, destroy the LIBVLC instance.

17. Publicbyte[] getthumbnail(String mrl, int i_width, int i_height)

Gets the byte array of the video, Rgba.

18. Publicvoid sethardwareacceleration(int hardwareacceleration)

Set hard-coded, reference libvlc.hw_acceleration_full and other parameters

19. Publicvoid setnetworkcaching(int networkcaching)

Set up network buffering. (You don't know how to use it, you see the setting value is 3000, 6000)

20. Publicvoid Setframeskip(boolean frameskip)

(Temporarily do not know what is the use, as if can improve performance, frame decoding error after skipping directly?) )

Simple example of "vlc-android" vlc-android

End

Although with the player for a long time, a lot of basic and original rational things are still not understand, but also to strengthen learning, such as the above frame skip do not know what is.

Introduction to "Vlc-android" LIBVLC API (equivalent to VLC MediaPlayer)

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.