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();
}
...
}
我一直在尝试做同样的事情,但是我发现Android应用程序不播放swf视频,所以事情是您必须将其转换为mp4或android可以播放的任何其他扩展名。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.