VideoView-To Play swf file

2019-08-11 09:15发布

问题:

I made an application in which I want to play an SWF file in a raw folder.

When I run the app, it shows

Sorry, the video cant be played.

I don't know how to rectify it. I've installed the Adobe Flashplayer11.apk and SWF player on the device. However when I run my apk, it couldn't open.

Is the VideoView capable of playing SWF videos?

Here's my code:

package com.video.in;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class VideoPlayActivity extends Activity {
    private String vSource1;
    VideoView v2;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        v2=(VideoView)findViewById(R.id.VideoView04);
        v2.requestFocus();
        vSource1 ="android.resource://com.video.in/" + R.raw.swfvideos;
        v2.setVideoURI(Uri.parse(vSource1));
        v2.setMediaController(new MediaController(this));
        v2.start();   
    }
    ...
}

回答1:

I have been trying to do the same but i came to learn that android apps don't play swf videos so the thing is you will have to convert it into mp4 or any other extension that android can play.