我写了个视频播放类 VideoSurfaceView
public class Videotest extends Cocos2dxActivity {
public static Handler handler;
public static Videotest s_instance;
public static VideoSurfaceView videoSurfaceView;
@SuppressLint(“HandlerLeak”)
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.v(“URI:::::::::”, “trace”);
s_instance = this;
handler=new Handler(){
public void HandlerMessage(final Message msg){
switch(msg.what){
case 1:
videoSurfaceView=new VideoSurfaceView(s_instance);
s_instance.setContentView(videoSurfaceView);
break;
}
}
};
}
static {
System.loadLibrary(“game”);
}
static public void playVideo(final int title){
Message msg=handler.obtainMessage();
msg.what=1;
handler.sendMessage(msg);
}
quick 调用 playVideo 成功
但是就是无法播放视频
另外:
videoSurfaceView=new VideoSurfaceView(s_instance);
s_instance.setContentView(videoSurfaceView);
在 onCreate 方法里是可以播放的
求教咋破