Mediaplayer adds the subtitle Function

Source: Internet
Author: User

I want to add the subtitle function to mediaplayer in Android. Below are some notes,

Without the support of the server, we just performed a local parsing. If we had resolved all the data from the very beginning, such as hundreds of data records, it would easily cause problems and cause ANR, remember that mediaplayer has a nucachedfilesource2 item when parsing files. You can load files to the memory in batches to speed up playback, load more data when the playing position reaches the end of the Data. After the experiment, the effect is much better than the original one.

There is also the function of searching. At the beginning, it was just silly to use sequential searching. The efficiency was too low, and the playback function of mediaplayer was also remembered. You can set the position pointer of subtitles, seek sets this pointer and finds the position after the pointer, which is much more efficient. There is no way to paste the code and paste it later.

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.