Displaying Flash Video on Android 2.3?

Asked

Viewed 110 times

1

Good already tried of all ways to run flash video on android 2.3 of 4.0 forward will easy from a webview. Searching Google and in some forums I saw people riding through Videoview. For me it did not work.

    VideoView videoView = (VideoView) findViewById(R.id.videoView1);
    MediaController mediaController = new MediaController(this);
    mediaController.setAnchorView(videoView);
    Uri video = Uri.parse("http://www.ustream.tv/channel/5474055");
    videoView.setMediaController(mediaController);
    videoView.setVideoURI(video);
    videoView.start();

Good if anyone has any tips. Detail I do not want to have download the flash and install. But I wanted something native or without the need to download something. Well I’ll leave a print of the error when I try to load the url on android 2.3 the same url loads all normal android 4.0 up.

Erro Carregando url flash em um webView android 2.3

1 answer

1

The problem is in line 104 of the Aovivo class, in the onCreate() method. Voce uses the setLayerType function, which was only added in API 11. So, before using it, Voce should check the device version, like this:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
    // Coloque a chamada da funcao setLayerType aqui dentro
} 

Browser other questions tagged

You are not signed in. Login or sign up in order to post.