VideoView-To Play swf file

Deadly 提交于 2019-12-24 17:28:16

问题


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.



来源:https://stackoverflow.com/questions/8604922/videoview-to-play-swf-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!