Flash Player on Android

Source: Internet
Author: User

A flash video player is required.

The Flash plug-in can be installed only after android2.2 and the flash video can be played in webview. The initial idea is to set a full-screen webview for the activity and then input a flash Address. Later, I found some problems and made it clear.

1. directly call webview. loadurl and input the flash Address. On my custom machine, a white screen is sometimes displayed (no sound or image ).

2. Package the flash Address into an HTML page, and then call webview. loaddata to pass in the page data. This can be run on 2.x, but framelayout or relativelayout cannot place the logo I want to add in the upper left corner of the screen. Instead, the logo is placed under the Flash Player. Finally, we had to add a <br/> line break in front of the embed tag in the HTML page. In addition, it runs normally on 2.3, and the process crashes when it reaches 3.2. So this is not a general solution.

3. directly call the system browser and throw the flash Address. This is simple and violent, but it can really throw the problem.

Intent intent2 = new intent (intent. action_view, Uri. parse (flash_url ));

Startactivity (intent2 );

In addition, 100% white screen was found before hardware acceleration was enabled, which is much better after it was enabled.

Whether it is a program restart or a white screen, it is for a specific machine, the most important thing is to write down several more solutions.

Reference URL:

There is a difference between embedding an object element and an EMBED element in flash in different browsers.

Http://www.w3help.org/zh-cn/causes/HO8001

Android webview usage

Http://trinea.iteye.com/blog/1152557

Supplement: 2011.11.17

No matter which method is used to load the flash, there will be a flash screen before playing the video. The flash plug-in generates a surfaceview and adds it to the webview, then draw the content in this surfaceview, And the surfaceview background is white. The white screen is displayed before the content is formally drawn.

I tried to override the webview. drawchild method to see if I could monitor when to start plotting, but this method won't be called at all. That is to say, the flash plug-in does not generate surfaceview at all, or although it is generated, it is not added to webview.

References:
Screen blinking when using a webview with Flash

Http://stackoverflow.com/questions/5095977/screen-blinking-when-using-a-webview-with-flash

Research on the Application of Android browser plug-in technology

Http://www.docin.com/p-238856627.html

Supplement: 2011.11.18

The packagename of the flash plug-in is com. Adobe. flashplayer, and the service name is com. Adobe. flashplayer. flashpaintsurface.
You can use this information to check whether the flash plug-in is installed:

PackageManager pm = getPackageManager();List<PackageInfo> infoList = pm.getInstalledPackages(PackageManager.GET_SERVICES);PackageInfo flashInfo = null;for (PackageInfo info : infoList) {if ("com.adobe.flashplayer".equals(info.packageName)) {flashInfo = info;System.out.println("name" + flashInfo.versionName);}}if (flashInfo == null) {return;}

In addition, you can also check the Flash version you have installed:

private boolean isFlashPluginOut(PackageInfo flashInfo) {String v1 = flashInfo.versionName.replace(".", "");String v2 = "10.3.185.21".replace(".", "");return v1.compareTo(v2) < 0;}

If the version is too low, you can direct it to the market:

private void gotoMarket() {Intent installIntent = new Intent("android.intent.action.VIEW");installIntent.setData(Uri.parse("market://details?id=com.adobe.flashplayer"));startActivity(installIntent);}

Reference URL:
Call market search software

Http://bashenmail.iteye.com/blog/603764

Related Article

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.